-!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,t){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),t.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),t.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),t.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.login","app.forgot","app.reset","app.errors"])}(),function(){"use strict";function e(e,t){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),t.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),t.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,t,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:t.id}).then(function(e){var t=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var n=0;n<s.joins.length;n+=1)t.push(i.getColumns(s.joins[n].foreignTable))}catch(e){console.log(e)}return a.all(t)}).then(function(e){for(var t=0;t<e.length;t+=1)s.joins[t].foreignTableFields=_.difference(_.keys(e[t]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),t.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("squareProject@get",{id:t.id})}],users:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,t){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),t.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",controller:"AgentsChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatQueues",channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getChatQueues")}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,t){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,t){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),t.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,t,n){return t.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},n)):e.resolve("userProfile@getResources",_.merge({id:t.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},n))}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",limit:10,offset:0})}],listsMap:["lists",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",{id:t.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHoppers",{id:t.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperFinals",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperHistories",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getJscriptySessions",{id:t.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,t){return t.ListId?e.resolve("cmList@getCustomFields",{id:t.ListId}):null}],tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get"):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),t.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(t,e){var a;return(e.hasRole("admin")?t.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):t.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return a=e,t.resolve("rpc@getVoiceQueues")}).then(function(e){if(e)for(var t,n=0;n<e.rows.length;n+=1)(t=_.find(a.rows,{id:e.rows[n].id}))&&_.merge(t,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return a})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:100})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",data:{selectedTab:0},views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth",function(e,t,n){var a=n.getCurrentUser();return a&&"agent"===a.role?t.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):t.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){var t=e.getCurrentUser();return t&&"agent"===t.role?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,t){return e.resolve("user@getLists",{id:t.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver","Auth",function(e,t){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],chatWebsites:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],openchannelAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),t.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",controller:"AgentsFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxQueues",channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getFaxQueues")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.help",{abstract:!0,url:"/help"}),t.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,t){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}),t.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),t.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver","Auth",function(e,t){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),t.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",controller:"AgentsMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailQueues",channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getMailQueues")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,t){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),t.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),t.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",controller:"AgentsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),t.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",controller:"AgentsOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelQueues",channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getOpenchannelQueues")}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),t.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,stunaddr,turnaddr,turnusername,turnpassword,phoneBarAutoUpdater,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,messagesAlignment,phoneBarRememberMeEnabled",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{smtps:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),t.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),t.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",controller:"AgentsSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsQueues",channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getSmsQueues")}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver","Auth",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",role:"admin,user",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,t){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),t.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,t){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,t){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,t){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,t){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}),t.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",controller:"AgentsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.inboundroutes",{url:"/inboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/inboundroutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundroutes.edit",{url:"/:id?tab",params:{inboundroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.outboundroutes",{url:"/outboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/outboundroutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundroutes.edit",{url:"/:id?tab",params:{outboundroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.internalroutes",{url:"/internalroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/internalroutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalroutes.edit",{url:"/:id?tab",params:{internalroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),t.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,t){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),t.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e,n,t,a){e.$on("$stateChangeStart",function(e,t){return t.hasOwnProperty("authenticate")&&t.authenticate&&!a.isLoggedIn()?(e.preventDefault(),n.go("app.login",{},{reload:!0,notify:!0})):a.isLoggedIn()&&t.hasOwnProperty("permissionId")&&t.permissionId&&!a.hasRole("admin")?a.reloadPermissions().then(function(){if(!a.hasPermission(t.permissionId))return e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})}).catch(function(){return e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})}):void 0})}e.$inject=["$rootScope","$state","$window","Auth"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,i,s,o,t,r){var l,d=["id","role","fullname","name","internal","email","userpic","permissions","md5secret","phoneBarAutoAnswer","phoneBarAutoAnswerDelay","phoneBarEnableRecording","phoneBarEnableDtmfTone","voicePause","chatPause","mailPause","faxPause","smsPause","openchannelPause","phoneBarEnableSettings","phoneBarExpires","pauseType","showWebBar","phoneBarRemoteControlPort","phoneBarRemoteControl","lastLoginAt","lastPauseAt","crudPermissions","allowmessenger","passwordResetAt","alias","phoneBarPrefixRequired","hotdesk","userProfileId"];function c(e){var t=s.defer();return m("agent")&&0!==l.showWebBar?o.user.login({id:l.id,device:"web",intrf:e}).$promise.then(function(){console.log("AGENT LOGGED IN"),t.resolve()}).catch(function(e){console.error(e),t.reject(e)}):m("admin")||m("user")?o.user.update({id:l.id},{online:!0,lastLoginAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise}function n(){if(i.remove("motion.user"),i.remove("motion.token"),l&&l.id){var e=l.id;l=null,t.localStorage.removeItem("motion.user:"+e)}}function m(e){return!!l&&l.role===e}function u(e){return!!l&&_.includes(l.permissions,e)}function e(){return i.get("motion.token")}function p(e){return l=_.assign(l,_.pick(e,d)),i.put("motion.user",JSON.stringify(l)),m("user")&&g().then(function(e){l.permissions=e}),l}function g(){var i=[];return s(function(t,n){var a=[];return l||t(a),o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){return i=e&&e.rows?e.rows:[],_.isEmpty(i)||(a=_.map(_.filter(i,function(e){return e.enabled}),function(e){return e.sectionId})),a}).then(function(t){if(_.includes(t,100)){var e=_.find(i,{sectionId:100});return e.autoAssociation?(t.push(101),t):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)&&t.push(101),t})}return t}).then(function(t){if(_.includes(t,1003)||_.some(i,{enabled:!1,sectionId:1003})){var e=_.find(i,{sectionId:1003});return e.autoAssociation?o.dashboard.get().$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.id+99999)}),t}):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.resourceId+99999)}),t})}return t}).then(function(t){if(_.includes(t,1801)||_.some(i,{enabled:!1,sectionId:1801})){var e=_.find(i,{sectionId:1801});return e.autoAssociation?o.plugin.get().$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.id+88888)}),t}):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.resourceId+88888)}),t})}return t}).then(function(e){t(e)}).catch(function(e){n("Error retrieving user profile permissions",e)})})}function v(){return s(function(t,n){g().then(function(e){l.permissions=e,t()}).catch(function(e){n(e)})})}return function(){if(i.get("motion.user"))l=JSON.parse(i.get("motion.user")),o.user.get({id:l.id,fields:d.join(",")}).$promise.then(function(e){if(e)return p(e)}).catch(function(e){console.log("Error retrieving user",e)})}(),{login:function(e){var t,n=s.defer();return o.auth.local(e).$promise.then(function(e){return t=e,i.put("motion.token",e.token),o.user.get({id:e.id,fields:d.join(",")}).$promise}).then(function(e){(l=e).lastLoginAt=moment(),i.put("motion.user",JSON.stringify(e))}).then(function(){if(m("agent")&&1==l.showWebBar&&l.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver","Auth",function(e,t){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return c(e)}).catch(function(e){n.reject(e.data)}).finally(function(){o.user.get({id:t.id,fields:d.join(",")}).$promise.then(function(e){l=e,m("user")&&g().then(function(e){l.permissions=e}),n.resolve()}).catch(function(e){console.log("Error update user login",e),n.reject(e.data)})}),n.promise},logout:function(e){var t;return s.defer(),e?(n(),s.resolve()):(t=s.defer(),m("agent")&&0!==l.showWebBar?o.user.logout({id:l.id,device:"web"}).$promise.then(function(){console.log("AGENT LOGGED OUT")}).catch(function(e){console.error(e)}).finally(function(){t.resolve()}):m("admin")||m("user")?o.user.update({id:l.id},{online:!1}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise).then(n).catch(function(e){console.error(e)})},queueLogin:c,isLoggedIn:function(){return!(!l||!e())},getPermissions:g,reloadPermissions:v,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return u(e)})},hasModulePermissions:function(i){return s(function(a,t){m("admin")?a(!0):o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(_.isEmpty(t))a(!1);else{var n=_.filter(t,function(e){return e.enabled});a(_.some(n,["category",i]))}}).catch(function(e){t(e)})})},hasModulesPermissions:function(i){return s(function(n,t){var a={};m("admin")?(i.forEach(function(e){a[e]=!0}),n(a)):o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];_.isEmpty(t)?n({}):(_(t).filter(function(e){return e.enabled&&_.includes(i,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value().forEach(function(e){a[e]=!0}),n(a))}).catch(function(e){t(e)})})},hasRole:m,hasPermission:u,hasSectionPermissions:function(a){return s(function(e,t){var n={};return v().then(function(){_.includes(l.permissions,a)&&(n[a]=!0),e(n)}).catch(function(e){t(e)})})},hasSectionsPermissions:function(a){return s(function(e,t){var n={};if(!m("admin"))return v().then(function(){a.forEach(function(e){_.includes(l.permissions,e)&&(n[e]=!0)}),e(n)}).catch(function(e){t(e)});a.forEach(function(e){n[e]=!0}),e(n)})},getToken:e,getCurrentUser:function(){return l},parseCrudPermissions:function(e){return m("admin")?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},updateCurrentUser:p,removeCookies:n}}e.$inject=["$mdDialog","$cookies","$q","api","$window","$document"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(t,e){this.telephones=e,this.closeDialog=function(e){t.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s;return{request:function(e){var t=n.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&t&&(e.headers.Authorization="Bearer "+t),e},responseError:function(e){switch(e.status){case 401:n.remove("motion.user"),n.remove("motion.token"),(s||(s=a.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(t){var n={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t},isSameOrigin:function(i,e){return i=n.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(n.urlParse)).push(t.location),1<=(e=e.filter(function(e){var t=i.hostname===e.hostname,n=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return t&&n&&a})).length}};return n}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var n={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(n[e]))return!1;return n[e]},setConfig:function(e,t){n[e]=t}};return e}})}(),function(){"use strict";function e(e,t,n,a){t.debugEnabled(!0),e.config({tabindex:!1}),a.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0}),n.config({wheelPropagation:!0})}e.$inject=["$ariaProvider","$logProvider","msScrollConfigProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,t,n){(t.generate(),n.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,t){var s;return t.code||(s=e.html(),e.empty()),function(n,a,r){r.code&&(s=n.$eval(r.code));var i=n.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(n));var t=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(t),o(function(){!function(e,t){var n=t.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),n.append(o.value).addClass("highlight")}(e,t)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,t){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",t)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(n,t,a,i,s,o,e,r,l){function d(e){switch(n.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(n.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return t.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}n.currentUser=e.getCurrentUser(),n.showMenu=function(){return n.target&&n.target.indexOf("@")<0&&n.target!=n.currentUser.internal&&n.target!=n.currentUser.name&&(0==n.currentUser.showWebBar&&n.currentUser.phoneBarRemoteControl||2==n.currentUser.showWebBar&&n.license.webrtc)&&!n.disabled},n.call=function(e){return 2!==n.currentUser.showWebBar?(t=e,l.user.getVoicePrefixes({id:n.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:n.currentUser.phoneBarPrefixRequired}})}).then(function(e){n.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+t):e&&-1!==e?d(e+t):e||d(t)})):d(e);var t},n.transfer=function(e){switch(n.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(n.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:t.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,t,n,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var t={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){return t}}).directive("msDatepickerFix",e)}(),function(){"use strict";angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"="},controller:["$scope",function(o){o.canTransfer=function(e,t,n){if(!t.readOnly)return void 0!==e.isValid&&e.isValid?n?o.transfer(t.selectedItems,t.items,t.selectedItems.indexOf(e),n):o.transfer(t.items,t.selectedItems,t.items.indexOf(e),n):void 0},o.transfer=function(e,t,n,a){var i=[];if(0<=n)i.push(e[n]),t.push(e[n]),e.splice(n,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&t.push(e[s]);for(var s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=t}o.options.transferCallback&&o.options.transferCallback(i,a)},o.getLine=function(e,t){var n="";if(_.isNil(t))return n;if(_.isArray(t)){for(var a=0;a<t.length;a++)n+=" "+(e[t[a]]?e[t[a]]:"");return n}return e[t]?e[t]:""}}],templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(n,e){var t=e.emojioneArea({pickerPosition:n.pickerPosition,search:n.search,recentEmojis:n.recentEmojis,placeholder:a.instant(n.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,t){n.ngModel=this.getText(),n.onReply({event:t,body:this.getText()})},emojibtn_click:function(){n.ngModel=this.getText()}}});n.ngModel&&t[0].emojioneArea.setText(n.ngModel),n.internalControl=n.ctrlMethods||{},n.internalControl.setText=function(e){t[0].emojioneArea.setText(e)},n.internalControl.getText=function(){return t[0].emojioneArea.getText()},n.$watch("ngModel",function(e){e||t[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var t=this;function e(){return t.forms.length}function n(){return 0===t.selectedIndex}function a(){return t.selectedIndex===e()-1}t.forms=[],t.selectedIndex=0,t.registerForm=function(e){t.forms.push(e)},t.previousStep=function(){if(n())return;t.selectedIndex--},t.nextStep=function(){if(a())return;t.selectedIndex++},t.firstStep=function(){t.selectedIndex=0},t.lastStep=function(){t.selectedIndex=e()-1},t.totalSteps=e,t.isFirstStep=n,t.isLastStep=a,t.currentStepInvalid=function(){return angular.isDefined(t.forms[t.selectedIndex])&&t.forms[t.selectedIndex].$invalid},t.previousStepInvalid=function(){return 0<t.selectedIndex&&angular.isDefined(t.forms[t.selectedIndex-1])&&t.forms[t.selectedIndex-1].$invalid},t.formsIncomplete=function(){for(var e=0;e<t.forms.length;e++)if(t.forms[e].$invalid)return!0;return!1},t.resetForm=function(){for(var e=t.selectedIndex=0;e<t.forms.length;e++)t.forms[e].$setPristine(),t.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,t,n,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,t){var n=i.find("ms-info-bar-active"),a="ms-info-bar-active";n.addClass(a),e.removeInfoBar=function(){n.removeClass(a),t.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,t={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},n=!0;function i(){n&&e.cancel(n),n=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),t=0;t<d.items.length;t++){var n,a,i,s,o=d.items[t];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=t%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,n=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+n+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(t,d.options):t,r.$watch(function(){return d.container.width()},function(e,t){e!==t&&i()})},d.waitImagesLoaded=function(e,t){if("undefined"!=typeof imagesLoaded){var n=a.imagesLoaded(e);n.on("done",function(){t()})}else t()},r.$on("msMasonry:relayout",function(){i()})}function t(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,t,n,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,t,n,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",t).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,t,n,a){a.waitImagesLoaded(t,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return t.height()},function(e,t){e!==t&&a.reLayout()})}),t.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(n,e,a,i){var s=this;function o(e,t){s.selectedPalette=e,s.selectedHues=t}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,t){s.selectedColor={palette:e,hue:t,class:"md-"+e+"-"+t+"-bg",bgColorValue:i.rgba(s.palettes[e][t].value),fgColorValue:i.rgba(s.palettes[e][t].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),n.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,n.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,t){l(e,t),d(),a.hide()},s.removeColor=r,n.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,t;if("class"===s.msModelType){var n=s.modelCtrl.$viewValue.split("-");t=5<=n.length?(e=n[1]+"-"+n[2],n[3]):(e=n[1],n[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,t=s.modelCtrl.$viewValue.hue||500);l(e,t)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,t,n,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,t){return 1===t.nodeType})).length&&t.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,t,n){var a="true"===n.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=t.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),t.off("mouseenter mouseleave")}v.setFoldable(e,t,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),t.off("mouseenter mouseleave")})}}}function t(n,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){n.$broadcast("msNav::expandMatchingToggles");var t=n.$on("$stateChangeSuccess",function(){n.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){t()})}}}}function n(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,t){return e.addClass("ms-nav-toggle"),angular.isUndefined(t.collapsed)&&(t.collapsed=!0),e.attr("collapsed",t.collapsed),function(a,i,e,n){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},t=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var t=angular.element(i.find("ms-nav-toggle-items")[0]);t.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=t[0].offsetHeight;return t.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(t,{display:"block",height:"0px"},{height:n+"px"},s.expandAnimation).then(function(){t.addClass(s.expanded),t.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var t=angular.element(i.find("ms-nav-toggle-items")[0]),n=t[0].offsetHeight;return a.$evalAsync(function(){p.animate(t,{height:n+"px"},{height:"0px"},s.collapseAnimation).then(function(){t.removeClass(s.expanded),t.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(t,function(e){var t=angular.element(e).attr("ui-sref");angular.isUndefined(t)||(t=t.replace(r,""),o.push(t))}),n.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(n.isDisabled())return;n.disable(),l()?(n.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){n.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=n.getLockedItems(),t=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(t=!0)}),t||c().then(function(){n.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){n.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var t=g.current.name,n=!1;angular.forEach(o,function(e){t===e&&(n=!0)}),n?d():c()}),a.$on("msNav::pushToLockedList",function(){n.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],t.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],n.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var n={};return{setFoldable:function(e,t){n={scope:e,element:t}},isNavFoldedOpen:function(){return n.scope.isNavFoldedOpen()},toggleFold:function(){n.scope.toggleFold()},openFolded:function(){n.scope.openFolded()},closeFolded:function(){n.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,t=!1,n=[],a=[];e.isDisabled=function(){return t},e.enable=function(){t=!1},e.disable=function(){t=!0},e.setToggleItem=function(e,t){n.push({element:e,scope:t})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,t){a.push({element:e,scope:t})},e.clearLockedItems=function(){a=[]}}).directive("msNav",t).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",n)}(),function(){"use strict";function e(e,t){e.root?this.navigation=t.getNavigation(e.root):this.navigation=t.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},t.sort()}function t(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,t){var n=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),n.addClass("ms-navigation-folded"),r();else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){t.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.addClass("ms-navigation-folded-open"),a.remove(),n.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),n.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),n.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function n(n,e,a,i,t,s){var o=this;o.element=e,o.node=n.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),t=e[0].offsetHeight;n.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:t+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),n.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),n.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:t+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===t.current.name||t.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,n)}n.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&n.$evalAsync(function(){o.collapsed=!1})}),n.$on("msNavigation::collapse",function(e,t){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(t))o.collapse();else{var n=t.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<n.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),n.$on("$stateChangeSuccess",function(){if(o.node.state===t.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;s.setActiveItem(o.node,n),a.$broadcast("msNavigation::collapse",o.node._path)}if(t.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched")}})}()}function a(t){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){t.setNavigationScope(e)}}}}function i(n,e,t,a,i){var s=this;s.element=e,s.node=n.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;n.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,n)}n.$on("msNavigation::stateMatched",function(){s.hasChildren&&n.$evalAsync(function(){s.isActive=!0})}),n.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],t=i.getActiveItem();t&&(e=t.node._path.split(".")),-1<e.indexOf(s.node._id)?n.$evalAsync(function(){s.isActive=!0}):n.$evalAsync(function(){s.isActive=!1})}}),n.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,n),t.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,t,n,a){t.on("click",function(){if(!a.hasChildren||i("gt-md"))return;t.toggleClass("expanded")}),e.$on("$destroy",function(){t.off("click")})}}}}e.$inject=["$scope","msNavigationService"],t.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],n.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function o(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,s=0;s<t.length;s++)if(t[s]._id===a){t=t[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(o),t=o.children}}return t}(n),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,t),s.uisref=m(s)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=m(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){if(angular.isString(e)){for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],s=0;s<t.length;s++)if(t[s]._id===i){if(t[s]._path===e)return t.splice(s,1),!0;t=t[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function c(e){e||(e=l).sort(a);for(var t=0;t<e.length;t++){var n=e[t].children;1<n.length&&n.sort(a),0<n.length&&c(n)}}function a(e,t){return parseInt(e.weight)-parseInt(t.weight)}function m(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=o,this.deleteItem=d,this.sortByWeight=c,this.$get=function(){var n=null,t=null,a=null,i=null,e={saveItem:o,deleteItem:d,sort:c,clearNavigation:function(){l=[],t&&(t.vm.navigation=l)},setActiveItem:function(e,t){n={node:e,scope:t}},getActiveItem:function(){return n},getNavigation:s,getFlatNavigation:function(e){return function e(t){var n=[];for(var a=0;a<t.length;a++){var i=angular.copy(t[a]);i.children=[],n.push(i),0<t[a].children.length&&(n=n.concat(e(t[a].children)))}return n}(s(e))},setNavigationScope:function(e){t=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){t.toggleFolded()}};return e;function s(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}}}).controller("MsNavigationController",e).directive("msNavigation",t).controller("MsNavigationNodeController",n).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,t,n,a){a.collapsable&&t.on("click",a.toggleCollapsed),e.$on("$destroy",function(){t.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(i,n,s,e,a,o,t,r,l,d,c){var m=this,u=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],p=JSON.parse(t.localStorage.getItem("motion2.user:"+m.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};function g(e){switch(e){case"ringing":m.conf.ringingMute?m.soundPlayer.muted=!0:m.soundPlayer.muted=!1,m.conf.ringingId&&m.soundPlayer.setSinkId(m.conf.ringingId).then(function(){m.soundPlayer.volume=m.conf.ringingVolume}).then(f).catch(function(e){console.info(e.message,m.conf.ringingId)});break;case"speaker":m.conf.speakerMute?m.remotePlayer.muted=!0:m.remotePlayer.muted=!1,m.conf.speakerId&&m.remotePlayer.setSinkId(m.conf.speakerId).then(function(){m.remotePlayer.volume=m.conf.speakerVolume}).then(f).catch(function(e){console.info(e.message,m.conf.speakerId)});break;case"microphone":for(var t=0;t<m.sessions.length;t+=1)m.conf.microphoneMute?m.sessions[t].mute():m.sessions[t].unmute();f();break;default:console.log("unknown device")}}function v(e,t,n){m.calls.unshift({target:e,fullname:n||e,inbound:t,time:moment().format("HH:mm")}),50<m.calls.length&&m.calls.pop()}function h(){return m.conf.license&&m.conf.isWebRTCSupported&&m.conf.hasMicrophone&&m.conf.hasSpeakers&&"https"===m.conf.protocol&&("chrome"===m.conf.browserName.toLowerCase()||"opera"===m.conf.browserName.toLowerCase()||"safari"===m.conf.browserName.toLowerCase())}function f(){p.webrtc=_.pick(m.conf,u),t.localStorage.setItem("motion2.user:"+m.conf.id,JSON.stringify(p))}function b(e){this.remotePlayer.srcObject=e.stream}function E(e){var t,n,a=e.session;switch(e.originator){case"local":a.outgoing=!0,a.name=e.request.ruri.user,a.user=e.request.ruri.user,v(a.user,!1);break;case"remote":a.incoming=!0,a.name=e.request.from.display_name,a.user=e.request.from.uri.user,t=e.session,n=t.name?t.name+" <"+t.user+">":t.user,c.create("Incoming call from: ",n,null,function(){t.answer(m.sessionConf)},function(){t.terminate()}).then(function(e){t.notification=e}).catch(function(e){console.error(e)}),v(e.session.user,!0),m.conf.autoAnswer&&s(function(){a.isInProgress()&&(a.autoAnswer=!0,m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,a.answer(m.sessionConf))},m.conf.autoAnswerDelay?1e3*m.conf.autoAnswerDelay:0)}a.call_id=e.request.call_id,a.connection&&(a.connection.onaddstream=b.bind(this)),a.on("progress",function(e,t){var n=!1;switch(t.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),n=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),n=!0}n&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){console.log(e.message)}))}.bind(this,a)),a.on("confirmed",function(n,e){return n.confirmed=!0,"remote"===e.originator&&n.connection&&(n.connection.onaddstream=b.bind(this),_.head(n.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(n.connection.getRemoteStreams()))),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(n),g("speaker"),g("microphone"),n.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){console.log(e.message)})),2==m.sessions.length?m.canGoInConference=!0:m.canGoInConference=!1,d.rpc.getVoiceChannels().$promise.then(function(e){var t=_.find(e.rows,function(e){return e.sipcalllinkedid===n.call_id?e:e.sipcalluniqueid===n.call_id?e:null});t&&(n.monitor=t.monitor,n.uniqueid=t.uniqueid,n.monitors=t.monitors)}).catch(function(e){console.error(e)})}.bind(this,a)),a.on("hold",function(e,t){"local"===t.originator&&(e.localHold=!0)}.bind(this,a)),a.on("unhold",function(e,t){"local"===t.originator&&(e.localHold=!1)}.bind(this,a)),a.on("ended",function(e,t){_.includes(m.currentConferenceSessions,e.id)&&T(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),a.on("failed",function(e,t){this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),_.includes(m.currentConferenceSessions,e.id)&&T(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),this.sessions.push(a)}function A(){m.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",i.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function y(e,t,n,a){return function(){o.show(o.simple().textContent(t).position(n).hideDelay(a)),e.terminate()}}function S(t){return d.user.getVoicePrefixes({id:m.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{prefixes:e,required:m.conf.phoneBarPrefixRequired}})}).then(function(e){if(m.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+t}else{if(e&&-1!==e)return e+t;if(!e)return t}})}function T(){m.canGoInConference=!1,m.isInConference=!1,m.currentconferenceSessions=[]}e(function(){},999),m.direction="right",m.selectedMode="md-scale",m.target="",m.showDialpad=!1,m.soundPlayer=document.createElement("audio"),m.remotePlayer=document.getElementById(m.conf.remotePlayerId),m.soundPlayer.volume=1,m.sessionConf={mediaConstraints:{audio:!0,video:!1}},m.sessions=[],m.calls=[],m.canGoInConference=!1,m.isInConference=!1,m.currentConferenceSessions=[],m.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+m.conf.host+":8089/ws")],uri:new JsSIP.URI("sip",m.conf.name,m.conf.host,5060,null,null).toString(),authorization_user:m.conf.name,ha1:m.conf.ha1,realm:m.conf.realm,user_agent:m.conf.ua,session_timers_refresh_method:"invite",register_expires:m.conf.phoneBarExpires||60,register:!0}),m.conf=_.merge(p.webrtc,m.conf),n.bind("keyup",function(e){switch(e.keyCode){case 27:s(function(){m.showDialpad=!1})}}),m.$onInit=function(){g("ringing"),g("speaker"),this.ua.on("registered",function(){console.log("registered"),this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){console.log("unregistered"),this.registered=!1}.bind(this)),this.ua.on("newRTCSession",E.bind(this)),DetectRTC.load(function(){this.conf.hasMicrophone=DetectRTC.hasMicrophone,this.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,this.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,this.conf.osName=DetectRTC.osName,this.conf.osVersion=DetectRTC.osVersion,this.conf.browserName=DetectRTC.browser.name,this.conf.browserVersion=DetectRTC.browser.version,h()?this.ua.start():this.conf.license||l.warning({title:r.instant("TOOLBAR.WARNING"),msg:r.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))}.bind(this),m.type=function(e,t){var n=e;switch(m.target||(m.target=""),t&&(m.target+=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)),e){case"*":n="asterisk";break;case"#":n="pound"}m.conf.enableDtmfTone&&(m.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+n+".ogg"),m.soundPlayer.play().catch(function(e){console.log(e.message)}));for(var a=0;a<m.sessions.length;a+=1)m.sessions[a].isEstablished()&&!m.sessions[a].isOnHold().local&&m.sessions[a].sendDTMF(e)},m.call=function(){if(m.target&&m.target!==m.conf.name&&m.target!==m.conf.internal){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0;var e=m.target.replace(/ /g,"");return S(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&m.ua.call(e,m.sessionConf)}).then(function(){A()})}},m.hold=function(e){e.hold({useUpdate:!1})},m.refer=function(t){var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return S(e)}).then(function(e){t.refer(e,{eventHandlers:{requestSucceeded:y(t,"requestSucceeded","top right",3e3),requestFailed:y(t,"requestFailed","top right",3e3)}})})},m.record=function(e){a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{session:e,sessions:m.sessions}})},m.unhold=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.answer=function(e){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,e.answer(m.sessionConf)},m.terminate=function(e){e.terminate()},m.selectSession=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":m.type(e.key);break;case"enter":m.call()}},m.toggleDialpad=function(){m.showDialpad=!m.showDialpad},m.referAttended=function(e){a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(m.sessions,{id:e.id})}})},m.closeDialpad=function(){m.showDialpad=!1},m.initDevice=g,m.putOtherCallsOnHold=function(e){if(1<m.sessions.length)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].id===e.id||m.sessions[t].isOnHold().remote||m.sessions[t].hold({useUpdate:!1})},m.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|\-)*$/.test(e)?(m.target=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)):m.target?i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target):A():A()},m.targetSelected=function(e){e&&(m.target=e.originalObject.target,m.call(),A())},m.start3WayConf=function(){m.isInConference=!0,m.canGoInConference=!1,m.confSessions=[];var a=[];m.sessions.forEach(function(e){m.currentConferenceSessions.push(e.id),e.unhold({useUpdate:!1}),null!=e&&e.connection.getReceivers().forEach(function(e){a.push(e.track)})});var i=new AudioContext,s=new MediaStream;m.sessions.forEach(function(e){if(null!=e){var n=i.createMediaStreamDestination();e.connection.getReceivers().forEach(function(t){a.forEach(function(e){s.addTrack(t.track),t.track.id!==e.id&&i.createMediaStreamSource(new MediaStream([e])).connect(n)})}),e.connection.getSenders().forEach(function(e){i.createMediaStreamSource(new MediaStream([e.track])).connect(n)}),e.connection.getSenders()[0].replaceTrack(n.stream.getTracks()[0])}});var e=document.getElementById("remote-audio");e.srcObject=s;var t=e.play();void 0!==t&&t.then(function(){}).catch(function(e){console.log(e)})},i.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:m.conf}}).then(function(e){e&&(m.conf=e,g("ringing"),g("speaker"))})}),i.$on("webrtc::logout",function(){m.ua.stop()}),i.$on("webrtc::call",function(e,t){t.target&&(m.target=t.target,m.call())}),i.$on("webrtc::transfer",function(e,t){if(t.target)for(var n=0;n<m.sessions.length;n+=1)if(m.sessions[n].isEstablished()&&!m.sessions[n].isOnHold().local)return S(t.target).then(function(e){e&&m.sessions[n].refer(e,{eventHandlers:{requestSucceeded:y(m.sessions[n],"requestSucceeded","top right",3e3),requestFailed:y(m.sessions[n],"requestFailed","top right",3e3)}})})})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","toasty","api","motNotification"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(t,e,n){var a=this;a.prefixes=e,a.required=n,a.closeDialog=function(e){t.hide(e)},a.call=function(){t.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,t){function n(){t.css("display","inline"),i(a,1e3)}function a(){t.css("display","none"),i(n,1e3)}n()}],replace:!0}}function t(t,i,s,e,n){var o=this;function a(t,e){console.log("startMonitor");var n=i.defer(),a=(e||t.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){t.filename=a+".wav",t.mixmonitorid=e.mixmonitorid,t.status="rec",o.session.monitor=!0,n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise}o.title="Record",o.sessions=e,o.session=n,o.closeDialog=function(){t.hide()},o.addRecording=function(){var e=t.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");t.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(t){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:t.mixmonitorid}).$promise.then(function(e){t.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],t.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",t)}(),function(){"use strict";function e(t,a,i,e){var s=this;function o(e){t.hide(e)}s.title="Refer Attended",s.sessions=i,s.session=e,s.sessionTarget=null,i.length&&(s.target=i[0].user),s.closeDialog=o,s.transfer=function(){var e,t,n=_.find(i,function(e){if(e.user===s.target)return e});t=n.outgoing?(e=n,s.session):(e=s.session,n);t.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:function(e){a.show(a.simple().textContent("requestSucceeded").position("top right").hideDelay(3e3)),o(),t.terminate()},requestFailed:function(e){a.show(a.simple().textContent("requestFailed").position("top right").hideDelay(3e3)),o(),t.terminate()}}})}}e.$inject=["$mdDialog","$mdToast","sessions","session"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,t){var n=this;function a(e,t,n){var a;if(s[n]){if(a=_.find(e,function(e){return e.deviceId===s[n]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===t});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===t}))&&(s[n]=a.deviceId);return s[n]||null}s.ringingId=a(t,"audiooutput","ringingId"),s.speakerId=a(t,"audiooutput","speakerId"),s.microphoneId=a(t,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,n.conf=angular.copy(s),n.devices=t,n.saveSettings=function(){e.hide(n.conf)},n.closeDialog=function(){e.hide()},n.isCompatibleBrowser=function(){return"chrome"===n.conf.browserName.toLowerCase()||"opera"===n.conf.browserName.toLowerCase()||"safari"===n.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,t){var n=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];t.addClass(n)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(t,e){var n=!1,a=document.createElement("audio");t.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){n||(n=!0,e.preventDefault(),i[t.model||"voiceRecording"].download({id:t.id}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(n)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,t){var n=angular.element('<div class="ms-responsive-table-wrapper"></div>');t.after(n),n.append(t)}}})}(),function(){"use strict";function e(s,o,t,n){return{restrict:"AE",compile:function(e){if(!(n.getConfig("disableCustomScrollbars")||n.getConfig("disableCustomScrollbarsOnMobile")&&t.isMobile()))return e.addClass("ms-scroll"),function(e,t,n){var a={};function i(){PerfectScrollbar.update(t[0])}n.msScroll&&(a=e.$eval(n.msScroll)),a=angular.extend({},o.getConfig(),a),s(function(){PerfectScrollbar.initialize(t[0],a)},0),t.on("mouseenter",i),e.$watch(function(){return t.prop("scrollHeight")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$watch(function(){return t.prop("scrollWidth")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$on("$destroy",function(){t.off("mouseenter"),PerfectScrollbar.destroy(t[0])})}}}}e.$inject=["$timeout","msScrollConfig","msUtils","motionConfig"],angular.module("app.core").provider("msScrollConfig",function(){var t={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,stopPropagationOnClick:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(){return t}};return e}}).directive("msScroll",e)}(),function(){"use strict";function e(s,i,e){var o=this;o.collapsed=!0,o.query="",o.queryOptions={debounce:o.debounce||0};var t=!(!o.collapseOnBlur||"true"!=o.collapseOnBlur);o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.populateResults=function(e){if(o.collapsed)return;var t=angular.isArray(e),n=null===e;if(!t&&!n)return;o.selectedResultIndex=0,o.results=e},o.expand=function(){o.collapsed=!1,s.expand(),o.onExpand&&angular.isFunction(o.onExpand)&&o.onExpand()},o.collapse=function(){o.query="",o.populateResults(null),o.collapsed=!0,s.collapse(),o.onCollapse&&angular.isFunction(o.onCollapse)&&o.onCollapse()},o.blurCollapse=function(){if(!t)return;o.collapse()},o.absorbEvent=function(e){e.preventDefault()},o.handleKeydown=function(e){var t=e.keyCode;-1<[27,38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:if(!o.results)return;o.handleResultClick(o.results[o.selectedResultIndex]);break;case 27:o.collapse();break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,o.ensureSelectedResultIsVisible());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,o.ensureSelectedResultIsVisible())}},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.temporarilyIgnoreMouseEvents=function(){o.ignoreMouseEvents=!0,e.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=e(function(){o.ignoreMouseEvents=!1},250)},o.handleResultClick=function(e){o.onResultClick&&o.onResultClick({item:e});o.collapse()},o.ensureSelectedResultIsVisible=function(){var e=i.find(".ms-search-bar-results"),t=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;o.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},s.$watch("MsSearchBar.query",function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&!o.collapsed){var n=s.$parent.$eval(o.onSearch,{query:e}),a=angular.isArray(n),i=n&&!!n.then;a&&o.populateResults(n),i&&(o.resultsLoading=!0,n.then(function(e){o.populateResults(e)},function(){o.populateResults([])}).finally(function(){o.resultsLoading=!1}))}})}function t(i){return{restrict:"E",scope:{},require:"msSearchBar",controller:"MsSearchBarController as MsSearchBar",bindToController:{debounce:"=?",onSearch:"@",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"@"},templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),function(e,t){var n,a=i.find("body");e.collapse=function(){t.removeClass("expanded"),a.removeClass("ms-search-bar-expanded")},e.expand=function(){t.addClass("expanded"),a.addClass("ms-search-bar-expanded"),n.focus()},n=t.find("#ms-search-bar-input")}}}}e.$inject=["$scope","$element","$timeout"],t.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",t)}(),function(){"use strict";function e(e,n,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],t=l.getFlatNavigation(),n=r.defer(),a=0;a<t.length;a++)t[a].uisref&&e.push(t[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){n.resolve(e)},250),n.promise},d.loadShortcuts=function(){var e=r.defer(),t=angular.fromJson(n.get("motion.shortcuts"));angular.isUndefined(t)&&(t=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],n.put("motion.shortcuts",angular.toJson(t)));return e.resolve(t),e.promise},d.saveShortcuts=function(){var e=r.defer();return n.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var t=0;t<d.shortcuts.length;t++)d.shortcuts[t]._id===e._id&&(d.shortcuts.splice(t,1),d.query||(0===d.shortcuts.length?d.results=null:t>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var t=e.keyCode;-1<[38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),t=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,t){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,t,n,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(t.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,t){var n=e.$on("msSplashScreen::remove",function(){a.leave(t).then(function(){n(),e=t=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function t(){i.setCurrentStep(1)}function n(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!n(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,t,n){var a={element:e,scope:t,form:n,stepNumber:t.step||i.steps.length+1,stepTitle:t.stepTitle,stepTitleTranslate:t.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,t){return e.stepNumber-t.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),t()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,t=e;1<=t;t--)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,t=e;t<=i.steps.length;t++)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoFirstStep=t,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var t=!1,n=1;n<e;n++)if(!s(n)){t=!0;break}return t},i.isStepOptional=n,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function t(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(n.optionalStep),s.registerStep(t,e,i),t.hide()}}}}).directive("msVerticalStepper",t).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(n.optionalStep),e.stepInfo=s.registerStep(t,e,i),e.MsStepper=s,t.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,t){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function t(){var e=document.getElementById("bar-container"),t=document.getElementById("tab-container");return t.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==t.scrollLeft?"right":t.scrollWidth>e.scrollWidth&&t.scrollLeft>e.scrollLeft&&e.scrollWidth+t.scrollLeft>=t.scrollWidth?"left":t.scrollWidth>e.scrollWidth&&t.scrollLeft>e.scrollLeft&&e.scrollWidth+t.scrollLeft<t.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(t()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,n,t,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){n.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,t){var n=angular.element(t[0]);d(n).then(function(){m(function(){s=!0})})}):d(n).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,t){angular.equals(e,t)||e&&(n.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var t=u.defer(),n=e.find("img");return 0<n.length?n.on("load",function(){t.resolve("Image is loaded")}):t.resolve("No images"),t.promise}function c(){r.scrollTop()+r.height()>n.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var t=this;t.scrollEl=void 0,t.setScrollEl=function(e){t.scrollEl=e},t.getScrollEl=function(){return t.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,t,n,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner animate-rotate"></span></div>');t.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l){function d(){a.timeoutId&&clearTimeout(a.timeoutId)}function c(){void 0!==o.startTime&&(a.millis=moment().diff(moment(a.startTime))),a.maxTimeUnit&&"day"!==a.maxTimeUnit?"second"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3),a.minutes=0,a.hours=0,a.days=0,a.months=0,a.years=0):"minute"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4),a.hours=0,a.days=0,a.months=0,a.years=0):"hour"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5),a.days=0,a.months=0,a.years=0):"month"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24%30),a.months=Math.floor(a.millis/36e5/24/30),a.years=0):"year"===a.maxTimeUnit&&(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24%30),a.months=Math.floor(a.millis/36e5/24/30%12),a.years=Math.floor(a.millis/36e5/24/365)):(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24),a.months=0,a.years=0),a.secondsS=1===a.seconds||0===a.seconds?"":"s",a.minutesS=1===a.minutes||0===a.minutes?"":"s",a.hoursS=1===a.hours||0===a.hours?"":"s",a.daysS=1===a.days||0===a.days?"":"s",a.monthsS=1===a.months||0===a.months?"":"s",a.yearsS=1===a.years||0===a.years?"":"s",a.sseconds=a.seconds<10?"0"+a.seconds:a.seconds,a.mminutes=a.minutes<10?"0"+a.minutes:a.minutes,a.hhours=a.hours<10?"0"+a.hours:a.hours,a.ddays=a.days<10?"0"+a.days:a.days,a.mmonths=a.months<10?"0"+a.months:a.months,a.yyears=a.years<10?"0"+a.years:a.years}"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.autoStart=o.autoStart||o.autostart,0===r.html().trim().length?r.append(l("<span>{{millis}}</span>")(a)):r.append(l(r.contents())(a)),a.interval=a.intervalAttr||1e3,a.startTime=null,a.endTime=null,a.timeoutId=null,a.countdown=a.countdownAttr&&0<=parseInt(a.countdownAttr,10)?parseInt(a.countdownAttr,10):void 0,a.isRunning=!1,a.$watch("startTimeAttr",function(e,t){e!==t&&a.isRunning&&a.start()}),a.$on("timer-start",function(){a.start()}),a.$on("timer-resume",function(){a.resume()}),a.$on("timer-stop",function(){a.stop()}),a.$on("timer-clear",function(){a.clear()}),a.$on("timer-set-countdown",function(e,t){a.countdown=t}),a.start=r[0].start=function(){var e=moment(),t=a.startTimeAttr?moment(a.startTimeAttr):null;a.startTime=!t||e<t?e:t;var n=a.endTimeAttr?moment(a.endTimeAttr):null;a.endTime=!n||n<e?null:n,a.countdown||(a.countdown=a.countdownAttr&&0<parseInt(a.countdownAttr,10)?parseInt(a.countdownattr,10):void 0),d(),m(),a.isRunning=!0},a.resume=r[0].resume=function(){d(),a.countdownAttr&&(a.countdown+=1),a.startTime=moment().diff(moment(a.stoppedTime).diff(moment(a.startTime))),m(),a.isRunning=!0},a.stop=a.pause=r[0].stop=r[0].pause=function(){a.clear(),a.$emit("timer-stopped",{timeoutId:a.timeoutId,millis:a.millis,seconds:a.seconds,minutes:a.minutes,hours:a.hours,days:a.days})},a.clear=r[0].clear=function(){a.stoppedTime=moment(),d(),a.timeoutId=null,a.isRunning=!1},r.bind("$destroy",function(){d(),a.isRunning=!1});var m=function(){a.millis=moment().diff(a.startTime);var e=a.millis%1e3;if(a.endTimeAttr&&(a.millis=moment(a.endTime).diff(moment()),e=a.interval-a.millis%1e3),a.countdownAttr&&(a.millis=1e3*a.countdown),a.millis<0)return a.stop(),a.millis=0,c(),void(a.finishCallback&&a.$eval(a.finishCallback));c(),a.timeoutId=setTimeout(function(){m(),a.$digest()},a.interval-e),a.$emit("timer-tick",{timeoutId:a.timeoutId,millis:a.millis}),0<a.countdown?a.countdown--:a.countdown<=0&&(a.stop(),a.finishCallback&&a.$eval(a.finishCallback))};void 0!==a.autoStart&&!0!==a.autoStart||a.start()}e.$inject=["$scope","$document","$timeout","$interval","$window","$translate","$attrs","$element","$compile"],angular.module("app.core").controller("MsTimerController",e).directive("timer",function(){return{restrict:"EA",replace:!1,scope:{intervalAttr:"=interval",startTimeAttr:"=startTime",endTimeAttr:"=endTime",countdownAttr:"=countdown",autoStart:"&autoStart",maxTimeUnit:"="},controller:"MsTimerController"}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var a=this;a.filter=[],a.filtered=!1,a.fontSize=20,a.getCount=function(e){var t=0;if(e){a.fontSize=e.attrs[2]&&e.attrs[2].value?parseInt(e.attrs[2].value)-parseInt(e.attrs[2].value)%2:20,e.attrs[1].value&&e.attrs[1].value.length?(a.filtered=!0,a.filter=_.intersection(e.voiceQueuesSelected,e.attrs[1].value)):(a.filtered=!1,a.filter=e.voiceQueuesSelected);for(var n=0;n<e.voiceQueues.rows.length;n+=1)_.includes(a.filter,e.voiceQueues.rows[n].id)&&(t+=e.voiceQueues.rows[n][e.attrs[0].value]?parseInt(e.voiceQueues.rows[n][e.attrs[0].value]):0)}return t}})}(),function(){"use strict";function e(o,e){var r=this;r.filter=[],r.filtered=!1,r.properties=[],r.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},r.getMultiBarChart=function(e){e&&(e.attrs&&function(e){r.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(r.filtered=!0,r.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(r.filtered=!1,r.filter=e.voiceQueuesSelected);if(r.multiBarChart.series.length>r.properties.length){var t=r.multiBarChart.series.length-r.properties.length;r.multiBarChart.series.splice(0,t),r.multiBarChart.data.splice(0,t)}for(var n=0;n<r.properties.length;n+=1){if(r.multiBarChart.series[n]=o.instant("TOOLS."+r.properties[n].toUpperCase()),_.isNil(r.multiBarChart.data[n])&&(r.multiBarChart.data[n]=[]),r.multiBarChart.labels.length>r.filter.length){var a=r.multiBarChart.labels.length-r.filter.length;r.multiBarChart.labels.splice(0,a),r.multiBarChart.data[n].splice(0,a)}for(var i=0,s=0;i<e.voiceQueues.rows.length;i+=1)_.includes(r.filter,e.voiceQueues.rows[i].id)&&(r.multiBarChart.labels[s]=e.voiceQueues.rows[i].name,r.multiBarChart.data[n][s]=e.voiceQueues.rows[i][r.properties[n]]?parseInt(e.voiceQueues.rows[i][r.properties[n]]):0,s+=1)}}(e),e.foreground&&function(e){r.multiBarChart.options.legend.fontColor=e.foreground;for(var t=0;t<r.multiBarChart.options.scales.xAxes.length;t+=1)r.multiBarChart.options.scales.xAxes[t].ticks.fontColor=e.foreground;for(var n=0;n<r.multiBarChart.options.scales.yAxes.length;n+=1)r.multiBarChart.options.scales.yAxes[n].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);if(o.pieChart.labels.length>o.properties.length){var t=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,t),o.pieChart.data.splice(0,t)}for(var n=0,a=0;n<o.properties.length;n+=1){o.pieChart.labels[n]=s.instant("TOOLS."+o.properties[n].toUpperCase());for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[n]]?parseInt(e.voiceQueues.rows[i][o.properties[n]]):0);o.pieChart.data[n]=a,a=0}}(e),e.foreground&&(t=e,o.pieChart.options.legend.fontColor=t.foreground));var t}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,n,a,i){var s=this;function t(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,t).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(t){t&&t.attrs&&(t.attrs[0]&&t.attrs[0].value&&(s.query.id=t.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===t.attrs[0].type?t.attrs[0].value:void 0,CustomReportId:"custom"===t.attrs[0].type?t.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),t.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:t.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),t.attrs[1]&&t.attrs[1].value&&(s.refresh=parseInt(t.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(t.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=n(function(){s.interval&&a.cancel(s.interval),e(t)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&n.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&n.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,t){this.getTrustedURL=function(e){return t.trustAsResourceUrl(e)}}function t(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],t.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",t)}(),function(){"use strict";function e(e,t){var n=this;n.flipped=!1,n.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;n.flipped=!n.flipped,t.toggleClass("flipped",n.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var t=Date.now()-new Date(e);return t<36e5?moment(e).fromNow():t<864e5?moment(e).format("HH:mm"):t<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(t){return function(e){return t.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,t){if(0===e.length||!t)return e;if(0===t.length)return[];for(var n=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<t.length;o++){var r=t[o];if(i.id===r){s=!0;break}}s&&n.push(i)}return n}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,t,n){if(0===e.length||!n||0===n.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<n.length;r++){var l=n[r];if(-1<s[t].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,n){if(0===e.length||0===n.length)return e;var a=[];return e.forEach(function(e){var t=n.every(function(t){var n=!1;return e.tags.forEach(function(e){e.name!==t.name||(n=!0)}),n});t&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,t){if(0!==e.length&&0!==t.length){if(e.length<t.length)return[];var n=[],a=t.every(function(t){var n=!1;return e.forEach(function(e){e.name!==t.name||(n=!0)}),n});return a&&n.push(e),n}}})}(),function(){"use strict";function c(e,t,n,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=t,this.accept=n,this.reject=a,this.close=i}function m(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var n=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var t=_.find(e,function(e){return e.data.id===n.id});t&&t.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var l,n,d=[];"serviceWorker"in navigator&&m()?navigator.serviceWorker.register("notification.js").then(function(e){(l=e).update(),l.installing?n=l.installing:l.waiting?n=l.waiting:l.active&&(n=l.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===n){var t=_.find(d,{id:e.data.id});if(t)switch(e.data.action){case"accept":t.accept&&t.accept();break;case"reject":t.reject&&t.reject()}}}),{create:function(e,i,s,o,r){return new Promise(function(t,n){var a;m()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new c(e||"MyTitle",i||"MyBody",o,r),d.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return l.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,t){var n=e.split("@"),a=n[0],i=n[1],s=t||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var t=e.split("."),n=c,a=0;a<t.length;a++){if(angular.isUndefined(n[t[a]])){d.error('Resource part "'+t[a]+'" is not defined!'),n=!1;break}n=n[t[a]]}return n||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var n=angular.injector(["ng"]).get("$log"),a="",v=[];function t(e){a=e}function i(){return a}function s(e,t){angular.isString(e)?angular.isArray(t)?v[e]={url:a+(t[0]||""),paramDefaults:t[1]||[],actions:t[2]||[],options:t[3]||{}}:n.error('"resource" must be an array and it must follow $resource definition'):n.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=t,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:t,getBaseUrl:i,register:s,resolve:function(e,t){g.$broadcast("msApi::resolveStart");var n=e.split("@"),a=n[0],i=n[1],s=t||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,t,n,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=t||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(n)&&angular.isFunction(n)&&n(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,t){return-1<t.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],t=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function n(e){for(var t=0;t<e.length;t++){var n=e[t].string,a=e[t].prop;if(i=e[t].versionSearch||e[t].identity,n){if(-1!==n.indexOf(e[t].subString))return e[t].identity}else if(a)return e[t].identity}}function a(e){var t=e.indexOf(i);if(-1!==t)return parseInt(e.substring(t+i.length+1))}var s=n(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=n(t)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,t){-1===t.indexOf(e)?t.push(e):t.splice(t.indexOf(e),1)}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,t){var n=this;n.themes=t.themes,n.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],n.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],n.layoutMode="wide",n.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",n.setActiveTheme=function(e){t.setActiveTheme(e)},n.getActiveTheme=function(){return t.themes.active},n.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===n.layoutMode)},n.updateLayoutStyle=function(){e.put("motion.layoutStyle",n.layoutStyle),location.reload()}}function t(t){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){t("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],t.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",t)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(n){o[n.name]={},angular.forEach(n.colors,function(e,t){o[n.name][t]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var t=angular.copy(e);angular.forEach(t,function(n){angular.forEach(n,function(e,t){n[t]=e.levels,n[t].color=e.levels.default.color,n[t].contrast1=e.levels.default.contrast1,n[t].contrast2=e.levels.default.contrast2,n[t].contrast3=e.levels.default.contrast3,n[t].contrast4=e.levels.default.contrast4,delete n[t].default})}),s.setThemesList(t);var n=i.get("motion.selectedTheme");n?s.setActiveTheme(n):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,t){var n,a,i,s,o;(r={})["@themeName"]=t,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,n){angular.forEach(e,function(e,t){r["@"+a+d(n)+d(t)]=e})})}),n=r,a=new RegExp(Object.keys(n).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return n[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,t){var n=t||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),n&&(e=function(e,t){var n={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=n.white[t]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=n.black[t]);return e}(e,n)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(n,e,t){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(t.custom=i),n.alwaysWatchTheme(!0),angular.forEach(e,function(e){n.definePalette(e.name,e.options)}),angular.forEach(t,function(e,t){n.theme(t).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(t,n,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void n.error('You must have at least one theme named "default"'):(n.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void t.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],t.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(t,s,o,r){this.search=function(t){for(var e=[],n=r.getFlatNavigation(),a=o.defer(),i=0;i<n.length;i+=1)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?t.go(e.state,e.stateParams):t.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.code="",n.send=!1,n.error=e.params,n.sendReport=function(){t.post("/api/jira",n.error).then(function(e){n.send=!0,e.data&&(n.code=e.data.id)},function(e){n.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.cookieAlertHide=t.get("motion.cookieAlertHide:"+n.currentUser.id)||!1,n.cookieAlertOnClose=function(){t.put("motion.cookieAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){t.success({title:n.instant("FORGOTPASSWORD.LINK_SENT"),msg:n.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&t.error({title:n.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.newsAlertHide=t.get("motion.newsAlertHide:"+n.currentUser.id)||!1,n.newsAlertOnClose=function(){t.put("motion.newsAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e){var t={baseUrl:"api/"};return t.auth=e(t.baseUrl+"auth/local",{},{local:{method:"post",url:t.baseUrl+"auth/local"},forgot:{method:"post",url:t.baseUrl+"auth/local/forgot"},reset:{method:"post",url:t.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},google:{method:"post",url:t.baseUrl+"auth/google"}}),t.jira=e(t.baseUrl+"jira"),t.rpc=e(t.baseUrl+"rpc",{},{startMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:t.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:t.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:t.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:t.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:t.baseUrl+"rpc/sms/queues"},getOpenchannelQueues:{method:"get",url:t.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:t.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:t.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:t.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:t.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:t.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:t.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:t.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:t.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:t.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:t.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:t.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/fax/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:t.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:t.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:t.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:t.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:t.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:t.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),t.version=e(t.baseUrl+"version",{},{fetch:{method:"get",url:t.baseUrl+"version/fetch"},reset:{method:"get",url:t.baseUrl+"version/reset"},pull:{method:"get",url:t.baseUrl+"version/pull"},restart:{method:"get",url:t.baseUrl+"version/restart"},migrations:{method:"get",url:t.baseUrl+"version/migrations"}}),t.system=e(t.baseUrl+"system",{},{killProcess:{method:"get",url:t.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),t.pm2=e(t.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),t.user=e(t.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"users/describe"},clone:{method:"post",url:t.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"users/create_many",isArray:!0},addContacts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/contacts"},changePassword:{isArray:!1,method:"put",url:t.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/avatar"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/recordings"},getChatInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax/interactions"},login:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_websites"},getSquareProjects:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/square_projects"},addSquareProjects:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/square_projects"},removeSquareProjects:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/square_projects"},getScheduledCalls:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/api_key"}}),t.voiceChanSpy=e(t.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:t.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceContext=e(t.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:t.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceExtension=e(t.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:t.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"voice/extensions/:id/applications"}}),t.voiceMusicOnHold=e(t.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:t.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:t.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:t.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:t.baseUrl+"voice/mohs/:id/sounds"}}),t.voiceQueue=e(t.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/blacklists"}}),t.voiceRecording=e(t.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:t.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/downloads"}}),t.voiceMail=e(t.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/:id/messages"}}),t.voiceMailMessage=e(t.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.voiceCallReport=e(t.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDialReport=e(t.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceAgentReport=e(t.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueueReport=e(t.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/reports/index"}}),t.memberReport=e(t.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"members/reports/describe"},clone:{method:"post",url:t.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.trunk=e(t.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"trunks/describe"},clone:{method:"post",url:t.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceTransferReport=e(t.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailServerOut=e(t.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:t.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailAccount=e(t.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:t.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/users"}}),t.mailQueue=e(t.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/queues/describe"},clone:{method:"post",url:t.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/users"}}),t.mailSubstatus=e(t.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:t.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailInteraction=e(t.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:t.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.mailMessage=e(t.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/messages/describe"},clone:{method:"post",url:t.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:t.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.mailApplication=e(t.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/applications/describe"},clone:{method:"post",url:t.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailQueueReport=e(t.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.dashboard=e(t.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:t.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:t.baseUrl+"dashboards/:id/items"}}),t.dashboardItem=e(t.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxAccount=e(t.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:t.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/users"}}),t.faxApplication=e(t.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/applications/describe"},clone:{method:"post",url:t.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxInteraction=e(t.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:t.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.faxMessage=e(t.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/messages/describe"},clone:{method:"post",url:t.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:t.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.faxQueue=e(t.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/queues/describe"},clone:{method:"post",url:t.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/users"}}),t.faxQueueReport=e(t.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsAccount=e(t.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:t.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/users"}}),t.smsApplication=e(t.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/applications/describe"},clone:{method:"post",url:t.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsInteraction=e(t.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:t.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.smsMessage=e(t.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/messages/describe"},clone:{method:"post",url:t.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/messages/:id/status"}}),t.smsQueue=e(t.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/queues/describe"},clone:{method:"post",url:t.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/users"}}),t.openchannelAccount=e(t.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/send"}}),t.openchannelApplication=e(t.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelInteraction=e(t.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.openchannelMessage=e(t.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/reject"}}),t.openchannelQueue=e(t.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/users"}}),t.chatWebsite=e(t.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/websites/describe"},clone:{method:"post",url:t.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/users"}}),t.openchannelQueueReport=e(t.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatApplication=e(t.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/applications/describe"},clone:{method:"post",url:t.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInteraction=e(t.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:t.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},customUpdate:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.chatMessage=e(t.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/reject"}}),t.chatOfflineMessage=e(t.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueue=e(t.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/queues/describe"},clone:{method:"post",url:t.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/users"}}),t.chatGroup=e(t.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/groups/describe"},clone:{method:"post",url:t.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:t.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/messages"}}),t.chatProactiveAction=e(t.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:t.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCompany=e(t.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/companies/describe"},clone:{method:"post",url:t.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/companies/:id/contacts"}}),t.cmContact=e(t.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:t.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"cm/contacts/:id/tags"},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload/:id"}}),t.cmHopper=e(t.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper/preview"},getOpenContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/hopper/opencontacts"}}),t.cmHopperBlack=e(t.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmHopperFinal=e(t.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper_final/checkContactHopper"}}),t.cmHopperHistory=e(t.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCustomField=e(t.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:t.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.action=e(t.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"actions/describe"},clone:{method:"post",url:t.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.automation=e(t.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"automations/describe"},clone:{method:"post",url:t.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/actions"}}),t.cannedAnswer=e(t.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"canned_answers/describe"},clone:{method:"post",url:t.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),t.disposition=e(t.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dispositions/describe"},clone:{method:"post",url:t.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.condition=e(t.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"conditions/describe"},clone:{method:"post",url:t.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),t.interval=e(t.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"intervals/describe"},clone:{method:"post",url:t.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:t.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals/create_many"}}),t.pause=e(t.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"pauses/describe"},clone:{method:"post",url:t.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),t.cdr=e(t.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cdr/describe"},clone:{method:"post",url:t.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueuesLog=e(t.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:t.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),t.schedule=e(t.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"schedules/describe"},clone:{method:"post",url:t.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:t.baseUrl+"schedules/:id/run"}}),t.sound=e(t.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sounds/describe"},clone:{method:"post",url:t.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:t.baseUrl+"sounds/:id"}}),t.tag=e(t.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"tags/describe"},clone:{method:"post",url:t.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),t.template=e(t.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"templates/describe"},clone:{method:"post",url:t.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),t.trigger=e(t.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"triggers/describe"},clone:{method:"post",url:t.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/actions"}}),t.variable=e(t.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"variables/describe"},clone:{method:"post",url:t.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),t.integration=e(t.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.integrationReport=e(t.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:t.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticCustomReport=e(t.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/query"}}),t.analyticDefaultReport=e(t.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/query"}}),t.analyticExtractedReport=e(t.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.analyticMetric=e(t.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:t.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticFieldReport=e(t.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:t.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:t.baseUrl+"analytics/field_reports/:id/create_many"}}),t.analyticTreeReport=e(t.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSalesforceAccount=e(t.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),t.intSalesforceConfiguration=e(t.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),t.intSalesforceField=e(t.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSugarcrmAccount=e(t.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),t.intSugarcrmConfiguration=e(t.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),t.intSugarcrmField=e(t.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDeskAccount=e(t.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/fields"}}),t.intDeskConfiguration=e(t.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/tags"}}),t.intDeskField=e(t.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZohoAccount=e(t.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/fields"}}),t.intZohoConfiguration=e(t.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),t.intZohoField=e(t.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZendeskAccount=e(t.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),t.intZendeskConfiguration=e(t.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),t.intZendeskField=e(t.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intFreshdeskAccount=e(t.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),t.intFreshdeskConfiguration=e(t.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),t.intFreshdeskField=e(t.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intVtigerAccount=e(t.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),t.intVtigerConfiguration=e(t.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),t.intVtigerField=e(t.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intServicenowAccount=e(t.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),t.intServicenowConfiguration=e(t.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),t.intServicenowField=e(t.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDynamics365Account=e(t.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),t.intDynamics365Configuration=e(t.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),t.intDynamics365Field=e(t.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.network=e(t.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"networks/describe"},clone:{method:"post",url:t.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueueReport=e(t.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInternalMessage=e(t.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"chat/internal/messages/users"}}),t.jscriptyAnswerReport=e(t.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyQuestionReport=e(t.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptySessionReport=e(t.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/sessions/reports/:id/questions"}}),t.smsQueueReport=e(t.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReport=e(t.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReportDetail=e(t.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyProject=e(t.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.setting=e(t.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"settings/describe"},clone:{method:"post",url:t.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/preferred"}}),t.squareOdbc=e(t.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/odbc/describe"},clone:{method:"post",url:t.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:t.baseUrl+"square/odbc/:id/test"}}),t.squareProject=e(t.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/projects/describe"},clone:{method:"post",url:t.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}},addUsers:{isArray:!0,method:"post",url:t.baseUrl+"square/projects/:id/users"},removeUsers:{isArray:!1,method:"delete",url:t.baseUrl+"square/projects/:id/users"},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"square/projects/:id/users"}}),t.squareRecording=e(t.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/recordings/describe"},clone:{method:"post",url:t.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.squareMessage=e(t.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/messages/describe"},clone:{method:"post",url:t.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.team=e(t.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"teams/describe"},clone:{method:"post",url:t.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:t.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"teams/:id/users"}}),t.license=e(t.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"license/describe"},clone:{method:"post",url:t.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}}}),t.campaign=e(t.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"campaigns/describe"},clone:{method:"post",url:t.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/blacklists"}}),t.migration=e(t.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"migrations/describe"},clone:{method:"post",url:t.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.attachment=e(t.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"attachments/describe"},clone:{method:"post",url:t.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.plugin=e(t.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"plugins/describe"},clone:{method:"post",url:t.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:t.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:t.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:t.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:t.baseUrl+"plugins/webhook"}}),t.mailTransferReport=e(t.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatTransferReport=e(t.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxTransferReport=e(t.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelTransferReport=e(t.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsTransferReport=e(t.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmList=e(t.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/lists/describe"},clone:{method:"post",url:t.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:t.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/users"}}),t.voicePrefix=e(t.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:t.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/prefixes/:id/users"}}),t.userProfile=e(t.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfiles/describe"},clone:{method:"post",url:t.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:t.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:t.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:t.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:t.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:t.baseUrl+"userProfiles/:id/resources"}}),t.userProfileSection=e(t.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:t.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),t.userProfileResource=e(t.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:t.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),t}e.$inject=["$resource"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,t){t.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,t,n){this.themes=e.themes;var a=n.get("motion.language");a&&t.use(a)}e.$inject=["motionTheming","$translate","$cookies"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var t=new Date,n=new Date(e);return n.getDate()===t.getDate()&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?a("date")(n.getTime(),"shortTime"):n.getDate()===t.getDate()-1&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(n.getTime(),"shortTime"):a("date")(n.getTime(),"MMM d, y h:mm a")}}function t(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],t.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,t,n){var a,i={},s=0;for(a in e)if(n<=s&&(i[a]=e[a]),++s===n+t)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],t=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],n=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[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{getMonthName:function(){return e},getMonthNumber:function(){return t},getDaysOfWeek:function(){return n},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",t).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,t,n){var a;n.html5Mode(!0),t.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver",function(e){return e.resolve("setting@get",{id:1})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,t,n){var a=e.$on("$stateChangeStart",function(){e.loadingProgress=!0}),i=e.$on("$stateChangeSuccess",function(){t(function(){e.loadingProgress=!1})});e.state=n,e.$on("$destroy",function(){a(),i()})}e.$inject=["$rootScope","$timeout","$state"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i;function s(){i=io({query:"id="+e.getCurrentUser().id,transports:["websocket","polling"]})}return{connect:s,on:function(e,t){t=t||angular.noop,i||s(),i.on(e,function(){var e=arguments;a.$apply(function(){t.apply(i,e)})})},onWithoutApply:function(e,t){t=t||angular.noop,i||s(),i.on(e,function(){t.apply(i,arguments)})},emit:function(e,t,n){n=n||angular.noop,i||s(),i.emit(e,t,function(){var e=arguments;a.$apply(function(){n.apply(i,e)})})},removeAllListeners:function(e){i||s(),i.removeAllListeners(e)},removeListener:function(e,t){i||s(),i.removeListener(e,t)},disconnect:function(){i||s(),i.disconnect()}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(t,n,e,a,i,s){var o=this;o.progresslogin=!1,o.login=function(){return o.progresslogin=!0,o.message="",s.login(o.form).then(function(){return t.go("app.dashboards.general")}).catch(function(e){o.message=e.message}).finally(function(){o.progresslogin=!1})},o.loginOauth=function(e){o.message="",n.location.href="/api/auth/"+e},o.onInit=function(){{if(t.params.token&&t.params.userId)return s.removeCookies(),o.progresslogin=!0,e.put("motion.token",t.params.token),i.user.get({id:t.params.userId}).$promise.then(function(e){e&&(s.updateCurrentUser(e),t.go("app.dashboards.general"))}).finally(function(){o.progresslogin=!1});s.isLoggedIn()&&t.go("app.dashboards.general")}},o.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var t=_.find(g.extractedReports,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.extractedReports=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="extractedReports",b.listOrder="",b.listOrderAsc=null,b.selectedExtractedReports=[],b.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:b.extractedReports.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getExtractedReports=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.analyticExtractedReport.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ExtractedReports",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditExtractedReport=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:t,extractedReports:b.extractedReports.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteExtractedReport=S,b.exportSelectedExtractedReports=function(){var e=angular.copy(b.selectedExtractedReports);return b.selectedExtractedReports=[],e},b.deleteSelectedExtractedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+b.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedExtractedReports.forEach(function(e){S(e)}),b.selectedExtractedReports=[]})},b.deselectExtractedReports=function(){b.selectedExtractedReports=[]},b.selectAllExtractedReports=function(){b.selectedExtractedReports=b.extractedReports.rows};var E=!0,A=1;function y(e){b.extractedReports=e||{count:0,rows:[]}}function S(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(b.extractedReports.rows,{id:e.id}),b.extractedReports.count-=1,b.extractedReports.rows.length||b.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var t=_.find(g.metrics,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.metrics=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="metrics",b.listOrder="",b.listOrderAsc=null,b.selectedMetrics=[],b.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},b.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Integration Report",value:"'report_integration'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Queue Report",value:"'report_queue'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{metric:e,metrics:b.metrics.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMetrics=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.analyticMetric.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Metrics",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMetric=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:t,metrics:b.metrics.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMetric=S,b.exportSelectedMetrics=function(){var e=angular.copy(b.selectedMetrics);return b.selectedMetrics=[],e},b.deleteSelectedMetrics=function(e){var t=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+b.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMetrics.forEach(function(e){S(e)}),b.selectedMetrics=[]})},b.deselectMetrics=function(){b.selectedMetrics=[]},b.selectAllMetrics=function(){b.selectedMetrics=b.metrics.rows};var E=!0,A=1;function y(e){b.metrics=e||{count:0,rows:[]}}function S(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(b.metrics.rows,{id:e.id}),b.metrics.count-=1,b.metrics.rows.length||b.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o){var r=this;function l(){t.hide()}r.errors=[],r.report=angular.copy(n),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,t){r.currentNode=t.node}},r.copyReport=function(){var n;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){n=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(t).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:n.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;function m(){t.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),n.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var t=_.find(c.reports,{id:e.id});t&&_.merge(t,e),n.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=t.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),n.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(t,n,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){t[n]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,t){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1};for(var n=0;n<r.report.condition.group.rules.length;n++)if(r.report.condition.group.rules[n].field){var a=r.report.condition.group.rules[n].field.split(".");1===a.length&&(r.report.condition.group.rules[n].field=r.report.table+"."+r.report.condition.group.rules[n].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(t,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(t){var a={cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr"};return{getMap:function(){var n=[];return _.forIn(a,function(e,t){n.push({name:t,api:e})}),n},getColumns:function(e){return t[a[e]].describe().$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){n.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var t=_.find(u.reportFields,{id:e.id});t&&_.merge(t,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var t=n.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,t){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(t).ok("OK").cancel("CANCEL");a.show(n).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,t){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:t,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var t=_.find(c.metrics,{id:e});return t?t.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var t=_.find(c.metrics,{id:e});return t?t.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}t.$watch("vm_rf.query.filter",function(e,t){m?n(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports")},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),n.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){t.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,n.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],n.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",n.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})},o.mapArray=function(e,t){if(r(e))return _.map(e,t).join(",");return""},o.isArray=r,o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},o.closeDialog=function(){t.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,n,a,i,s,o,t,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,t){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,t){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,t){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,t){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(t).$promise}).then(function(e){for(var t=0;t<e.rows.length;t+=1)e.rows[t].MetricId&&(e.rows[t].field=i[e.rows[t].MetricId].metric,e.rows[t].custom=!0),delete e.rows[t].MetricId;var n=o.document.createElement("a");n.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),n.download=a.name+".json",n.target="_self",n.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,t){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:t,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,t,n){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var n=atob(e.target.result.split(",")[1]);n=angular.fromJson(n),d.analyticCustomReport.save({name:n.name,description:n.description,table:n.table,conditions:n.conditions,joins:n.joins,parent:p.currentNode.id}).$promise.then(function(t){p.reports.rows.unshift(t),m.success({title:"Report saved!",msg:t.name?t.name+" has been saved!":""});var e=_.map(n.fields,function(e){return _.extend({},e,{CustomReportId:t.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),h({count:n.length,rows:n})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function E(e,t){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=t.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=t.node.id,f()}function A(e,t){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=t.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=t.node.id,f()}function y(e,t){var n=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:n}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=n),m.success({title:"Node Updated",msg:t.node.text?t.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(n){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:t.instant("ANALYTICS.CREATE"),action:function(){n=p.treeCustomInstance.jstree(!0).create_node(n),p.treeCustomInstance.jstree(!0).edit(n)}},rename:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(n)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(n.text?n.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t=p.treeCustomInstance.jstree(!0).get_parent(n);t=p.treeCustomInstance.jstree(!0).get_node(t),p.treeCustomInstance.jstree(!0).delete_node(n),e=[n.id].concat(n.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(t)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:E}:{select_node:A}}e.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,t){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){n.hide()}l.errors=[],l.report=angular.copy(t),l.export={},l.runReport=function(t){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?n.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:t,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var t={fields:"field,alias",nolimit:!0};return t["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",t)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=n[s].run(o,l).$promise},r.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var t=_.find(g.odbcs,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.odbcs=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="odbcs",b.listOrder="",b.listOrderAsc=null,b.selectedODBC=[],b.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{odbc:e,odbcs:b.odbcs.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.testtestOdbc=function(e,t){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getODBC=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.squareOdbc.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ODBC",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOdbc=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:t,odbcs:b.odbcs.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOdbc=S,b.exportSelectedODBC=function(){var e=angular.copy(b.selectedODBC);return b.selectedODBC=[],e},b.deleteSelectedODBC=function(e){var t=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+b.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedODBC.forEach(function(e){S(e)}),b.selectedODBC=[]})},b.deselectODBC=function(){b.selectedODBC=[]},b.selectAllODBC=function(){b.selectedODBC=b.odbcs.rows};var E=!0,A=1;function y(e){b.odbcs=e||{count:0,rows:[]}}function S(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(b.odbcs.rows,{id:e.id}),b.odbcs.count-=1,b.odbcs.rows.length||b.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(t,n,a,i,s,e,o,r,l,d){var c=this;function m(e){t.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=e,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){return r.user.addSquareProjects({id:i.getCurrentUser().id,ids:[e.id]}).$promise,e}).then(function(e){c.projects.unshift(e),s.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?n.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var t=_.find(c.projects,{id:e.id});t&&_.merge(t,e),s.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=t.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){return r.squareProject.getUsers({id:c.project.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(r.user.removeSquareProjects({id:i.getCurrentUser().id,ids:[c.project.id]}).$promise);return $q.all(t)}).then(function(){_.remove(c.projects,{id:c.project.id}),s.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E,A,y,S,T,I,C,w,O,x,R){var N=this,D={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"]},P={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},L={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function k(e,t,n,a){return _.map(e,function(e){return{value:e[t],option:e[n],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function M(){var e=_.find(N.attributes,{name:"sip_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(l,{id:Number(e.value)}))return a.user.get({id:_.find(N.attributes,{name:"sip_id"}).value,fields:"id,fullname,role"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,l.push(t),N.values.sip_id=k(l,"id","fullname","role")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.sip_id=k(l,"id","fullname","role")}}function U(){var e=_.find(N.attributes,{name:"list_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(E,{id:Number(e.value)}))return a.cmList.get({id:_.find(N.attributes,{name:"list_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,E.push(t),N.values.list_id=k(E,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.list_id=k(E,"id","name")}}function F(n){var e=_.find(N.attributes,{name:n});if(!_.some(N.attributes,{id:e.value})){if(!_.some(d,{id:Number(e.value)}))return a.trunk.get({id:_.find(N.attributes,{name:n}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,d.push(t),N.values[n]=k(d,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values[n]=k(d,"id","name")}}function $(){var e=_.find(N.attributes,{name:"queue_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(c,{id:Number(e.value)}))return a.voiceQueue.get({id:_.find(N.attributes,{name:"queue_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,c.push(t),N.values.queue_id=k(c,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.queue_id=k(c,"id","name")}}function q(){var e=_.find(N.attributes,{name:"file_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(m,{id:Number(e.value)}))return a.sound.get({id:_.find(N.attributes,{name:"file_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,m.push(t),N.values.file_id=k(m,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.file_id=k(m,"id","name")}}function G(){var e=_.find(N.attributes,{name:"variable_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(u,{id:Number(e.value)}))return a.variable.get({id:_.find(N.attributes,{name:"variable_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,u.push(t),N.values.variable_id=k(u,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.variable_id=k(u,"id","name")}}function H(){var e=_.find(N.attributes,{name:"odbc_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(p,{id:Number(e.value)}))return a.squareOdbc.get({id:_.find(N.attributes,{name:"odbc_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,p.push(t),N.values.odbc_id=k(p,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.odbc_id=k(p,"id","name")}}function V(){var e=_.find(N.attributes,{name:"project_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(g,{id:Number(e.value)}))return a.squareProject.get({id:_.find(N.attributes,{name:"project_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,g.push(t),N.values.project_id=k(g,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.project_id=k(g,"id","name")}}function Q(){var e=_.find(N.attributes,{name:"context"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(v,{id:Number(e.value)}))return a.voiceContext.get({id:_.find(N.attributes,{name:"context"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,v.push(t),N.values.context=k(v,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.context=k(v,"id","name")}}function B(){var e=_.find(N.attributes,{name:"interval_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(h,{id:Number(e.value)}))return a.interval.get({id:_.find(N.attributes,{name:"interval_id"}).value,fields:"id,name,IntervalId"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,h.push(t),N.values.interval_id=k(h,"id","name","IntervalId")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.interval_id=k(h,"id","name","IntervalId")}}function W(){var e=_.find(N.attributes,{name:"account_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(f,{id:Number(e.value)}))return a.mailAccount.get({id:_.find(N.attributes,{name:"account_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,f.push(t),N.values.account_id=k(f,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.account_id=k(f,"id","name")}}function Y(){var e=_.find(N.attributes,{name:"sms_account_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(I,{id:Number(e.value)}))return a.smsAccount.get({id:_.find(N.attributes,{name:"sms_account_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,I.push(t),N.values.sms_account_id=k(I,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.sms_account_id=k(I,"id","name")}}function j(){var e=_.find(N.attributes,{name:"template_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(b,{id:Number(e.value)}))return a.template.get({id:_.find(N.attributes,{name:"template_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,b.push(t),N.values.template_id=k(b,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.template_id=k(b,"id","name")}}function z(){var e=_.find(N.attributes,{name:"pause_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(C,{id:Number(e.value)}))return a.pause.get({id:_.find(N.attributes,{name:"pause_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,C.push(t),N.values.pause_id=k(C,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.pause_id=k(C,"id","name")}}N.cellName=A.tagName,N.attributes=_.map(A.attributes,function(e){return{name:e.name,value:e.value,defaultValue:P[N.cellName]&&_.includes(P[N.cellName],e.name),required:D[N.cellName]&&_.includes(D[N.cellName],e.name),help:L[N.cellName]&&_.includes(L[N.cellName],e.name)}}),N.values={answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:n,ispeech_tts_language:o,google_tts_language:r,google_asr_language:s,aws_polly_region:T,aws_polly_voice:S,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,aws_lex_region:O},N.crudPermissions=R,N.onInit=function(){x.hasRole("admin")?(e={sip_id:k(l,"id","fullname","role"),trunk_name:k(d,"name","name"),trunk_id:k(d,"id","name"),queue_id:k(c,"id","name"),file_id:k(m,"id","name"),variable_id:k(u,"id","name"),odbc_id:k(p,"id","name"),project_id:k(g,"id","name"),context:k(v,"id","name"),interval_id:(n=h,a="id",i="name",s="IntervalId",o=_.filter(n,function(e){return null===e[s]}),r=[],_.forEach(o,function(t){r.push({value:t[a],option:t[i]});var e=_.filter(n,function(e){return e[s]===t.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:k(f,"id","name"),template_id:k(b,"id","name"),list_id:k(E,"id","name"),sms_account_id:k(I,"id","name"),pause_id:k(C,"id","name")},t=_.merge(N.values,e),N.values=t):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],t=0;t<N.attributes.length;t++)if(_.includes(e,N.attributes[t].name))switch(N.attributes[t].name){case"sip_id":M();break;case"trunk_name":case"trunk_id":F(N.attributes[t].name);break;case"queue_id":$();break;case"file_id":q();break;case"variable_id":G();break;case"odbc_id":H();break;case"project_id":V();break;case"context":Q();break;case"interval_id":B();break;case"account_id":W();break;case"template_id":j();break;case"list_id":U();break;case"sms_account_id":Y();break;case"pause_id":z()}}();var e,t,n,a,i,s,o,r},N.closeDialog=function(e){e&&y(N.attributes),t.hide()},N.getMap=k}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,t,n,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"am-ET",option:"Amharic (Ethiopia)"},{value:"hy-AM",option:"Armenian (Armenia)"},{value:"az-AZ",option:"Azerbaijani (Azerbaijan)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"bn-BD",option:"Bengali (Bangladesh)"},{value:"bn-IN",option:"Bengali (India)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"de-DE",option:"German (Germany)"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GH",option:"English (Ghana)"},{value:"en-GB",option:"English (United Kingdom)"},{value:"en-IN",option:"English (India)"},{value:"en-IE",option:"English (Ireland)"},{value:"en-KE",option:"English (Kenya)"},{value:"en-NZ",option:"English (New Zealand)"},{value:"en-NG",option:"English (Nigeria)"},{value:"en-PH",option:"English (Philippines)"},{value:"en-ZA",option:"English (South Africa)"},{value:"en-TZ",option:"English (Tanzania)"},{value:"en-US",option:"English (United States)"},{value:"es-AR",option:"Spanish (Argentina)"},{value:"es-BO",option:"Spanish (Bolivia)"},{value:"es-CL",option:"Spanish (Chile)"},{value:"es-CO",option:"Spanish (Colombia)"},{value:"es-CR",option:"Spanish (Costa Rica)"},{value:"es-EC",option:"Spanish (Ecuador)"},{value:"es-SV",option:"Spanish (El Salvador)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (United States)"},{value:"es-GT",option:"Spanish (Guatemala)"},{value:"es-HN",option:"Spanish (Honduras)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"es-NI",option:"Spanish (Nicaragua)"},{value:"es-PA",option:"Spanish (Panama)"},{value:"es-PY",option:"Spanish (Paraguay)"},{value:"es-PE",option:"Spanish (Peru)"},{value:"es-PR",option:"Spanish (Puerto Rico)"},{value:"es-DO",option:"Spanish (Dominican Republic)"},{value:"es-UY",option:"Spanish (Uruguay)"},{value:"es-VE",option:"Spanish (Venezuela)"},{value:"eu-ES",option:"Basque (Spain)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"gl-ES",option:"Galician (Spain)"},{value:"ka-GE",option:"Georgian (Georgia)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hr-HR",option:"Croatian (Croatia)"},{value:"zu-ZA",option:"Zulu (South Africa)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"it-IT",option:"Italian (Italy)"},{value:"jv-ID",option:"Javanese (Indonesia)"},{value:"kn-IN",option:"Kannada (India)"},{value:"km-KH",option:"Khmer (Cambodia)"},{value:"lo-LA",option:"Lao (Laos)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"lt-LT",option:"Lithuanian (Lithuania)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"mr-IN",option:"Marathi (India)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"ne-NP",option:"Nepali (Nepal)"},{value:"nb-NO",option:"Norwegian Bokmal (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"si-LK",option:"Sinhala (Srilanka)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"sl-SI",option:"Slovenian (Slovenia)"},{value:"su-ID",option:"Sundanese (Indonesia)"},{value:"sw-TZ",option:"Swahili (Tanzania)"},{value:"sw-KE",option:"Swahili (Kenya)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"ta-SG",option:"Tamil (Singapore)"},{value:"ta-LK",option:"Tamil (Sri Lanka)"},{value:"ta-MY",option:"Tamil (Malaysia)"},{value:"te-IN",option:"Telugu (India)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"ur-PK",option:"Urdu (Pakistan)"},{value:"ur-IN",option:"Urdu (India)"},{value:"el-GR",option:"Greek (Greece)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Serbia)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"he-IL",option:"Hebrew (Israel)"},{value:"ar-IL",option:"Arabic (Israel)"},{value:"ar-JO",option:"Arabic (Jordan)"},{value:"ar-AE",option:"Arabic (United Arab Emirates)"},{value:"ar-BH",option:"Arabic (Bahrain)"},{value:"ar-DZ",option:"Arabic (Algeria)"},{value:"ar-SA",option:"Arabic (Saudi Arabia)"},{value:"ar-IQ",option:"Arabic (Iraq)"},{value:"ar-KW",option:"Arabic (Kuwait)"},{value:"ar-MA",option:"Arabic (Morocco)"},{value:"ar-TN",option:"Arabic (Tunisia)"},{value:"ar-OM",option:"Arabic (Oman)"},{value:"ar-PS",option:"Arabic (State of Palestine)"},{value:"ar-QA",option:"Arabic (Qatar)"},{value:"ar-LB",option:"Arabic (Lebanon)"},{value:"ar-EG",option:"Arabic (Egypt)"},{value:"fa-IR",option:"Persian (Iran)"},{value:"hi-IN",option:"Hindi (India)"},{value:"th-TH",option:"Thai (Thailand)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"cmn-Hant-TW",option:"Chinese, Mandarin (Traditional, Taiwan)"},{value:"yue-Hant-HK",option:"Chinese, Cantonese (Traditional, Hong Kong)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"cmn-Hans-HK",option:"Chinese, Mandarin (Simplified, Hong Kong)"},{value:"cmn-Hans-CN",option:"Chinese, Mandarin (Simplified, China)"}]}).factory("awsPollyVoice",function(){return[{value:"Amy",option:"Amy (English, British, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Conchita",option:"Conchita (Spanish, Castilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Enrique",option:"Enrique (Spanish, Castilian, Male)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Gwineth",option:"Gwineth (Welsh, Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Nicole",option:"Nicole (English, Austrialian, Female)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]})}(),function(){"use strict";function e(t,e,n,a){var i=this;i.project={preproduction:n},i.closeDialog=function(e){e?(a(i.project.preproduction),t.hide(i.project.preproduction)):t.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(t,n){var a=this;function i(e){e?(n(e),t.hide(e)):t.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var t=new FileReader;t.onload=function(e){i(e.target.result)},t.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(t,n,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){t.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){n.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),t.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(t,e,n,a,i){var s=this;s.projects=n,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(t.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):t.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){return a.squareProject.getUsers({id:r.project.id,fields:"id,name,fullname,internal",nolimit:!0,role:"user"}).$promise.then(function(e){return r.selectedItems=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.selectedItems=r.selectedItems,a.user.get({fields:"id,fullname,name,internal",role:"user",nolimit:!0}).$promise}).then(function(e){r.items=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.items=_.differenceBy(r.items,r.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}r.project=t,r.penalty=0,r.items=[],r.selectedItems=[],r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={readOnly:!1,items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CALLYSQUARE.ALL_USERS"),labelSelected:s.instant("CALLYSQUARE.SELECTED_USERS"),transferCallback:function(e,t){a.squareProject[t?"removeUsers":"addUsers"]({id:r.project.id,ids:_.map(e,"id"),penalty:r.penalty||0}).$promise.then(function(){n.success({title:"Project properly "+(t?"removed":"added"),msg:"Project has been "+(t?"removed":"added")+"!"}),t||l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:squareProjects.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},l()}e.$inject=["$mdDialog","toasty","api","project","projects","$translate","Auth"],angular.module("app.callysquare").controller("ProjectspermissionaddController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){t.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){n.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),t.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,n,a,i,s,o,r,t,l,d,c,m,u,p,g,v,h,f,b,E,A,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=t||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,t){var n={preproduction:e};t&&(n.production=e);r.squareProject.update({id:I.project.id},n).$promise.then(function(e){o.success({title:"Project "+(t?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(t?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,t){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:A.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:E.rows||[],cell:e,saveCallback:t,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(t){return i(function(a,t){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var t=e.rows?e.rows[0]:null,n=T.parseCrudPermissions(t?t.crudPermissions:null);a(n)}).catch(function(e){t(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{variable:t,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,t){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:t}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects")}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.table="projects",p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,t){n.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,t){var n=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");l.show(n).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="Projects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,t){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var t=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(t).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){g?c(function(){g=!1}):(t||(v=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var t=_.find(g.squareRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.squareRecordings=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="squareRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedSquareRecordings=[],b.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,page:1},b.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.uniqueid+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSquareRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.squareRecording.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SquareRecordings",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSquareRecording=function(e,t){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:t,squareRecordings:b.squareRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSquareRecording=S,b.exportSelectedSquareRecordings=function(){var e=angular.copy(b.selectedSquareRecordings);return b.selectedSquareRecordings=[],e},b.deleteSelectedSquareRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+b.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSquareRecordings.forEach(function(e){S(e)}),b.selectedSquareRecordings=[]})},b.deselectSquareRecordings=function(){b.selectedSquareRecordings=[]},b.selectAllSquareRecordings=function(){b.selectedSquareRecordings=b.squareRecordings.rows};var E=!0,A=1;function y(e){b.squareRecordings=e||{count:0,rows:[]}}function S(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.squareRecordings.rows,{id:e.id}),b.squareRecordings.count-=1,b.squareRecordings.rows.length||b.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chatQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chatQueues",b.listOrder="",b.listOrderAsc=null,b.selectedChatQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:b.chatQueues?b.chatQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:b.chatQueues?b.chatQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.chat.realtime.queues",{})}},b.success=y,b.getChatQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.chatQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChatQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditChatQueue=function(e,t){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:b.chatQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteChatQueue=S,b.exportSelectedChatQueues=function(){var e=angular.copy(b.selectedChatQueues);return b.selectedChatQueues=[],e},b.deleteSelectedChatQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+b.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChatQueues.forEach(function(e){S(e)}),b.selectedChatQueues=[]})},b.deselectChatQueues=function(){b.selectedChatQueues=[]},b.selectAllChatQueues=function(){b.selectedChatQueues=b.chatQueues.rows};var E=!0,A=1;function y(e){b.chatQueues=e||{count:0,rows:[]}}function S(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.chatQueues.rows,{id:e.id}),b.chatQueues.count-=1,b.chatQueues.rows.length||b.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATQUEUE",g.chatQueue=angular.copy(l),g.chatQueues=r,g.newChatQueue=!1,g.chatQueue||(g.chatQueue={strategy:"beepall",timeout:10},g.title="CHAT.NEW_CHATQUEUE",g.newChatQueue=!0),g.addNewChatQueue=function(){g.errors=[],d.chatQueue.save(g.chatQueue).$promise.then(function(e){g.chatQueues.unshift(e.toJSON()),o.success({title:"ChatQueue properly created",msg:g.chatQueue.name?g.chatQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatQueue=function(){g.errors=[],d.chatQueue.update({id:g.chatQueue.id},g.chatQueue).$promise.then(function(e){var t=_.find(g.chatQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatQueue properly saved!",msg:g.chatQueue.name?g.chatQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatQueue.delete({id:g.chatQueue.id}).$promise.then(function(){_.remove(g.chatQueues,{id:g.chatQueue.id}),o.success({title:"ChatQueue properly deleted!",msg:(g.chatQueue.name||"chatQueue")+" has been deleted!"}),v(g.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatQueues","chatQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("CHAT.ALL_TEAMS"),labelSelected:n.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues")},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chatWebsites=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chatWebsites",b.listOrder="",b.listOrderAsc=null,b.selectedChatWebsites=[],b.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:9})},b.offlinemessagesgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},b.agentadddialog=function(e,t){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:b.chatWebsites?b.chatWebsites.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getChatWebsites=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.chatWebsite.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChatWebsites",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditChatWebsite=function(e,t){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:t,chatWebsites:b.chatWebsites.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteChatWebsite=S,b.exportSelectedChatWebsites=function(){var e=angular.copy(b.selectedChatWebsites);return b.selectedChatWebsites=[],e},b.deleteSelectedChatWebsites=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+b.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChatWebsites.forEach(function(e){S(e)}),b.selectedChatWebsites=[]})},b.deselectChatWebsites=function(){b.selectedChatWebsites=[]},b.selectAllChatWebsites=function(){b.selectedChatWebsites=b.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.chatWebsite&&(n=_.find(b.lists,{id:Number(b.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.chatWebsite&&(a=_.find(b.lists,{id:Number(b.chatWebsite.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.chatWebsite&&(n=_.find(b.interval,{id:Number(b.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.chatWebsite&&(a=_.find(b.interval,{id:Number(b.chatWebsite.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.chatWebsites=e||{count:0,rows:[]}}function S(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(b.chatWebsites.rows,{id:e.id}),b.chatWebsites.count-=1,b.chatWebsites.rows.length||b.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),t.params.id&&(g.chatWebsite.ChatWebsiteId=t.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var t=_.find(g.chatWebsites,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.chatWebsite&&(n=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.chatWebsite&&(n=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:n,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[t]=e:r.chatWebsiteApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.chatWebsiteApps.rows.length;n++,0){var a=r.chatWebsiteApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(t,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.chatWebsite=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,n).$promise},r.editChatWebsiteApp=t,r.editInterval=function(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){t.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){t.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("chat")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatCannedAnswers={count:0,rows:[]},c.selectedChatWebsiteChatCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getAnswers(c.query,p).$promise},c.createOrEditChatWebsiteChatCannedAnswer=function(e,t){s.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatCannedAnswer:t,chatCannedAnswers:c.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(c.selectedChatWebsiteChatCannedAnswers);return c.selectedChatWebsiteChatCannedAnswers=[],e},c.deleteChatWebsiteChatCannedAnswer=g,c.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+c.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),c.selectedChatWebsiteChatCannedAnswers=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatCannedAnswers.rows,{id:e.id}),c.chatWebsiteChatCannedAnswers.count-=1,c.chatWebsiteChatCannedAnswers.rows.length||c.getChatWebsiteChatCannedAnswers(),r.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),t.params.id&&(g.chatCannedAnswer.ChatWebsiteId=t.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var t=_.find(g.chatCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatDispositions={count:0,rows:[]},c.selectedChatWebsiteChatDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatDisposition?").htmlContent("<b>"+(e.name||"chatDisposition")+"</b> will be deleted.").ariaLabel("delete chatDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getDispositions(c.query,p).$promise},c.createOrEditChatWebsiteChatDisposition=function(e,t){s.show({controller:"CreateOrEditChatDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatDisposition:t,chatDispositions:c.chatWebsiteChatDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteChatDispositions=function(){var e=angular.copy(c.selectedChatWebsiteChatDispositions);return c.selectedChatWebsiteChatDispositions=[],e},c.deleteChatWebsiteChatDisposition=g,c.deleteSelectedChatWebsiteChatDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected chatDispositions?").htmlContent("<b>"+c.selectedChatWebsiteChatDispositions.length+" selected</b> will be deleted.").ariaLabel("delete chatDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteChatDispositions.forEach(function(e){g(e)}),c.selectedChatWebsiteChatDispositions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatDispositions.rows,{id:e.id}),c.chatWebsiteChatDispositions.count-=1,c.chatWebsiteChatDispositions.rows.length||c.getChatWebsiteChatDispositions(),r.success({title:"ChatDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATDISPOSITION",g.chatDisposition=angular.copy(l),g.chatDispositions=r,g.newChatDisposition=!1,g.chatDisposition||(g.chatDisposition={},g.title="CHAT.NEW_CHATDISPOSITION",g.newChatDisposition=!0),t.params.id&&(g.chatDisposition.ChatWebsiteId=t.params.id),g.addNewChatDisposition=function(){g.errors=[],d.disposition.save(g.chatDisposition).$promise.then(function(e){g.chatDispositions.unshift(e.toJSON()),o.success({title:"ChatDisposition properly created",msg:g.chatDisposition.name?g.chatDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatDisposition=function(){g.errors=[],d.disposition.update({id:g.chatDisposition.id},g.chatDisposition).$promise.then(function(e){var t=_.find(g.chatDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatDisposition properly saved!",msg:g.chatDisposition.name?g.chatDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatDisposition will be deleted.").ariaLabel("Delete ChatDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.chatDisposition.id}).$promise.then(function(){_.remove(g.chatDispositions,{id:g.chatDisposition.id}),o.success({title:"ChatDisposition properly deleted!",msg:(g.chatDisposition.name||"chatDisposition")+" has been deleted!"}),v(g.chatDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatDispositions","chatDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.offlineForm.items[t-1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===t-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.offlineForm.items.length-1){var n=i.chatWebsite.offlineForm.items[t+1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===t+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.onlineForm.items[t-1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===t-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.onlineForm.items.length-1){var n=i.chatWebsite.onlineForm.items[t+1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===t+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteInteractions={count:0,rows:[]},c.selectedChatWebsiteInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,UserId,ContactId,ChatWebsiteId,id,closedAt,Contact.firstName,Owner.name,disposition,ratingValue,ratingType,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.getChatWebsiteInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.chatInteractionDownload=function(s,e,t){return l.chatInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getChatWebsiteInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getInteractions(c.query,p).$promise},c.createOrEditChatWebsiteInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,interaction:t,interactions:c.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spychatInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"chat",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(c.selectedChatWebsiteInteractions);return c.selectedChatWebsiteInteractions=[],e},c.deleteChatWebsiteInteraction=g,c.deleteSelectedChatWebsiteInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteInteractions.forEach(function(e){g(e)}),c.selectedChatWebsiteInteractions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteInteractions=e||{count:0,rows:[]}}function g(e){l.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteInteractions.rows,{id:e.id}),c.chatWebsiteInteractions.count-=1,c.chatWebsiteInteractions.rows.length||c.getChatWebsiteInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteOfflineMessages={count:0,rows:[]},c.selectedChatWebsiteOfflineMessages=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId",sort:"-createdAt",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.getChatWebsiteOfflineMessages()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteOfflineMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getOfflineMessages(c.query,p).$promise},c.createOrEditChatWebsiteOfflineMessage=function(e,t){s.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,offlineMessage:t,offlineMessages:c.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.showOfflineMessageChatWebsiteOfflineMessage=function(e,n){s.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,t){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:n.id})}]}})},c.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(c.selectedChatWebsiteOfflineMessages);return c.selectedChatWebsiteOfflineMessages=[],e},c.deleteChatWebsiteOfflineMessage=g,c.deleteSelectedChatWebsiteOfflineMessages=function(e){var t=s.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+c.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),c.selectedChatWebsiteOfflineMessages=[]})},l.cmContact.get({fields:"id,firstName,lastName",nolimit:"true"}).$promise.then(function(e){c.contacts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTACTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function g(e){l.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteOfflineMessages.rows,{id:e.id}),c.chatWebsiteOfflineMessages.count-=1,c.chatWebsiteOfflineMessages.rows.length||c.getChatWebsiteOfflineMessages(),r.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteOfflineMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(t,e){this.title="CHAT.OFFLINE_MESSAGE",this.message=e,this.closeDialog=function(e){t.hide(e)}}e.$inject=["$mdDialog","message"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteProactiveActions={count:0,rows:[]},c.selectedChatWebsiteProactiveActions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},c.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteProactiveActions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteProactiveActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getProactiveActions(c.query,p).$promise},c.createOrEditChatWebsiteChatProactiveAction=function(e,t){s.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatProactiveAction:t,proactive:c.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(c.selectedChatWebsiteProactiveActions);return c.selectedChatWebsiteProactiveActions=[],e},c.deleteChatWebsiteChatProactiveAction=g,c.deleteSelectedChatWebsiteProactiveActions=function(e){var t=s.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+c.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),c.selectedChatWebsiteProactiveActions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function g(e){l.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteProactiveActions.rows,{id:e.id}),c.chatWebsiteProactiveActions.count-=1,c.chatWebsiteProactiveActions.rows.length||c.getChatWebsiteProactiveActions(),r.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteProactiveActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),t.params.id&&(g.chatProactiveAction.ChatWebsiteId=t.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var t=_.find(g.proactive,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var t=this;t.chatWebsite={},t.init=function(e){t.chatWebsite=e,t.start="\n\x3c!-- START Motion Chat Script --\x3e",t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>',t.end="\n\x3c!-- START Motion Chat Script --\x3e"},t.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.chatWebsite=c||e.params.chatWebsite||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:u.chatWebsites?u.chatWebsites.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatWebsites=function(){e.go("app.chat.chatWebsites")},u.saveChatWebsite=function(){r.chatWebsite.update({id:u.chatWebsite.id},u.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:u.chatWebsite.name?u.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.chatWebsite&&(n=_.find(u.lists,{id:Number(u.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.chatWebsite&&(a=_.find(u.lists,{id:Number(u.chatWebsite.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.chatWebsite&&(n=_.find(u.interval,{id:Number(u.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.chatWebsite&&(a=_.find(u.interval,{id:Number(u.chatWebsite.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"chat",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.chatQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].ChatQueueId].paused++,g.queues[e[t].rows[n].ChatQueueId].loggedInDb++,g.queues[e[t].rows[n].ChatQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].ChatQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.chatQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="ChatQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditChatQueue=function(e,t){a.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.chatQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.ChatQueueId]&&g.queues[e.ChatQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.ChatQueueId]&&g.queues[e.ChatQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.ChatQueueId]&&(g.queues[e.ChatQueueId].loggedInDb+=1,g.queues[e.ChatQueueId].agents[e.UserId]=e.ChatQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.ChatQueueId]&&0<g.queues[e.ChatQueueId].loggedInDb&&(g.queues[e.ChatQueueId].loggedInDb-=1,delete g.queues[e.ChatQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("chat_queue:save",g.onSave),d.on("userChatQueue:save",g.onSaveMember),d.on("userChatQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("chat_queue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.chat.realtime.agents");break;case 1:n.go("app.chat.realtime.queues");break;default:n.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.companies=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="companies",b.listOrder="",b.listOrderAsc=null,b.selectedCompanies=[],b.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:b.crudPermissions})},b.gotocontactsgoto=function(n,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{CompanyId:n.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:n.id})}},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCompanies=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmCompany.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Companies",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:t,companies:b.companies.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCompany=S,b.exportSelectedCompanies=function(){var e=angular.copy(b.selectedCompanies);return b.selectedCompanies=[],e},b.deleteSelectedCompanies=function(e){var t=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+b.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCompanies.forEach(function(e){S(e)}),b.selectedCompanies=[]})},b.deselectCompanies=function(){b.selectedCompanies=[]},b.selectAllCompanies=function(){b.selectedCompanies=b.companies.rows};var E=!0,A=1;function y(e){b.companies=e||{count:0,rows:[]}}function S(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(b.companies.rows,{id:e.id}),b.companies.count-=1,b.companies.rows.length||b.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var t=_.find(g.companies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(n,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{CompanyId:n.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:n.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies")},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(t,i,n,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var E=this;E.currentUser=f.getCurrentUser(),E.license=b,E.userProfile=r,E.userProfileSection=l&&1==l.count?l.rows[0]:null,E.crudPermissions=f.parseCrudPermissions(E.userProfileSection?E.userProfileSection.crudPermissions:null);var A=60,y=1024*A*1024;E.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},E.contacts=c||{count:0,rows:[]},E.options={hidden:!1,hover:!1,isOpen:!1},E.table="cm_contacts",E.selectedContacts=[],E.lists=m||{rows:[],count:0},E.companies=p||{rows:[],count:0},E.tags=v||{rows:[],count:0},E.listsMap=u,E.companiesMap=g,E.selectedTags=[],E.selectedList=null,E.selectedCompany=null,E.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),E.editdialog=function(e,t){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:E.crudPermissions})},E.deleteconfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){C(e)})},E.success=I,E.getContacts=function(){E.query.offset=(E.query.page-1)*E.query.limit,f.hasRole("admin")?E.promise=d.cmContact.get(E.query,I).$promise:(E.query.id=E.userProfile.id,E.query.section="Contacts",E.promise=d.userProfile.getResources(E.query,I).$promise)},E.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(E.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").pullAllBy(E.companies.rows,"id").value();if(!_.isEmpty(e)){for(var t=[],n=0;n<e.length;n++)t.push(d.cmCompany.get({id:e[n].id,fields:"id,name"}).$promise);o.all(t).then(function(e){e.forEach(function(e){var t=e.toJSON();t.canSelect=!1,E.companies.rows.push(t);var n={};n[t.id]=t.name,E.companiesMap=_.assignIn(E.companiesMap,n)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},E.mergeContact=function(e,t){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:E.contacts.rows}})},E.duplicateContact=function(e,t){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:E.contacts.rows}})},E.createOrEditContact=function(e,t){t&&t.dateOfBirth&&(t.dateOfBirth=new Date(t.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:E.query.ListId||a.params.ListId,CompanyId:E.query.CompanyId||a.params.CompanyId,contact:t,contacts:E.contacts.rows,setting:null,crudPermissions:E.crudPermissions},resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"id,name"})}]}})},E.deleteContact=C,E.exportSelectedContacts=function(){var e=angular.copy(E.selectedContacts);return E.selectedContacts=[],e},E.deleteSelectedContacts=function(e){var t=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+E.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){E.selectedContacts.forEach(function(e){C(e)}),E.selectedContacts=[]})},E.deselectContacts=function(){E.selectedContacts=[]},E.selectAllContacts=function(){E.selectedContacts=E.contacts.rows},E.createTag=function(e){var t=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(E.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},E.createList=function(e){var t=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(E.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},E.createCompany=function(e){var t=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(E.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},E.importContacts=function(e,t,n){var a=JSON.parse(t);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:E.license}}).then(function(){E.getContacts()}).catch(function(e){console.error()})},E.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},E.fileAdded=function(e){var t=["csv"];if(!_.includes(t,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+A+"MB"}),!1;return!0},a.params.ListId&&(E.selectedList=a.params.ListId),a.params.CompanyId&&(E.selectedCompany=a.params.CompanyId),t.$watch("vm.options.isOpen",function(e){e?n(function(){t.tooltipVisible=E.options.isOpen},600):t.tooltipVisible=E.options.isOpen});var S=!0,T=1;function I(e){E.contacts=e||{count:0,rows:[]}}function C(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(E.contacts.rows,{id:e.id}),E.contacts.count-=1,E.contacts.rows.length||E.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){E.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var t=0;t<e.data.errors.length;t++)h.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm.query.filter",function(e,t){S?n(function(){S=!1}):(t||(T=E.query.page),e!==t&&(E.query.page=1),e||(E.query.page=T),E.getContacts())},!0),t.$watch("vm.selectedList",function(e,t){e!==t&&(E.query.ListId=E.selectedList||void 0,E.getContacts())}),t.$watch("vm.selectedCompany",function(e,t){e!==t&&(E.query.CompanyId=E.selectedCompany||void 0,E.getContacts())}),t.$watch("vm.selectedTags",function(e,t){(e.length||t.length)&&E.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.title="CONTACTMANAGER.EDIT_CONTACT",c.crudPermissions=d,c.contact=angular.copy(s),c.contacts=e||{rows:[],count:0},c.lists=t||{rows:[],count:0},c.companies=i||{rows:[],count:0},c.customFields={rows:[],count:0},c.newContact=!1,c.contact?(delete c.contact.List,c.ListId=c.contact.ListId||void 0):(c.contact={ListId:o?parseInt(o,10):void 0,CompanyId:r?parseInt(r,10):void 0},c.title="CONTACTMANAGER.NEW_CONTACT",c.newContact=!0),c.addNewContact=function(){c.errors=[],l.cmContact.save(c.contact).$promise.then(function(e){c.contacts.unshift(e),a.success({title:"Contact properly created",msg:c.contact.name?c.contact.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveContact=function(){c.errors=[],l.cmContact.update({id:c.contact.id},c.contact).$promise.then(function(e){var t=_.find(c.contacts,{id:e.id});t&&_.merge(t,e),a.success({title:"Contact properly saved!",msg:c.contact.name?c.contact.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteContact=function(e){c.errors=[];var t=n.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){l.cmContact.delete({id:c.contact.id}).$promise.then(function(){_.remove(c.contacts,{id:c.contact.id}),a.success({title:"Contact properly deleted!",msg:c.contact.name?c.contact.name+" has been deleted!":""}),m()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},c.closeDialog=m,c.getCustomFields=function(e){{if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){e&&(c.customFields=e)}).catch(function(e){console.error(e)});c.customFields={rows:[],count:0}}},c.getDateFromString=function(e){return null===e?void 0:new Date(e)}}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(n),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[],delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){a.unshift(e),t.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var t=_.find(d.hoppers,{id:e.id});t&&_.merge(t,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E){var A=this;A.currentUser=b.getCurrentUser(),A.license=f,A.journey=[],A.contact=r||{},A.hoppers=l||{rows:[],count:0},A.finals=d||{rows:[],count:0},A.histories=c||{rows:[],count:0},A.companies=u||{rows:[],count:0},A.lists=p||{rows:[],count:0},A.customFields=g||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.jscriptySessions=h||{rows:[],count:0},A.timelineOptions={scrollEl:"#interaction-content"},A.userProfileSection=E&&1==E.count?E.rows[0]:null,A.crudPermissions=b.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null),A.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),A.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},A.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},A.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},A.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},A.selectedTab=t.params.tab||0,A.onInit=function(){b.hasRole("admin")||(function(){if(!_.some(A.companies.rows,{id:A.contact.CompanyId}))o.cmCompany.get({id:A.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,A.companies.rows.push(t)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(A.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var t=0;t<e.length;t++)_.some(A.tags.rows,{id:e.id})||(e[t].canSelect=!1,A.tags.rows.push(e[t]))}());return o.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){A.users=e||{count:0,rows:[]},A.usersMap=_.mapValues(_.keyBy(A.users.rows,"id"),"fullname"),A.Tags=_.map(A.contact.Tags,"id")}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)o[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(I);o.voiceCallReport.get({fields:"id,uniqueid,type,source,destination,callerid,starttime,endtime,duration,disposition,amaflags,note,UserId,ContactId",ContactId:e.id,includeAll:!0}).$promise.then(I).catch(function(e){console.error(e)})}}(r))},A.gotoContacts=function(){t.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},A.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:A.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:m.rows,contact:r}})},A.saveContact=function(){o.cmContact.update({id:A.contact.id},A.contact).$promise.then(function(){s.success({title:"Contact updated!",msg:A.contact.name?A.contact.name+" has been updated!":""})}).then(function(){return o.cmContact.setTags({id:A.contact.id,ids:A.Tags}).$promise}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},A.editCompany=function(e,t){var n=_.find(A.companies.rows,{id:t});i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===n.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:o.userProfileSection.get({userProfileId:A.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var t=e.rows?e.rows[0]:null;return b.parseCrudPermissions(t?t.crudPermissions:null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:t})}]}})},A.onSelectList=function(e){if(A.contact.ListId){var t=i.confirm().title("You are selecting the list number: "+A.contact.ListId).textContent("Warning! You won't select a different list for the contact "+A.contact.firstName||A.contact.lastName||A.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(t).then(A.onSelectListSuccess).catch(function(){A.contact.ListId=null})}},A.onSelectListSuccess=function(){return o.cmList.getCustomFields({id:A.contact.ListId}).$promise.then(function(e){A.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},A.getDateFromString=function(e){return null===e?void 0:new Date(e)},A.getHoppers=function(){A.queryHopper.offset=(A.queryHopper.page-1)*A.queryHopper.limit,A.queryHopper.id=A.contact.id,A.promise=o.cmContact.getHoppers(A.queryHopper,T("hoppers")).$promise},A.getFinals=function(){A.queryFinal.offset=(A.queryFinal.page-1)*A.queryFinal.limit,A.queryFinal.id=A.contact.id,A.promise=o.cmContact.getHopperFinals(A.queryFinal,T("finals")).$promise},A.getHistories=function(){A.queryHistory.offset=(A.queryHistory.page-1)*A.queryHistory.limit,A.queryHistory.id=A.contact.id,A.promise=o.cmContact.getHopperHistories(A.queryHistory,T("histories")).$promise},A.getJscriptySessions=function(){A.queryJscriptySession.offset=(A.queryJscriptySession.page-1)*A.queryJscriptySession.limit,A.queryJscriptySession.id=A.contact.id,A.promise=o.cmContact.getJscriptySessions(A.queryJscriptySession,T("jscriptySessions")).$promise},A.deleteconfirm=function(t,e){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(t.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){var e;e=t,o.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(A.hoppers.rows,{id:e.id}),A.hoppers.count--,A.hoppers.rows.length||A.getHoppers(),s.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},A.editHopper=function(e,t){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:A.hoppers.rows,license:null,setting:null,crudPermissions:A.crudPermissions}})},A.createOrEditIvrCampaignHopper=function(e,t){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:A.hoppers.rows,license:null,setting:null,crudPermissions:A.crudPermissions}})},A.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}(t)};var y=!0,S=1;function T(t){return function(e){A[t]=e||{count:0,rows:[]}}}function I(e){e&&e.count&&e.rows.length&&(A.journey=_.concat(A.journey,e.rows))}e.$watch("vm.queryHopper.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryHopper.page),e!==t&&(A.queryHopper.page=1),e||(A.queryHopper.page=S),A.getHoppers())}),e.$watch("vm.queryFinal.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryFinal.page),e!==t&&(A.queryFinal.page=1),e||(A.queryFinal.page=S),A.getFinals())}),e.$watch("vm.queryHistory.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryHistory.page),e!==t&&(A.queryHistory.page=1),e||(A.queryHistory.page=S),A.getHistories())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),t.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],t=0;t<g.result.errors.length;t+=1){var n=g.result.errors[t].row;n.contact_import_error=g.result.errors[t].message,e.push(n)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(n){i(function(){if(g.result.rows=n.rows,n.errors)for(var e=0;e<n.errors.length;e++)g.result.errors.push(n.errors[e]);if(n.finish){g.result.finish=!0,g.result.affectedRows=n.affectedRows,g.result.failedRows=g.result.errors.length;var t=g.result.rows-g.result.affectedRows-g.result.errors.length;t&&0<t&&(g.duplicates.length?g.result.duplicatedRows=t:g.result.failedRows+=t),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,s,t,o,n,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(t),a.lists=n||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:t.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,t,n){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+n.id+" will be overwritten by the fields of the contact #"+t.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:n.id,from:t.id}).$promise}).then(function(e){i.hide({new:e,to:n,from:t}),_.remove(o,{id:n.id}),_.remove(o,{id:t.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,t){if(e!==t)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var t=_.find(g.globalCustomFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var t=n.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,t){e.splice(t,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.globalCustomFields=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="globalCustomFields",b.listOrder="",b.listOrderAsc=null,b.selectedGlobalCustomFields=[],b.query={fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,page:1},b.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:b.globalCustomFields.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getGlobalCustomFields=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmCustomField.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="GlobalCustomFields",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditGlobalCustomField=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:t,globalCustomFields:b.globalCustomFields.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteGlobalCustomField=S,b.exportSelectedGlobalCustomFields=function(){var e=angular.copy(b.selectedGlobalCustomFields);return b.selectedGlobalCustomFields=[],e},b.deleteSelectedGlobalCustomFields=function(e){var t=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+b.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedGlobalCustomFields.forEach(function(e){S(e)}),b.selectedGlobalCustomFields=[]})},b.deselectGlobalCustomFields=function(){b.selectedGlobalCustomFields=[]},b.selectAllGlobalCustomFields=function(){b.selectedGlobalCustomFields=b.globalCustomFields.rows};var E=!0,A=1;function y(e){b.globalCustomFields=e||{count:0,rows:[]}}function S(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(b.globalCustomFields.rows,{id:e.id}),b.globalCustomFields.count-=1,b.globalCustomFields.rows.length||b.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var t=_.find(g.lists,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserList?"penalty "+e.UserList.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.list=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listCustomFields={count:0,rows:[]},c.selectedListCustomFields=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,alias,type,values,required",limit:10,page:1},c.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.list=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListCustomFields()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListCustomFields=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getCustomFields(c.query,p).$promise},c.createOrEditListCustomField=function(e,t){s.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,customField:t,customFields:c.listCustomFields.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedListCustomFields=function(){var e=angular.copy(c.selectedListCustomFields);return c.selectedListCustomFields=[],e},c.deleteListCustomField=g,c.deleteSelectedListCustomFields=function(e){var t=s.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+c.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedListCustomFields.forEach(function(e){g(e)}),c.selectedListCustomFields=[]})};var m=!0,u=1;function p(e){c.listCustomFields=e||{count:0,rows:[]}}function g(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(c.listCustomFields.rows,{id:e.id}),c.listCustomFields.count-=1,c.listCustomFields.rows.length||c.getListCustomFields(),r.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListCustomFields())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,t){if(e!==t)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var t=_.find(g.customFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var t=n.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,t){e.splice(t,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,n,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(n,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{ListId:n.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:n.id})}},u.agentadddialog=function(e,t){n.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists")},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listVoiceDispositions={count:0,rows:[]},c.selectedListVoiceDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.list=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListVoiceDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the voiceDisposition?").htmlContent("<b>"+(e.name||"voiceDisposition")+"</b> will be deleted.").ariaLabel("delete voiceDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListVoiceDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getDispositions(c.query,p).$promise},c.createOrEditListVoiceDisposition=function(e,t){s.show({controller:"CreateOrEditVoiceDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,voiceDisposition:t,voiceDispositions:c.listVoiceDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedListVoiceDispositions=function(){var e=angular.copy(c.selectedListVoiceDispositions);return c.selectedListVoiceDispositions=[],e},c.deleteListVoiceDisposition=g,c.deleteSelectedListVoiceDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected voiceDispositions?").htmlContent("<b>"+c.selectedListVoiceDispositions.length+" selected</b> will be deleted.").ariaLabel("delete voiceDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedListVoiceDispositions.forEach(function(e){g(e)}),c.selectedListVoiceDispositions=[]})};var m=!0,u=1;function p(e){c.listVoiceDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.listVoiceDispositions.rows,{id:e.id}),c.listVoiceDispositions.count-=1,c.listVoiceDispositions.rows.length||c.getListVoiceDispositions(),r.success({title:"VoiceDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListVoiceDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListVoiceDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_VOICEDISPOSITION",g.voiceDisposition=angular.copy(l),g.voiceDispositions=r,g.newVoiceDisposition=!1,g.voiceDisposition||(g.voiceDisposition={},g.title="CONTACTMANAGER.NEW_VOICEDISPOSITION",g.newVoiceDisposition=!0),t.params.id&&(g.voiceDisposition.ListId=t.params.id),g.addNewVoiceDisposition=function(){g.errors=[],d.disposition.save(g.voiceDisposition).$promise.then(function(e){g.voiceDispositions.unshift(e.toJSON()),o.success({title:"VoiceDisposition properly created",msg:g.voiceDisposition.name?g.voiceDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceDisposition=function(){g.errors=[],d.disposition.update({id:g.voiceDisposition.id},g.voiceDisposition).$promise.then(function(e){var t=_.find(g.voiceDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceDisposition properly saved!",msg:g.voiceDisposition.name?g.voiceDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceDisposition will be deleted.").ariaLabel("Delete VoiceDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.voiceDisposition.id}).$promise.then(function(){_.remove(g.voiceDispositions,{id:g.voiceDisposition.id}),o.success({title:"VoiceDisposition properly deleted!",msg:(g.voiceDisposition.name||"voiceDisposition")+" has been deleted!"}),v(g.voiceDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceDispositions","voiceDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditVoiceDispositionDialogController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.lists=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="lists",b.listOrder="",b.listOrderAsc=null,b.selectedLists=[],b.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:b.crudPermissions})},b.gotocontactsgoto=function(n,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{ListId:n.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:n.id})}},b.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},b.agentadddialog=function(e,t){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:b.lists?b.lists.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getLists=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmList.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Lists",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditList=function(e,t){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:t,lists:b.lists.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteList=S,b.exportSelectedLists=function(){var e=angular.copy(b.selectedLists);return b.selectedLists=[],e},b.deleteSelectedLists=function(e){var t=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+b.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedLists.forEach(function(e){S(e)}),b.selectedLists=[]})},b.deselectLists=function(){b.selectedLists=[]},b.selectAllLists=function(){b.selectedLists=b.lists.rows};var E=!0,A=1;function y(e){b.lists=e||{count:0,rows:[]}}function S(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(b.lists.rows,{id:e.id}),b.lists.count-=1,b.lists.rows.length||b.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;d.currentUser=s.getCurrentUser(),d.userProfile=r,d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=s.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null),d.customDashboard={},d.voiceQueues=o&&o.count?o:{count:0,rows:[]},d.voiceQueuesSelected=o&&o.count?_.map(o.rows,"id"):[],d.interval=t(function(){},1e3),d.onChangeVoiceQueues=function(){for(var e=0;e<d.customDashboard.widgets.length;e+=1)d.customDashboard.widgets[e].voiceQueuesSelected=d.voiceQueuesSelected},d.goToEdit=function(){e.go("app.tools.customDashboards.edit",{id:d.customDashboard.id,tab:1})},i.onWithoutApply("voice_queue:save",function(e){var t=_.find(d.voiceQueues.rows,{id:e.id});t&&_.merge(t,_.pick(e,_.keys(t)))}),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return d.customDashboard=e,d.customDashboard.widgets=[],d.customDashboard.preview=!0,d.customDashboard.draggable={enabled:!1},d.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:d.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",e.rows[t].voiceQueues=d.voiceQueues,e.rows[t].voiceQueuesSelected=d.voiceQueuesSelected,d.customDashboard.widgets.push(e.rows[t])}).catch(function(e){d.customDashboard=void 0}),n.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),d.interval&&t.cancel(d.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","voiceQueues","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,a,i,o,s,t,l,n,r,d,c,m,u,p,g,v,h){var f=this;f.license=p,f.setting=g;function b(e){var t={};for(var n in f.tabs)f.tabs.hasOwnProperty(n)&&(t[n]=f.tabs[n],f.tabs[n].interaction&&(t[n].interaction=_.pick(f.tabs[n].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","closed","draft"])));i.localStorage.setItem("motion2.user:"+f.user.id,JSON.stringify({tabs:t,currentTab:f.currentTab})),E(e)}function E(e){if(_.isNil(e)||e&&"interaction"===e.type){var t={id:f.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],openchannel:[],chat:[]}};for(var n in f.tabs)f.tabs.hasOwnProperty(n)&&t.capacity.hasOwnProperty(f.tabs[n].channel)&&f.tabs[n].interaction&&!f.tabs[n].interaction.closed&&(t.capacity[f.tabs[n].channel]+=1,t.interaction[f.tabs[n].channel].push(f.tabs[n].interaction.id));if(!_.isEqual(f.agentCapacity,t.capacity))return f.agentCapacity=t.capacity,l.rpc.setAgentCapacity(t)}}function A(t){if(f.tabs[t.id]&&(function(e){if(e.channel&&e.interaction)l.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:f.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){console.error(e)})}(f.tabs[t.id]),delete f.tabs[t.id],f.currentTab=0,b(t),"interaction"===t.type))return l[t.channel+"Interaction"].get({id:t.interaction.id}).$promise.then(function(e){return l.user["remove"+_.upperFirst(t.channel)+"Interactions"]({id:f.user.id,ids:[e.id]}).$promise}).catch(function(e){console.error(e)})}function y(e){e.id=_.random(1e10),e.openedAt=new Date,e.saved=!1,e.badges=0,f.tabs[e.id]=e,f.currentTab=e.id,b(e)}function S(t,n){var e={type:"interaction",title:t?t.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}}(t),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"grey"}}(t),channel:t,interaction:n},a=_.find(f.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===n.id&&e.channel===t});a?f.currentTab=a.id:y(e)}function T(e){e&&e.uniqueid&&f.notifications[e.uniqueid]&&(r.clear(f.notifications[e.uniqueid]),delete f.notifications[e.uniqueid])}function I(e,t){return 0<=t&&(e.calls[t].disposedAt=new Date,n.removeAllListeners("voice_queue_channel:remove"),n.removeAllListeners("voice_outbound_channel:remove"),!0)}function C(){return function(e){if(404===e.status)r.warning({title:o.instant("DASHBOARDS.ATTENTION"),msg:o.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}f.detectBrowser=h.detectBrowser(),f.user=t.getCurrentUser(),f.currentTab=0,f.notifications={},f.tabs={},f.agentCapacity={},f.globalUserLists=d||{count:0,rows:[]},f.globalLists=c||{count:0,rows:[]},f.globalCompanies=m||{count:0,rows:[]},f.globalTags=u||{count:0,rows:[]},f.onContactManager=function(t){var e={ListId:t.ListId,limit:1,offset:0,sort:"-updatedAt"},n=!1,a=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum||t.uniqueid,i=t.calleridnum;_.isNil(t["xmd-contactid"])?_.isNil(t.routeId)?e.phone=t.calleridnum:(e.phone=t.destcalleridnum,a=t.destcalleridname&&"<unknown>"!==t.destcalleridname?t.destcalleridname:t.destcalleridnum||t.uniqueid,i=t.destcalleridnum):(e.id=t["xmd-contactid"],n=!0,_.isNil(t["xmd-listid"])||parseInt(t["xmd-listid"],10)===t.ListId||t["xmd-contactid2"]&&(e.id=t["xmd-contactid2"]));return l.cmContact.get(e).$promise.then(function(e){n?e&&f.addContactTab(e,t):e.count&&e.rows[0]?f.addContactTab(e.rows[0],t):f.addContactTab({firstName:a,ListId:t.ListId,phone:i},t)}).catch(C())},f.onJscripty=function(n){return l.jscriptyProject.get({id:n.ProjectId}).$promise.then(function(t){if(t){if(!_.isUndefined(n["xmd-contactid"]))return l.cmContact.get({id:n["xmd-contactid"]}).$promise.then(function(e){try{t.formData=Mustache.render(t.formData,_.merge(n,{user:f.user,contact:e}))}catch(e){console.error(e)}y({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n,contact:e})}).catch(C());try{t.formData=Mustache.render(t.formData,_.merge(n,{user:f.user}))}catch(e){console.error(e)}y({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n})}}).catch(C())},f.onBot=function(t){var n=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum,a=t.calleridnum;return l.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:t.uniqueid}).$promise.then(function(e){e.count&&y({type:"bot",title:n+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:t.uniqueid}})})},f.onBrowserUrl=function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"<%3B",""),e.uri=_.replace(e.uri,"=>%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;default:i.open(e.uri)}else i.open(e.uri)},f.onBrowserPopup=function(e){e&&e.html&&y({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})},f.onNotificationSave=function(e){if(e&&e.uniqueid){n=e,v.isSupported()?v.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=n).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},v.show(e.title,t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.");var t=f.alreadyExistsTab(e);if(t){if(l[e.channel+"Message"])return f.currentTab!==t.id&&(t.badges+=1),l[e.channel+"Message"].accept({id:e.id,UserId:f.user.id}).$promise.catch(C())}else r.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){f.notifications[e.uniqueid]=this.id},onAccept:function(){if(T(e),l[e.channel+"Message"])return l[e.channel+"Message"].accept({id:e.id,UserId:f.user.id,manual:!0}).$promise.then(function(e){S(e.channel,e.interaction),r.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(C())},onReject:function(){if(T(e),l[e.channel+"Message"])return l[e.channel+"Message"].reject({id:e.id,UserId:f.user.id}).$promise.then(function(e){r.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(C())}})}var n},f.onNotificationRemove=T,f.onVoiceChannelRemove=function(t){var e=f.currentTab?f.tabs[f.currentTab]:null;e||(e=_.find(f.tabs,{calls:[{uniqueid:t.uniqueid}]}));var n=_.findLastIndex(e.calls,function(e){return e.uniqueid===t.uniqueid});if(!I(e,n)){var a=_.find(f.tabs,{calls:[{uniqueid:t.uniqueid}]});if(a){var i=_.findLastIndex(a.calls,function(e){return e.uniqueid===t.uniqueid});I(a,i)}}f.contact&&f.contact.id&&$timeout((s=t.uniqueid,o=f.contact.id,r=e,function(){var e=_.find(r.calls,function(e){return e.uniqueid===s});if(e)return l.voiceCallReport.update({id:s,ContactId:o}).$promise.catch(function(e){console.error(e)})}),1e3);var s,o,r},f.onClickTab=function(e){f.currentTab=e,b(f.tabs[e])},f.isActiveTab=function(e){return e===f.currentTab},f.alreadyExistsTab=function(t){return _.find(f.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==t.interactionId&&e.channel==t.channel})},f.addContactTab=function(t,n){var a={type:"contact",title:t?function(e){var t="";e&&(e.firstName||e.lastName?(e.firstName&&(t+=e.firstName+" "),e.lastName&&(t+=e.lastName)):e.phone&&(t=e.phone));return t}(t):o.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:t,userLists:d,lists:c,companies:m,tags:u,calls:n?[n]:[],autoCreate:n?n.autoCreate:0};if(n){if(n["xmd-cdrtype"]&&"dialer"===n["xmd-cdrtype"])n.answeredAt=n.agentcalledAt?moment(n.agentcalledAt,"YYYY-MM-DD HH:mm:ss").toDate():new Date;else if(n.uniqueid){var e=n.uniqueid.split(".")[0];n.answeredAt=e?new Date(1e3*parseInt(e)):new Date}(n.agentcompleteAt||n.endtime)&&(n.disposedAt=new Date)}if(t){var i=_.find(f.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==t.id:"contact"===e.type&&e.contact&&e.contact.phone==t.phone});if(i){if(n)if(i.calls){var s=_.find(i.calls,function(e){return e.uniqueid===n.uniqueid});s||i.calls.push(n)}else i.calls=[n];f.currentTab=i.id}else{if(t.ListId)return l.disposition.get({ListId:t.ListId}).$promise.then(function(e){return a.dispositions=e,l.cmList.getCustomFields({id:t.ListId}).$promise}).then(function(e){a.customFields=e}).catch(C()).finally(function(){y(a)});y(a)}}else y(a)},f.addInteractionTab=S,f.addTab=y,f.removeTab=A,f.updateLocalStorage=b,f.closeTab=function(e){var t=a.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved)return a.show(t).then(function(){"interaction"===e.type&&a.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{user:f.user,channel:e.channel,interaction:e.interaction}}),A(e)}).catch(function(){"interaction"===e.type&&A(e)});var n=!1;if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",a.show(t).then(function(){A(e)});alert=a.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK"),a.show(alert).finally(function(){alert=void 0})}else A(e)}},n.on("trigger:contactmanager",f.onContactManager),n.on("trigger:jscripty",f.onJscripty),n.on("trigger:bot",f.onBot),n.on("trigger:browser:url",f.onBrowserUrl),n.on("trigger:browser:popup",f.onBrowserPopup),n.on("notification:save",f.onNotificationSave),n.on("notification:remove",f.onNotificationRemove),function(){var e=i.localStorage.getItem("motion2.user:"+f.user.id);if(e)try{e=JSON.parse(e),f.tabs=e.tabs?e.tabs:{},f.currentTab=e.currentTab?e.currentTab:0,E(f.tabs[f.currentTab])}catch(e){console.error(e)}}(),e.$on("$destroy",function(){for(var e in f.notifications)f.notifications.hasOwnProperty(e)&&T({uniqueid:e});n.removeAllListeners("trigger:contactmanager"),n.removeAllListeners("trigger:jscripty"),n.removeAllListeners("trigger:browser:url"),n.removeAllListeners("trigger:browser:popup"),n.removeAllListeners("notification:save"),n.removeAllListeners("notification:remove")})}e.$inject=["$scope","$mdDialog","$window","$translate","$document","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var t in e)f.hasOwnProperty(t)&&null!=e[t]&&(f[t]=e[t])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,t,p){var g=t.Notification||t.mozNotification||t.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var n=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?n.resolve(e):n.reject(e)}):g.requestPermission(function(e,t){p.GRANTED===e?n.resolve(e):n.reject(e)});return n.promise},show:function(e,t){if(t=t||{},!v()||(n=e,a=t,i=angular.isString(n),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(t.showOnPageHidden)||h()!==p.GRANTED)return;var n,a,i,s;var o=new g(e,t),r=t.duration||f.duration,l=void 0===t.autoClose?f.autoClose:t.autoClose;o.onclick=function(){t.onClick&&t.onClick(),t.focusOnclick&&window.focus(),t.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function t(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,s=0;s<t.length;s++)if(t[s]._id===a){t=t[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(o),t=o.children}}return t}(n),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,t),s.uisref=d(s)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=d(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=t,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],s=0;s<t.length;s++)if(t[s]._id===i){if(t[s]._path===e)return t.splice(s,1),!0;t=t[s].children;break}return!1},this.$get=function(){var e={saveItem:t,getNavigation:function(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(n){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,t){{if(a.setting=t,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return n.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(o,r,n,l,d,c,t,e,a,i){var m=this;function s(e){e&&e.count&&e.rows.length&&(m.journey=_.concat(m.journey,e.rows))}m.user=t.getCurrentUser(),m.detectBrowser=i.detectBrowser(),m.journey=[],m.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},m.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,page:1},m.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},m.hoppers={rows:[],count:0},m.finals={rows:[],count:0},m.histories={rows:[],count:0},m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){return m.contact.id=e.id,m.newContact=!1,m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly created",msg:m.contact.firstName?m.contact.firstName+" has been created!":""})}).then(function(){return d.cmContact.setTags({id:m.contact.id,ids:m.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){return m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,l.$parent.vm.updateLocalStorage(),d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){return d.cmContact.setTags({id:m.contact.id,ids:m.tab.Tags}).$promise}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly updated!",msg:m.contact.name?m.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getCustomFields=function(e){return d.cmList.getCustomFields({id:e}).$promise.then(function(e){m.tab.customFields=e}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.call=l.$parent.vm.call,m.disposeCall=function(e,t){if(m.newContact)return void c.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});o.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(r.body),targetEvent:t,clickOutsideToClose:!1,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null"})}]},locals:{dispositions:m.tab.dispositions,contact:m.contact,call:t}}).then(function(e){e&&("BLACKLIST"===e?c.success({title:a.instant("DASHBOARDS.INFO"),msg:a.instant("DASHBOARDS.CALL_DISPOSED")+" "+e}):"RECALLME"===e||"RESCHEDULE"===e||c.success({title:a.instant("DASHBOARDS.INFO"),msg:a.instant("DASHBOARDS.CALL_SAVED")})),_.remove(m.tab.calls,function(e){return e.uniqueid==t.uniqueid})})},m.duplicateContact=function(e){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},m.mergeContact=function(e){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var t in l.$parent.$parent.$parent.vm.tabs)if(l.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var n=l.$parent.$parent.$parent.vm.tabs[t];n&&n.contact&&(e.from&&e.from.id&&e.from.id===n.contact.id&&l.$parent.$parent.$parent.vm.removeTab(n),e.to&&e.to.id&&e.to.id===n.contact.id&&l.$parent.$parent.$parent.vm.removeTab(n))}e.new&&l.$parent.$parent.$parent.vm.addContactTab(e.new)}})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:m.contact,user:m.user})}catch(e){console.error(e)}try{l.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:m.contact})}catch(e){c.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},m.getHoppers=function(){m.contact&&m.contact.id&&(m.queryHopper.ContactId=m.contact.id,m.queryHopper.offset=(m.queryHopper.page-1)*m.queryHopper.limit,m.promise=d.cmHopper.get(m.queryHopper,g("hoppers")).$promise)},m.getFinals=function(){m.contact&&m.contact.id&&(m.queryFinal.ContactId=m.contact.id,m.queryFinal.offset=(m.queryFinal.page-1)*m.queryFinal.limit,m.promise=d.cmHopperFinal.get(m.queryFinal,g("finals")).$promise)},m.getHistories=function(){m.contact&&m.contact.id&&(m.queryHistory.ContactId=m.contact.id,m.queryHistory.offset=(m.queryHistory.page-1)*m.queryHistory.limit,m.promise=d.cmHopperHistory.get(m.queryHistory,g("histories")).$promise)},m.getJscriptyProjects=function(){d.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){m.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscripty.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscripty.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getMailAccounts=function(){d.user.getMailAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.mailAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getFaxAccounts=function(){d.user.getFaxAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.faxAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.fax.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.fax.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getSmsAccounts=function(){d.user.getSmsAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.smsAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sms.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getOpenchannelAccounts=function(){d.user.getOpenchannelAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.openchannelAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannel.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getChatWebsites=function(){d.user.getChatWebsites({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.chatAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatAccounts.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatAccounts.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getLists=function(){d.user.getLists({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.lists=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cm.lists"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cm.lists",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.composeInteraction=function(e,i,t,n){var s=i.toLowerCase();o.show({controller:"Compose"+i+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose"+i+"/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{account:t,message:{to:"mail"==s?n:n.split(",")},type:"new",interaction:{Contact:m.contact}},fullscreen:!0}).then(function(a){return d[s+"Account"].send({id:t.id},a).$promise.then(function(e){if("Mail"===i){var t=e;if(t&&t.Messages&&t.Messages.length){if(a.attachments&&a.attachments.length)for(var n=0;n<a.attachments.length;n+=1)d.attachment.update({id:a.attachments[n].id},{MailMessageId:_.head(t.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),t.closed?(t.disposition=null,o.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{user:m.user,channel:"mail",interaction:t}})):l.$parent.vm.addInteractionTab("mail",t)}}else c.success({title:"Message properly sent!",msg:"Message has been sent!"}),l.$parent.vm.addInteractionTab(s,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else"fax"===s?c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):c.error({title:e.status?"API:"+e.status+" - "+e.statusText:i.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.init=function(e,t){m.tab=e,l.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){m.tab.saved=e[0]&&e[1]}),m.license=t,m.contact=m.tab.contact,m.newContact=!1,m.currentTab=0,m.contact&&m.contact.id?(d.user.addContacts({id:m.user.id,ids:[m.contact.id]}),m.contact.ListId&&(m.tab.userLists.rows=_.unionBy(m.tab.userLists.rows,_.filter(m.tab.lists.rows,{id:m.contact.ListId}),"id"),m.list=_.find(m.tab.userLists.rows,{id:m.contact.ListId})),m.getHoppers(),m.getFinals(),m.getHistories(),m.getMailAccounts(),m.getFaxAccounts(),m.getSmsAccounts(),m.getOpenchannelAccounts(),m.getChatWebsites(),m.getLists()):(m.newContact=!0,e.autoCreate&&(console.log("autoCreate"),m.addNewContact()));d.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){m.users=e||{count:0,rows:[]},m.usersMap=_.mapValues(_.keyBy(m.users.rows,"id"),"fullname")}).then(function(){if(m.contact&&m.contact.id)return d.cmContact.getTags({id:m.contact.id}).$promise}).then(function(e){e&&(m.tab.Tags=_.map(e.rows,"id"))}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)d[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(s);d.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(s).catch(function(e){console.error(e)})}}(m.contact))},m.hasPermission=function(e){return t.hasPermission(e)},m.openInteraction=function(e,t){try{if(t.MailAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return l.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){c.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},m.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}(t)},m.isMyAccount=function(e){{if(e.FaxAccountId)return _.includes(_.map(m.faxAccounts?m.faxAccounts.rows:[],"id"),e.FaxAccountId);if(e.OpenchannelAccountId)return _.includes(_.map(m.openchannelAccounts?m.openchannelAccounts.rows:[],"id"),e.OpenchannelAccountId);if(e.SmsAccountId)return _.includes(_.map(m.smsAccounts?m.smsAccounts.rows:[],"id"),e.SmsAccountId);if(e.MailAccountId)return _.includes(_.map(m.mailAccounts?m.mailAccounts.rows:[],"id"),e.MailAccountId);if(e.ChatWebsiteId)return _.includes(_.map(m.chatAccounts?m.chatAccounts.rows:[],"id"),e.ChatWebsiteId);if(e.amaflags)return!0}return!1},e.on("voice_queue_channel:remove",l.$parent.vm.onVoiceChannelRemove),e.on("voice_outbound_channel:remove",l.$parent.vm.onVoiceChannelRemove),m.getJscriptyProjects(),l.$watch("currentTab",function(e,t){1===m.currentTab&&(m.getHoppers(),m.getFinals(),m.getHistories())});var u=!0,p=1;function g(t){return function(e){m[t]=e||{count:0,rows:[]}}}l.$watch("queryHopper.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryHopper.page),e!==t&&(m.queryHopper.page=1),e||(m.queryHopper.page=p),m.getHoppers())}),l.$watch("queryFinal.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryFinal.page),e!==t&&(m.queryFinal.page=1),e||(m.queryFinal.page=p),m.getFinals())}),l.$watch("queryHistory.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryHistory.page),e!==t&&(m.queryHistory.page=1),e||(m.queryHistory.page=p),m.getHistories())}),l.$on("$destroy",function(){})}e.$inject=["$mdDialog","$document","$timeout","$scope","api","toasty","Auth","socket","$translate","msUtils"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(t,i,s,o,e,n,a,r,l,d){var c=this;function m(){var e=c.choice?c.choice.toLowerCase():void 0;return{id:c.call.uniqueid,disposition:c.choice,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?l.getCurrentUser().id:null,OwnerId:l.getCurrentUser().id}}c.choice=null,c.isReschedule=!1,c.recallme=!1,c.queueCampaigns={count:0,rows:[]},c.queueCampaign=void 0,c.dispositions=e,c.globalDispositions=n,c.contact=r,c.call=a,c.note=c.call.note||void 0,c.dialerCall=!1,c.hasBlackLists=!1,c.hopper={minDate:new Date,dateTime:new Date},c.call&&c.call.variables&&c.call.variables["xmd-voicequeueid"]?(c.dialerCall=!0,o.voiceQueue.getBlackLists({id:c.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(c.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):o.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,dialActive",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){c.queueCampaigns=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),c.saveDisposition=function(e){c.choice=_.isNil(e)?c.choice:e,c.call.note=c.note,o.user.unpause({id:l.getCurrentUser().id}).$promise.then(function(e){}).catch(function(e){console.error(e)}),o.voiceCallReport.update({id:c.call.uniqueid,userDisposition:c.choice,note:c.note,UserId:l.getCurrentUser().id,ContactId:c.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:c.call.uniqueid}).$promise.then(function(e){if(e)for(var t=0;t<e.rows.length;t+=1)o.voiceRecording.update({id:e.rows[t].id,userDisposition:c.choice}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.dialerCall&&(o.cmHopperFinal.update(m()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(m()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(c.choice))t.hide(c.choice?c.choice.toUpperCase():"");else switch(c.choice.toLowerCase()){case"blacklist":c.call&&c.call.variables&&c.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var t=[];if(e&&0<e.count){for(var n=0;n<e.rows.length;n+=1){var a=angular.copy(c.contact);delete a.id,a.ListId=e.rows[n].id,t.push(o.cmContact.save(a).$promise)}return i.all(t)}s.success({title:d.instant("DASHBOARDS.INFO"),msg:d.instant("DASHBOARDS.NOTAVAILABLE")+" "+c.choice}),c.choice=void 0}).then(function(e){e&&t.hide(c.choice?c.choice.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),t.hide(c.choice?c.choice.toUpperCase():"")})}(c.call.variables["xmd-voicequeueid"]);break;case"reschedule":c.isReschedule=!0,c.recallme=!1;break;case"recallme":c.isReschedule=!0,c.recallme=!0;break;default:t.hide(c.choice?c.choice.toUpperCase():"")}},c.closeDialog=function(){t.cancel()},c.saveReschedule=function(){return c.disable=!0,o.cmHopper.save({phone:c.contact.phone,UserId:c.recallme?l.getCurrentUser().id:null,ContactId:c.contact.id,ListId:c.contact.ListId,VoiceQueueId:c.dialerCall?Number(c.call["xmd-voicequeueid"]):c.queueCampaign?c.queueCampaign.id:null,scheduledat:moment(c.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c.recallme,OwnerId:l.getCurrentUser().id}).$promise.then(function(){c.dialerCall&&o.cmHopperFinal.update({id:c.call.uniqueid,rescheduled:!0,rescheduledat:moment(c.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c.recallme}).$promise.catch(function(e){console.log(e)})}).then(function(){s.success({title:d.instant("DASHBOARDS.INFO"),msg:d.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c.recallme?d.instant("DASHBOARDS.RECALLME"):d.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){t.hide(c.choice?c.choice.toUpperCase():"")}).finally(function(){c.disable=!1,t.hide(c.choice?c.choice.toUpperCase():"")})}}e.$inject=["$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){var e=i.localStorage.getItem("motion2.home.abandoned.bull.calls:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),o.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null"}).$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getAbandonedCalls()})}function p(e){m.abandonedCalls=e||{count:0,rows:[]},!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition={count:0,rows:[]},m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null},m.queues={},m.abandonedCalls={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.pickerModel={dateStart:null},m.getAbandonedCalls()},m.getAbandonedCalls=function(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.bull.calls:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=o.voiceQueueReport.getVoiceQueuesReport(m.query,p).$promise},m.refreshAbandonedCalls=function(){m.showTooltip=!1,m.getAbandonedCalls()},m.onInit=u,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"outbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.abandonedCalls.rows,["id",e.id]);0<=t&&_.merge(m.abandonedCalls.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),u();var g=!0,v=1;e.$watch("vm_bull.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getAbandonedCalls())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){var e=i.localStorage.getItem("motion2.home.abandoned.voice.calls:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),o.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null"}).$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getAbandonedCalls()})}function p(e){m.abandonedCalls=e||{count:0,rows:[]},!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition={count:0,rows:[]},m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null},m.queues={},m.abandonedCalls={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.pickerModel={dateStart:null},m.getAbandonedCalls()},m.getAbandonedCalls=function(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.voice.calls:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=o.voiceQueueReport.getVoiceQueuesReport(m.query,p).$promise},m.refreshAbandonedCalls=function(){m.showTooltip=!1,m.getAbandonedCalls()},m.onInit=u,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"inbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.abandonedCalls.rows,["id",e.id]);0<=t&&_.merge(m.abandonedCalls.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),u();var g=!0,v=1;e.$watch("vm_voice.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getAbandonedCalls())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(t,e,a,n,i,s,o){var r=this;r.user=i.getCurrentUser(),r.license={},r.plugin={},r.setting={},r.sidebar="dashboard",r.navigation=o.getNavigation(),r.addContactTab=t.$parent.vm.addContactTab,r.addInteractionTab=t.$parent.vm.addInteractionTab,r.init=function(e,t){r.license=e,r.setting=t;var n=a.localStorage.getItem("motion2.home:"+r.user.id);if(n)try{n=JSON.parse(n),r.sidebar=n.currentSidebarTab?n.currentSidebarTab:"dashboard"}catch(e){console.error(e),r.sidebar="dashboard"}},r.changeSidebarTab=function(e){r.sidebar=e.view,"plugin"===r.sidebar&&(r.plugin=e.stateParams,r.pluginId=e.id,t.$broadcast("pluginUpdated",{plugin:r.plugin}));a.localStorage.setItem("motion2.home:"+r.user.id,JSON.stringify({currentSidebarTab:e.view}))},r.hasPermission=function(e){return i.hasPermission(e)}}e.$inject=["$scope","$timeout","$window","api","Auth","socket","msNavigationAgentService"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(n,a,e,t,i,s,o,r,l,d,c){var m=this;function u(e){m.chatInteractions=e||{count:0,rows:[]};for(var t=0;t<m.chatInteractions.rows.length;t+=1)g(m.chatInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.chatAccounts.rows.length?(_.includes(_.map(m.chatAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.ChatWebsiteId=m.query.account||_.map(m.chatAccounts.rows,"id").join()):m.query.ChatWebsiteId=-1,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.chat:"+m.user.id,JSON.stringify({query:m.query})),m.promise=o.chatInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=r.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.chatInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getChatInteractions=p,m.showChatInteraction=function(e,t){n.$parent.vm.addInteractionTab("chat",t)},m.downloadChatInteraction=function(e,s,t){o.chatInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="chat-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||"");var n=e.Account?e.Account.mapKey:void 0;return t+=n&&e.Contact[n]?" <"+e.Contact[n]+">":""}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getChatInteractions()},m.onInit=function(e,t){return m.license=e,m.setting=t,o.user["get"+_.upperFirst("ChatWebsites")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.chatAccounts=e||{count:0,rows:[]},o.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return o.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.chat:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}l.on("chatInteraction:save",m.onChatInteractionSave),l.on("chatInteraction:update",m.onChatInteractionSave),l.on("chatInteractionTags:save",m.onChatInteractionTagsSave),l.on("chatMessage:save",m.onChatMessageSave),l.on("chatMessage:update",m.onChatMessageSave),l.on("user_has_chat_interactions:save",m.onChatInteractionOpen),l.on("user_has_chat_interactions:remove",m.onChatInteractionClose),m.getChatInteractions()})},m.onChatInteractionSave=function(e){if(e){var t=_.find(m.chatInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onChatInteractionTagsSave=function(e){if(e){var t=_.find(m.chatInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onChatMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onChatInteractionOpen=function(e){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onChatInteractionClose=function(e){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=c,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getChatInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.getContacts=function(){l.query.ListId=l.getListId(),l.query.offset=(l.query.page-1)*l.query.limit,r.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify({query:l.query})),l.promise=o.cmContact.get(l.query,m).$promise},l.refreshContacts=function(){l.getContacts()},l.mergeContact=function(e,t){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,t){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){t.$parent.vm.addContactTab(e)})},l.call=t.$parent.vm.call,l.onInit=u,l.getListId=function(){var e=_.toString(l.query.ListId);if(e){var t=e.split(","),n=l.defaultLists.split(",");_.isEqual(t,n)||(1<t.length?e=l.defaultLists:_.indexOf(n,t[0])<0&&(e=l.defaultLists))}else e=l.defaultLists;return e},u();var d=!0,c=1;function m(e){l.contacts=e||{count:0,rows:[]}}function u(){var e=r.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(l.query=_.merge(l.query,e.query),l.query=_.omit(l.query,"filter")),o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),l.defaultLists=l.lists.rows?_.map(l.lists.rows,"id").join(","):void 0,o.tag.get().$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){l.getContacts()})}t.$watch("vm.query.filter",function(e,t){d?a(function(){d=!1}):(t||(c=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=c),l.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,t){c.rpcChatQueues[t]&&(c.chatQueues[t].waiting=c.rpcChatQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("chatQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,t){c.rpcFaxQueues[t]&&(c.faxQueues[t].waiting=c.rpcFaxQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("faxQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,t){c.rpcMailQueues[t]&&(c.mailQueues[t].waiting=c.rpcMailQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("mailQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,t){c.rpcOpenchannelQueues[t]&&(c.openchannelQueues[t].waiting=c.rpcOpenchannelQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,t){c.rpcSmsQueues[t]&&(c.smsQueues[t].waiting=c.rpcSmsQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("smsQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.user.getQueues(c.query).$promise.then(function(e){return c.myQueues=e,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var t=e.rows,n=_.keyBy(t,"id"),a=0;a<c.myQueues.count;a++){var i=c.myQueues.rows[a];c.rpcVoiceQueues[i.id]=n[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(c.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.faxInteractions=e||{count:0,rows:[]};for(var t=0;t<m.faxInteractions.rows.length;t+=1)g(m.faxInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.faxAccounts.rows.length?(_.includes(_.map(m.faxAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.FaxAccountId=m.query.account||_.map(m.faxAccounts.rows,"id").join()):m.query.FaxAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.faxInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getFaxInteractions=p,m.showFaxInteraction=function(e,t){n.$parent.vm.addInteractionTab("fax",t)},m.downloadFaxInteraction=function(e,s,t){l.faxInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="fax-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.fax||"unknown")+">"}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getFaxInteractions()},m.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("faxAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("faxInteraction:save",m.onFaxInteractionSave),d.on("faxInteraction:update",m.onFaxInteractionSave),d.on("faxInteractionTags:save",m.onFaxInteractionTagsSave),d.on("faxMessage:save",m.onFaxMessageSave),d.on("faxMessage:update",m.onFaxMessageSave),d.on("user_has_fax_interactions:save",m.onFaxInteractionOpen),d.on("user_has_fax_interactions:remove",m.onFaxInteractionClose),m.getFaxInteractions()})},m.onFaxInteractionSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onFaxInteractionTagsSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onFaxMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onFaxInteractionOpen=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onFaxInteractionClose=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getFaxInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(a,n,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.mailInteractions=e||{count:0,rows:[]};for(var t=0;t<m.mailInteractions.rows.length;t+=1)g(m.mailInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.mailAccounts.rows.length?(_.includes(_.map(m.mailAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.MailAccountId=m.query.account||_.map(m.mailAccounts.rows,"id").join()):m.query.MailAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.mail:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.mailInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.mailInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getMailInteractions=p,m.showMailInteraction=function(e,t){a.$parent.vm.addInteractionTab("mail",t)},m.downloadMailInteraction=function(e,s,t){l.mailInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="mail-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.to&&e.Account&&e.to.indexOf(e.Account.email)<0?t=e.to:t+=" <"+(e.Contact.email||"unknown")+">",t}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getMailInteractions()},m.composeMailInteraction=function(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(n){return l.mailAccount.send({id:t.id},n).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)l.attachment.update({id:n.attachments[t].id},{MailMessageId:_.head(e.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed?(e.disposition=null,i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{user:m.user,channel:"mail",interaction:e}})):a.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("mailAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.mailAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).then(function(){return l.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){m.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mail:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("mailInteraction:save",m.onMailInteractionSave),d.on("mailInteraction:update",m.onMailInteractionSave),d.on("mailInteractionTags:save",m.onMailInteractionTagsSave),d.on("mailMessage:save",m.onMailMessageSave),d.on("mailMessage:update",m.onMailMessageSave),d.on("user_has_mail_interactions:save",m.onMailInteractionOpen),d.on("user_has_mail_interactions:remove",m.onMailInteractionClose),m.getMailInteractions()})},m.onMailInteractionSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onMailInteractionTagsSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onMailMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onMailInteractionOpen=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onMailInteractionClose=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;a.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getMailInteractions())}),a.$on("$destroy",function(){d.removeAllListeners("mailMessage:save"),d.removeAllListeners("mailMessage:update"),d.removeAllListeners("mailInteraction:save"),d.removeAllListeners("mailInteractionTags:save"),d.removeAllListeners("mailInteraction:update"),d.removeAllListeners("user_has_mail_interactions:save"),d.removeAllListeners("user_has_mail_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(n,a,i,s,e,t,o){var r=this;r.currentUser=e.getCurrentUser(),r.lists={},r.contacts={count:0,rows:[]},r.tags={count:0,rows:[]},r.query={includeAll:!0,id:r.currentUser.id,sort:"-updatedAt",limit:10,page:1},r.getContacts=function(){r.query.ListId=r.getListId(),r.query.offset=(r.query.page-1)*r.query.limit,o.localStorage.setItem("motion2.home.mycontacts:"+r.currentUser.id,JSON.stringify({query:r.query})),r.promise=t.user.getContacts(r.query,c).$promise},r.refreshContacts=function(){r.getContacts()},r.mergeContact=function(e,t){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.duplicateContact=function(e,t){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.openContact=function(e,t){a.$parent.vm.addContactTab(t)},r.call=a.$parent.vm.call,r.onInit=function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+r.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(r.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}t.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return r.lists=e||{count:0,rows:[]},r.listsMap=_.keyBy(r.lists.rows,"id"),r.defaultLists=r.lists.rows?_.map(r.lists.rows,"id").join(","):void 0,t.tag.get().$promise}).then(function(e){r.tags=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){r.getContacts()})},r.getListId=function(){var e=_.toString(r.query.ListId);if(e){var t=e.split(","),n=r.defaultLists.split(",");_.isEqual(t,n)||(1<t.length?e=r.defaultLists:_.indexOf(n,t[0])<0&&(e=r.defaultLists))}else e=r.defaultLists;return e};var l=!0,d=1;function c(e){r.contacts=e||{count:0,rows:[]}}a.$watch("vm.query.filter",function(e,t){l?i(function(){l=!1}):(t||(d=r.query.page),e!==t&&(r.query.page=1),e||(r.query.page=d),r.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.openchannelInteractions=e||{count:0,rows:[]};for(var t=0;t<m.openchannelInteractions.rows.length;t+=1)g(m.openchannelInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.openchannelAccounts.rows.length?(_.includes(_.map(m.openchannelAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.OpenchannelAccountId=m.query.account||_.map(m.openchannelAccounts.rows,"id").join()):m.query.OpenchannelAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.openchannel:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.openchannelInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.openchannelInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getOpenchannelInteractions=p,m.showOpenchannelInteraction=function(e,t){n.$parent.vm.addInteractionTab("openchannel",t)},m.downloadOpenchannelInteraction=function(e,s,t){l.openchannelInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="openchannel-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.from&&(t=e.from),t}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getOpenchannelInteractions()},m.composeOpenchannelInteraction=function(e,t){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeOpenchannel/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.openchannelAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("openchannelAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.openchannelAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.openchannel:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("openchannelInteraction:save",m.onOpenchannelInteractionSave),d.on("openchannelInteraction:update",m.onOpenchannelInteractionSave),d.on("openchannelInteractionTags:save",m.onOpenchannelInteractionTagsSave),d.on("openchannelMessage:save",m.onOpenchannelMessageSave),d.on("openchannelMessage:update",m.onOpenchannelMessageSave),d.on("user_has_openchannel_interactions:save",m.onOpenchannelInteractionOpen),d.on("user_has_openchannel_interactions:remove",m.onOpenchannelInteractionClose),m.getOpenchannelInteractions()})},m.onOpenchannelInteractionSave=function(e){if(e){var t=_.find(m.openchannelInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onOpenchannelInteractionTagsSave=function(e){if(e){var t=_.find(m.openchannelInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onOpenchannelMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onOpenchannelInteractionOpen=function(e){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onOpenchannelInteractionClose=function(e){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getOpenchannelInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("openchannelMessage:save"),d.removeAllListeners("openchannelMessage:update"),d.removeAllListeners("openchannelInteraction:save"),d.removeAllListeners("openchannelInteractionTags:save"),d.removeAllListeners("openchannelInteraction:update"),d.removeAllListeners("user_has_openchannel_interactions:save"),d.removeAllListeners("user_has_openchannel_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e,t,n){d.license=e,d.setting=t,d.plugin=n}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),t.$on("pluginUpdated",function(e,t){d.plugin=t.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.voiceRecordings=e||{count:0,rows:[]}}p.currentUser=c.getCurrentUser(),p.voiceRecordings={},p.localizationMap=u,p.pickerModel={dateStart:null},p.table="voiceRecordings",p.query={UserId:p.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",sort:"-updatedAt",limit:10,page:1,type:null},p.downloadfile=function(i,e){return r.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.success=g,p.getVoiceRecordings=function(){if(p.pickerModel.dateStart){var e=moment(p.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();p.query.createdAt={$gte:p.pickerModel.dateStart,$lte:e}}else p.query.createdAt=void 0;p.query.offset=(p.query.page-1)*p.query.limit,t.localStorage.setItem("motion2.home.recordings:"+p.currentUser.id,JSON.stringify({query:p.query})),p.promise=r.voiceRecording.get(p.query,g).$promise},p.onInit=function(){var e=t.localStorage.getItem("motion2.home.recordings:"+p.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.omit(e.query,["filter","id"]),p.query.fields="createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",p.query.UserId=p.currentUser.id)}catch(e){console.error(e)}p.getVoiceRecordings()},p.clearAll=function(){p.pickerModel={dateStart:null},p.getVoiceRecordings()};var v=!0,h=1;e.$watch("vm.query.filter",function(e,t){v?o(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","api","msUtils","toasty","Auth","$translate","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){d.scheduledCalls=e||{count:0,rows:[]}}d.currentUser=r.getCurrentUser(),d.priorities=["Lowest","Low","Medium","High","Highest"],d.localizationMap=l,d.pickerModel={dateStart:null},d.scheduledCalls={},d.query={id:d.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId",sort:"scheduledat",limit:10,page:1},d.queueCampaigns={rows:[],count:0},d.success=c,d.getScheduledCalls=function(){if(d.pickerModel.dateStart){var e=moment(d.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();d.query.scheduledat={$gte:d.pickerModel.dateStart,$lte:e}}else d.query.createdAt=void 0;d.query.id=d.currentUser.id,d.query.includeAll=!0,d.query.offset=(d.query.page-1)*d.query.limit,t.localStorage.setItem("motion2.home.scheduled:"+d.currentUser.id,JSON.stringify({query:d.query})),d.promise=o.user.getScheduledCalls(d.query,c).$promise},d.onInit=function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+d.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(d.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){d.queueCampaigns=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){d.getScheduledCalls()})},d.clearAll=function(){d.pickerModel={dateStart:null},d.getScheduledCalls()},d.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},d.createOrEditQueueCampaignHopper=function(e,t){a.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:t,hoppers:d.scheduledCalls.rows,license:null,setting:null}})},d.deleteConfirm=function(t,e){var n=a.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){var e;e=t,o.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(d.scheduledCalls.rows,{id:e.id}),d.scheduledCalls.count-=1,d.scheduledCalls.rows.length||d.getScheduledCalls(),s.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var m=!0,u=1;e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=u),d.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.smsInteractions=e||{count:0,rows:[]};for(var t=0;t<m.smsInteractions.rows.length;t+=1)g(m.smsInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.smsAccounts.rows.length?(_.includes(_.map(m.smsAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.SmsAccountId=m.query.account||_.map(m.smsAccounts.rows,"id").join()):m.query.SmsAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.smsInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getSmsInteractions=p,m.showSmsInteraction=function(e,t){n.$parent.vm.addInteractionTab("sms",t)},m.downloadSmsInteraction=function(e,s,t){l.smsInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="sms-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.mobile||"unknown")+">"}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getSmsInteractions()},m.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.smsAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("smsAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("smsInteraction:save",m.onSmsInteractionSave),d.on("smsInteraction:update",m.onSmsInteractionSave),d.on("smsInteractionTags:save",m.onSmsInteractionTagsSave),d.on("smsMessage:save",m.onSmsMessageSave),d.on("smsMessage:update",m.onSmsMessageSave),d.on("user_has_sms_interactions:save",m.onSmsInteractionOpen),d.on("user_has_sms_interactions:remove",m.onSmsInteractionClose),m.getSmsInteractions()})},m.onSmsInteractionSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onSmsInteractionTagsSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onSmsMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onSmsInteractionOpen=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onSmsInteractionClose=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getSmsInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(t,n,a,i,e,s,o,r,l,d){var c=this;function m(e){c.voiceCalls=e||{count:0,rows:[]}}c.currentUser=e.getCurrentUser(),c.voiceCalls={},c.localizationMap=d,c.pickerModel={dateStart:null},c.table="voiceCalls",c.query={UserId:c.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},c.success=m,c.getVoiceCalls=function(){if(c.pickerModel.dateStart){var e=moment(c.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();c.query.createdAt={$gte:c.pickerModel.dateStart,$lte:e}}else c.query.createdAt=void 0;c.query.offset=(c.query.page-1)*c.query.limit,o.localStorage.setItem("motion2.home.voice:"+c.currentUser.id,JSON.stringify({query:c.query})),c.promise=a.voiceCallReport.get(c.query,m).$promise},c.onInit=function(){return a.tag.get().$promise.then(function(e){c.tags=e||{count:0,rows:[]}}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),c.tags={count:0,rows:[]}}).finally(function(){var e=o.localStorage.getItem("motion2.home.voice:"+c.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}c.getVoiceCalls()})},c.showDetails=function(e){t.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{call:e}})},c.clearAll=function(){c.pickerModel={dateStart:null},c.getVoiceCalls()};var u=!0,p=1;r.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getVoiceCalls())})}e.$inject=["$mdDialog","$document","api","toasty","Auth","$translate","$window","$scope","$timeout","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,t){this.call=t,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this,g=25,v=1024*g*1024;function h(){i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{user:p.user,channel:p.tab.channel,interaction:p.tab.interaction}}).then(function(e){p.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(p.tab)})}function f(e,t){p.tab.message||(p.tab.message=t),i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:p.tab.message,type:e,interaction:p.interaction},fullscreen:!0,skipHide:Boolean(p.tab.spy)}).then(function(t){t&&E(t),t.Interaction&&p.interaction&&p.interaction.id&&(t.Interaction.id=p.interaction.id,l.mailInteraction.update(t.Interaction).$promise.then(function(e){e&&e.closed?(p.tab.saved=!0,p.interaction.closed=!0,p.interaction.closedAt=e.closedAt,h()):null!==t.Interaction.substatus&&(p.tab.saved=!0,p.tab.interaction.substatus=t.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(p.tab))}).catch(function(e){console.error(e)}))})}function b(){"mail"!==p.tab.channel&&t(function(){var e=angular.element(n.find("md-content[name*='interaction-content-"+p.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function E(n){if(n)return n["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"]=p.interaction["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"],n[_.capitalize(p.tab.channel)+"InteractionId"]=p.interaction.id,n.UserId=p.user.id,n.ContactId=p.interaction.ContactId,n.direction="out",n.secret=Boolean(p.tab.spy||n.secret),l[p.tab.channel+"Message"].save(n).$promise.then(function(e){if(e&&e.id&&n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)l.attachment.update({id:n.attachments[t].id},{MailMessageId:e.id})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){p.tab.areaText="",b()})}function A(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}function y(e){e&&e.count&&e.rows.length&&(p.journey=_.concat(p.journey,e.rows))}p.showFooter=!1,p.showInteraction=!1,p.user=c.getCurrentUser(),p.detectBrowser=u.detectBrowser(),p.journey=[],p.acceptedMessages=[],p.omniChannels=["mail","chat","sms","openchannel","fax"],p.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:v,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},p.ngFlow={flow:{}},p.selectedMailShowDetails={},p.selectedMailShowSystemMessage={},p.setting={},p.ctrlMethods={},p.init=function(e,t){p.tab=e,p.tab.saved=!0,p.tab.badges=0,p.setting=t||{},p.tab&&p.tab.channel&&p.tab.interaction&&(p.interaction=p.tab.interaction,l[p.tab.channel+"Interaction"].get({id:p.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(p.interaction=e,p.tab.interaction=e),p.tab.saved=p.interaction.closed,p.queryMessage={id:p.interaction.id,includeAll:!0},"mail"===p.tab.channel?(p.queryMessage.sort="-id",p.queryMessage.offset=0,p.queryMessage.limit=3):(p.queryMessage.sort="id",p.queryMessage.nolimit=!0),l[p.tab.channel+"Interaction"].getMessages(p.queryMessage).$promise}).then(function(e){return p.messages=e||{count:0,rows:[]},l["chat"===p.tab.channel?"chatWebsite":p.tab.channel+"Account"].get({id:p.interaction["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(p.account=e,p.tab.title=p.account.key||p.account.name,p.interaction.ContactId)return l.cmContact.get({id:p.interaction.ContactId}).$promise}).then(function(e){return e&&(p.contact=e),p.showInteraction=!0,p.contact?(!function(e){if(e&&e.id){for(var t=0;t<p.omniChannels.length;t++)l[p.omniChannels[t]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(y);l.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(y)}}(p.contact),p.tab.title+=" - "+p.contact.firstName):p.tab.title+=" - "+r.instant(p.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){p.users=e||{count:0,rows:[]},p.usersMap=_.mapValues(_.keyBy(p.users.rows,"id"),"fullname")}).then(function(){if(p.tab.channel&&p.interaction)return l.user["add"+_.upperFirst(p.tab.channel)+"Interactions"]({id:p.user.id,ids:[p.interaction.id]})}).then(function(){return l.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){p.subStatuses=e||{count:0,rows:[]}}).then(function(){return p.getMailAccounts()}).then(function(){return p.getFaxAccounts()}).then(function(){return p.getSmsAccounts()}).then(function(){return p.getOpenchannelAccounts()}).then(function(){return p.getChatWebsites()}).then(function(){return p.getLists()}).catch(function(e){console.error(e),p.showInteraction=!0}).finally(function(){!function(){if(!p.tab.spy&&!p.interaction.closed)for(var e=0;e<p.messages.rows.length;e+=1)"in"!==p.messages.rows[e].direction||p.messages.rows[e].read||(l[p.tab.channel+"Message"].accept({id:p.messages.rows[e].id,UserId:p.user.id}),p.acceptedMessages.push(p.messages.rows[e].id))}(),b(),m.on(p.tab.channel+"Message:save",p.onMessageSave),m.on(p.tab.channel+"Message:update",p.onMessageSave),m.on(p.tab.channel+"Interaction:save",p.onInteractionSave),m.on(p.tab.channel+"Interaction:update",p.onInteractionSave),m.on("user_has_"+p.tab.channel+"_interactions:save",p.onInteractionOpen),m.on("user_has_"+p.tab.channel+"_interactions:remove",p.onInteractionClose),p.tab.areaText=p.tab.areaText?p.tab.areaText:"",p.showFooter=!0}))},p.getLabelByMessage=function(e){var t="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":t:e.UserId?p.usersMap?p.usersMap[e.UserId]:t:"System"},p.openContact=function(e,t){try{p.tab&&!p.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(t||p.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},p.openInteraction=function(e,t){try{if(t.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},p.disposeInteraction=h,p.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,skipHide:Boolean(p.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{nolimit:!0,fields:"id,name,color"})}]},locals:{channel:p.tab.channel,interaction:p.tab.interaction}})},p.composeMailInteraction=function(t,e){if(e.inReplyTo){var n=_.find(p.messages.rows,{messageId:e.inReplyTo});if(!n)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){f(t,e&&e.count?e.rows[0]:void 0)}).catch(function(e){console.error(e),f(t,void 0)});f(t,n)}else f(t,e)},p.composeFaxInteraction=function(e){var t={to:[]};t.to.push(p.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:t,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:p.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},p.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:t,type:e},fullscreen:!0,skipHide:Boolean(p.tab.spy)}).then(function(e){e&&E(e)})},p.transferLastMessage=function(){if(p.interaction){var e=_.findLast(p.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,interaction:p.interaction,message:e,channel:p.tab.channel}}).then(function(e){p.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(p.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},p.downloadMessage=function(s,e){p.tab.channel&&s.id&&l[p.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=p.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.downloadInteraction=function(s,e){p.tab.channel&&s.id&&l[p.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var t=[e.buffer],n=p.tab.channel+"-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.getMailAccounts=function(){l.user.getMailAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.mailAccounts=e||{count:0,rows:[]}})},p.getFaxAccounts=function(){l.user.getFaxAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.faxAccounts=e||{count:0,rows:[]}})},p.getSmsAccounts=function(){l.user.getSmsAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.smsAccounts=e||{count:0,rows:[]}})},p.getOpenchannelAccounts=function(){l.user.getOpenchannelAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.openchannelAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.getChatWebsites=function(){l.user.getChatWebsites({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.chatAccounts=e||{count:0,rows:[]}})},p.getLists=function(){l.user.getLists({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.voiceAccounts=e||{count:0,rows:[]}})},p.reply=function(e,t){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===t.trim())return;E(function(e){var t={},n="chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId";t[n]=p.interaction[n].toString(),t[_.capitalize(p.tab.channel)+"InteractionId"]=p.interaction.id,"sms"===p.tab.channel&&(t.phone=p.interaction.phone);e&&(t.UserId=p.user.id,t.ContactId=p.interaction.ContactId,t.body=e,t.createdAt=Date.now());return t}(t.replace(/\n$/,"")))},p.upload=function(){p.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},p.ngFlow.flow.upload()},p.fileAdded=function(e){if(e.size>v)return d.error({title:"File too big",msg:"The max allowed size is "+g+"MB"}),!1;return!0},p.fileSuccess=function(e,t){var n=JSON.parse(t),a=n.name;"chat"===p.tab.channel&&(a='<a href="'+(p.account.remote?p.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+p.interaction.id+"/attachment_download?attachId="+n.id+"&token="+p.account.token+'" target="_self">'+n.name+"</a>");E({body:a,AttachmentId:n.id})},p.onMessageSave=function(e){if(e&&p.interaction.id!=e[_.capitalize(p.tab.channel)+"InteractionId"])return;var t=!1;p.messages?t=_.find(p.messages.rows,{id:e.id}):p.messages={rows:[],count:0};t?_.merge(t,e):("mail"===p.tab.channel?p.messages.rows.unshift(e):p.messages.rows.push(e),b())},p.onInteractionSave=function(e){if(e&&p.interaction.id!==e.id)return;e.closed&&(p.tab.saved=!0);_.merge(p.interaction,e)},p.searchTextChange=function(t){var n=s.defer(),a=[],e={},i="chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId";return e.filter=t,e[i]=p.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.user,account:p.account,interaction:p.interaction,contact:p.interaction&&p.interaction.Contact?p.interaction.Contact:{}};p.tab.areaText+=" "+e(n),p.ctrlMethods.setText(p.tab.areaText)}catch(e){p.tab.areaText+=" "+t.value,p.ctrlMethods.setText(p.tab.areaText)}p.selectedItem=null,p.changeDisplayCannedAnswerInputValue()}},p.getIconByChannel=function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}},p.getColorByChannel=A,p.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return A(t)},p.getMessagesAlignment=function(e){if(e.secret&&p.user.id!=e.UserId)return"in";switch(p.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},p.displayCannedAnswerInput=!1,p.changeDisplayCannedAnswerInputValue=function(){p.displayCannedAnswerInput=!p.displayCannedAnswerInput},p.setAs=function(e){p.tab.channel&&p.interaction&&p.interaction.id&&l[p.tab.channel+"Interaction"].update({id:p.interaction.id,substatus:e,substatusAt:Date.now()}).$promise.catch(function(e){console.error(e)})},p.markAsUnread=function(){if(p.tab.channel&&p.interaction&&p.interaction.id)if(p.acceptedMessages.length)for(var e=0;e<p.acceptedMessages.length;e+=1)l[p.tab.channel+"Message"].update({id:p.acceptedMessages[e],read:!1,UserId:null});else for(var t=0;t<p.messages.rows.length;t+=1)if("in"===p.messages.rows[t].direction){p.messages.rows[t].UserId===p.user.id?l[p.tab.channel+"Message"].update({id:p.messages.rows[t].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}p.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(p.tab)},p.isMyAccount=function(e){{if(e.FaxAccountId)return _.includes(_.map(p.faxAccounts?p.faxAccounts.rows:[],"id"),e.FaxAccountId);if(e.OpenchannelAccountId)return _.includes(_.map(p.openchannelAccounts?p.openchannelAccounts.rows:[],"id"),e.OpenchannelAccountId);if(e.SmsAccountId)return _.includes(_.map(p.smsAccounts?p.smsAccounts.rows:[],"id"),e.SmsAccountId);if(e.MailAccountId)return _.includes(_.map(p.mailAccounts?p.mailAccounts.rows:[],"id"),e.MailAccountId);if(e.ChatWebsiteId)return _.includes(_.map(p.chatAccounts?p.chatAccounts.rows:[],"id"),e.ChatWebsiteId);if(e.amaflags)return!0}return!1},p.getAttachments=function(t){return l.attachment.get({MailMessageId:t.id}).$promise.then(function(e){e&&e.rows&&(t.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var t=new Blob([e.buffer],{type:e.type}),n=document.createElement("a"),a=window.URL.createObjectURL(t);n.href=a,n.target="_self",n.download=i.name,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},p.onInteractionOpen=function(e){var t;p.interaction.id==e[_.upperFirst(p.tab.channel)+"InteractionId"]&&(p.interaction.Users&&(t=_.find(p.interaction.Users,{id:e.UserId})),t||p.interaction.Users.push({id:e.UserId}))},p.onInteractionClose=function(e){p.interaction.id==e[_.upperFirst(p.tab.channel)+"InteractionId"]&&p.interaction.Users&&_.remove(p.interaction.Users,{id:e.UserId})},p.loadNextPage=function(){var n=s.defer();if(p.queryMessage)return p.queryMessage.offset=p.messages.rows.length,l[p.tab.channel+"Interaction"].getMessages(p.queryMessage).$promise.then(function(e){for(var t=0;t<e.rows.length;t+=1)p.messages.rows.push(e.rows[t]),p.interaction.closed||"in"!==e.rows[t].direction||e.rows[t].read||(l[p.tab.channel+"Message"].accept({id:e.rows[t].id,UserId:p.user.id}),p.acceptedMessages.push(e.rows[t].id));return n.resolve(e)}).catch(function(e){return n.reject(e)});return n.reject()},p.timelineOptions={scrollEl:"#interaction-content"},a.$on("$destroy",function(){m.removeAllListeners(p.tab.channel+"Message:save"),m.removeAllListeners(p.tab.channel+"Message:update"),m.removeAllListeners(p.tab.channel+"Interaction:save"),m.removeAllListeners(p.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+p.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+p.tab.channel+"_interactions:remove")})}function t(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(n){n.updateView=function(){var e,t=_.replace(n.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');n.trustedHtml=a.trustAsHtml(t)},n.$watch("ngBindHtmlUnsafe",function(e,t){n.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils"],t.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",t).filter("getChannelByItem",function(){return function(e,t,n,a){for(var i=[],s=0;s<e.length;s+=1){var o=!0;switch(t){case"voice":o=Boolean(e[s].uniqueid);break;case"chat":o=Boolean(e[s].ChatWebsiteId);break;case"mail":o=Boolean(e[s].MailAccountId);break;case"sms":o=Boolean(e[s].SmsAccountId);break;case"fax":o=Boolean(e[s].FaxAccountId);break;case"openchannel":o=Boolean(e[s].OpenchannelAccountId);break;default:o=!0}o&&n&&a&&(o=moment(e[s].createdAt).isBetween(n,a)),o&&i.push(e[s])}return i}}).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,n.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,c.message.attachments.push(t)}catch(e){console.error(e)}},c.fileAdded=function(e){var t=["pdf","tif"];if(!_.includes(t,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+t.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var t="";e.firstName&&e.firstName!==e.fax&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(t+=e.lastName+" ");return t+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var t=e;if(_.isObject(e))return e.fax;if(n=t,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(n))return t;var n;return l.error("Fax "+t+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,n.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(t,e,i,n,s,o,a,r,l,d,c,m){var u=this,p=25,g=1024*p*1024;switch(u.currentUser=c.getCurrentUser(),u.secret="note"===a,u.hiddenCC=!0,u.hiddenBCC=!0,u.verifySmtp=!0,u.errors=[],u.separatorKeys=[n.KEY_CODE.ENTER,n.KEY_CODE.COMMA,n.KEY_CODE.TAB],u.searchTextChange=function(t){var n=d.defer(),a=[];return r.cannedAnswer.get({filter:t,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),r.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},u.selectedItemChange=function(t){if(t&&t.value&&u.ckEditorInstance)try{var e=_.template(t.value),n={user:u.currentUser,account:s,interaction:m,contact:m&&m.Contact?m.Contact:{}};u.ckEditorInstance.insertHtml(e(n))}catch(e){console.error(e),u.ckEditorInstance.insertHtml(t.value)}document.getElementById("html-area").focus(),u.selectedItem=null},u.onReadyEditor=function(e){try{u.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,u.fromTemplate=_.template("{{ name }} <{{ email }}>"),u.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),u.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),u.message={from:u.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:f(),type:a,attachments:[],showLastMessage:!0},u.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:u.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"},u.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:g,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},u.ngFlow={flow:{}},u.reply=function(e){angular.isDefined(o)&&(u.message.type="reply",u.message.to="in"===o.direction?o.from.split(","):o.to.split(","),u.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,u.message.inReplyTo=o.messageId,u.message.body=o.draft&&o.draft.inReplyTo?o.draft.body:f(),u.message.attachments=o.draft?o.draft.attachments:[],e&&o.cc&&(u.hiddenCC=!1,u.message.cc=o.cc.split(",")),u.message.showLastMessage=!!o.draft&&o.draft.showLastMessage)},u.newMail=function(){angular.isDefined(o)&&(u.message.type="new",u.message.to=o.to?o.to.split(","):[])},u.forward=function(){if(angular.isDefined(o)){if(u.message.type="forward",u.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,u.message.body=o.draft&&!o.draft.inReplyTo?o.draft.body:f(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)u.message.attachments.push(o.Attachments[e]);u.message.showLastMessage=!!o.draft&&o.draft.showLastMessage}},u.send=function(e,t,n){if(u.message.to&&u.message.body)if(u.message.to.length)if(o.draft=void 0,_.isEmpty(u.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){v(t,n)})}else v(t,n);else l.error("To is mandatory")},u.note=function(){u.type="note",u.secret=!0,u.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'px"><p></p></div>'},u.addNote=function(){u.message.body&&(u.message.draft=void 0,i.hide({secret:!0,body:u.message.body,attach:u.message.attachments.length,attachments:u.message.attachments}))},u.upload=function(e){u.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+t.get("motion.token")},u.ngFlow.flow.upload()},u.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,u.message.attachments.push(t)}catch(e){console.error(e)}},u.deleteAttachment=function(e){u.message.attachments=_.reject(u.message.attachments,{id:e.id}),r.attachment.delete({id:e.id}).$promise.then(function(){l.success({title:"Attachment deleted!",msg:e.name?e.name+" has been deleted!":""})})},u.fileAdded=function(e){if(e.size>g)return l.error({title:"File too big",msg:"The max allowed size is "+p+"MB"}),!1;return!0},u.getContact=function(e){var t="";e.firstName&&e.firstName!==e.email&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(t+=e.lastName+" ");return t+="<"+e.email+">"},u.contactSearch=function(e){return s&&s.ListId?r.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},u.transformContact=function(e,t){if(_.isObject(e))return e.email;if(_.isString(e)){if(h(e))return e;for(var n=e.split(","),a=0;a<n.length;a+=1)h(n[a])?_.isArray(t)&&_.indexOf(t,n[a])<0&&t.push(n[a]):l.error("Email "+n[a]+" is not valid");return null}return l.error("Email field is not valid"),null},u.closeDialog=function(){angular.isDefined(o)&&(o.draft=u.message);i.cancel()},u.loadLastMessage=function(){u.message.body+=b(u.message.type)},a){case"reply":u.reply(!1);break;case"replyAll":u.reply(!0);break;case"forward":u.forward();break;case"new":u.newMail();break;case"note":u.note()}function v(e,t){var n={from:u.message.from,to:u.message.to.join(","),cc:u.message.cc.join(","),bcc:u.message.bcc.join(","),subject:u.message.subject,body:u.message.showLastMessage?u.message.body:u.message.body+b(u.message.type),inReplyTo:u.message.inReplyTo,attach:u.message.attachments.length,attachments:u.message.attachments,Interaction:{lastMsgAt:moment().format("YYYY-MM-DD HH:mm:ss"),lastMsgDirection:"out",lastMsgBody:u.message.body,substatus:t,substatusAt:moment().format("YYYY-MM-DD HH:mm:ss")}};n.html='<div id="xm-mail-content">'+_.replace(n.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(n.Interaction.closed=!0,n.Interaction.closedAt=moment().format("YYYY-MM-DD HH:mm:ss")),i.hide(n)}function h(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function f(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'px">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:u.currentUser,account:s,interaction:m,contact:m&&m.Contact?m.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function b(e){var t,n,a='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":a+=u.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":a+=u.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}return a+="<br><br>",a+=(t=o.body?_.replace(o.body,'<div id="xm-mail-content"',"<div"):"",(n=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?n[1]:t),a+="</blockquote></div>",e?a:""}r.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){u.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),u.secret||r.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){u.verifySmtp=!1,u.errors.push({message:e.data,type:e.status}),u.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","Auth","interaction"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.currentUser,account:s};p.message.body+=" "+e(n),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+t.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(t=p.message.body,a.hide({to:p.message.to.join(","),body:t})):d.error("To is mandatory"));var t},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e[s.mapKey]&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(t+=e.lastName+" ");return t+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var t="firstName,lastName,phone,mobile";return s.mapKey&&(t+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:t}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var t=e;if(_.isObject(t))return e[s.mapKey];return t},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.currentUser,account:s};p.message.body+=" "+e(n),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+t.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(t=p.message.body,a.hide({to:p.message.to.join(","),body:t})):d.error("To is mandatory"));var t},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e.mobile&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(t+=e.lastName+" ");return t+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var t=e;if(_.isObject(t))return e.mobile;if(n=t,/^(\+|\d)[0-9]{7,16}$/.test(n))return t;var n;return d.error("Mobile "+t+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(t,n,a,i,s,o){var r=this;function l(){r.mandatoryDisposition&&a.user.pause({id:o.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})}function d(e){r.mandatoryDisposition&&a.user.unpause({id:o.id}).$promise.catch(function(e){console.error(e)}),t.hide(e)}r.errors=[],r.interaction=angular.copy(i),r.dispositions={count:0,rows:[]},r.globalDispositions={count:0,rows:[]},r.channel=s,r.interactionMethod=r.channel+"Interaction",r.interaction.disposition||(r.interaction.disposition=null),r.mandatoryDisposition=!0,r.mandatoryDispositionPause="",r.saveDisposition=function(e){r.errors=[],r.interaction.closed||(r.interaction.closedAt=Date.now());r.interaction.UserId=o.id,r.interaction.closed=!0,r.interaction.closeReason="agent",a[r.interactionMethod]?a[r.interactionMethod].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","ChatWebsiteId","OpenchannelId","closed","closedAt","closeReason","disposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,n.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){d(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):d(!1)},r.closeDialog=d,function(){var e={fields:"id,name",sort:"name",nolimit:!0};switch(s){case"chat":e.ChatWebsiteId=i.ChatWebsiteId,a.chatWebsite.get({id:i.ChatWebsiteId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"mail":e[t=_.capitalize(s)+"AccountId"]=i[t],a.mailAccount.get({id:i.MailAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"sms":e[t=_.capitalize(s)+"AccountId"]=i[t],a.smsAccount.get({id:i.SmsAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"fax":e[t=_.capitalize(s)+"AccountId"]=i[t],a.faxAccount.get({id:i.FaxAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"openchannel":var t;e[t=_.capitalize(s)+"AccountId"]=i[t],a.faxAccount.get({id:i.OpenchannelAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()})}a.disposition.get(e).$promise.then(function(e){r.dispositions=e}).catch(function(e){console.error(e)}),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null"}).$promise.then(function(e){r.globalDispositions=e}).catch(function(e){console.error(e)})}()}e.$inject=["$mdDialog","toasty","api","interaction","channel","user"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i,s){var o=this;function r(e){t.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.interactionMethod])return e[o.interactionMethod].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){n.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.interactionMethod=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=n.getCurrentUser(),l.channel=s.toLowerCase(),l.message=o,l.account=r,l.transfer={id:0,type:"queue"},l.agents=l.queues={count:0,rows:[]},l.queueMethod=l.channel+"Queue",l.queueNotifyMethod=l.channel+"QueueNotify",l.onTransfer=function(){d(!0),e(function(){return a.rpc["agent"===l.transfer.type?"agentNotify":l.queueNotifyMethod]({id:l.transfer.id,messageId:l.message.id,channel:l.channel}).$promise.then(function(e){i.success({title:"Trasfer properly done!",msg:"Transfer "+l.transfer.type+" has been done!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},l.closeDialog=d,l.init=function(){return a.user.get({fields:"id,name",role:"agent",nolimit:!0}).$promise.then(function(e){return l.agents=e||{count:0,rows:[]},a[l.queueMethod].get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){l.queues=e||{count:0,rows:[]}}).catch(function(e){console.error(e)})},l.init()}e.$inject=["$mdDialog","$timeout","Auth","api","toasty","channel","message","account"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,s,o,e,l,d,t,n,a,r,c){var m=this;function u(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){d.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function p(n,e){var r=t.getCurrentUser();l.jscriptySessionReport.save({starttime:m.starttime,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,VoiceQueueId:m.call&&m.call["xmd-voicequeueid"]?m.call["xmd-voicequeueid"]:void 0,ProjectId:m.project&&m.project.id?m.project.id:void 0,projectname:m.project&&m.project.name?m.project.name:void 0,ContactId:m.contact&&m.contact.id?m.contact.id:void 0,completed:e}).$promise.then(function(e){if(e)for(var t=m.getResponseSheetHeaders(),n=m.getResponseSheetRow(),a=m.getQuestionWithResponseList(),i=0;i<t.length;i+=1)if(!_.isEmpty(n[i])){l.jscriptyQuestionReport.save({question:t[i],answer:n[i],questionId:a[i].id,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name});for(var s=n[i].toString().split(";"),o=0;o<s.length;o+=1)l.jscriptyAnswerReport.save({question:t[i],questionId:a[i].id,answer:s[o].trim(),membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name})}return e}).then(function(e){e?n.resolve(!0):n.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});n.reject()})}m.formViewer={},m.showResetButton=!0,m.showIncompleteSubmitButton=!1,m.detectBrowser=c.detectBrowser(),m.onSubmit=function(e,t){var n=s.defer();if(t){var a=o.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");o.show(a).then(function(){p(n,!1)},function(){n.resolve()})}else p(n,!0);return n.promise.then(function(e){e&&(d.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){d.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(m.tab))}).catch(function(e){d.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},m.openContact=function(e,t){try{i.$parent.$parent.$parent.vm.addContactTab(t)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},m.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},m.getResponseSheet=function(){return e.getResponseSheet(m.project.formData,m.project.responseData,!1)},m.getResponseSheetRow=function(){return e.getResponseSheetRow(m.project.formData,m.project.responseData)},m.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(m.project.formData,!1)},m.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(m.project.formData,m.project.responseData)},m.init=function(e){m.tab=e,m.tab&&(m.call=m.tab.call,m.starttime=m.tab.openedAt,m.contact=m.tab.contact,m.project=m.tab.project,m.project&&(_.isObjectLike(m.project.formData)?m.project.formData=m.project.formData:m.isJsonString(m.project.formData)?m.project.formData=JSON.parse(m.project.formData):m.project.formData=void 0,m.project.responseData=m.project.responseData||{},void 0!==m.project.currentPage&&r(function(){a.$broadcast("mwForm.pageEvents.changePage",{page:m.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&(m.project.currentPage=t.currentPage.number-1,u(),m.project.enableUncompleteSave&&(1<=t.currentPage.number&&t.currentPage.number<m.project.formData.pages.length?m.showIncompleteSubmitButton=!0:m.showIncompleteSubmitButton=!1),m.project.formData&&m.project.formData.pages))for(var n=0,a=m.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&m.project.formData.pages[n].elements)for(var i=0,s=m.project.formData.pages[n].elements.length;i<s;i++)"question"===m.project.formData.pages[n].elements[i].type&&m.project.formData.pages[n].elements[i].question&&delete m.project.responseData[m.project.formData.pages[n].elements[i].question.id]})))},m.resetViewer=function(e){if(m.formViewer.reset){var t=o.confirm().title(n.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(n.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(n.instant("JSCRIPTY.YES")).cancel(n.instant("JSCRIPTY.NO"));o.show(t).then(function(){m.showIncompleteSubmitButton=!1,m.project.currentPage=void 0,u(),m.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(n,a,e,t,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:n.instant("DASHBOARDS.ATTENTION"),msg:n.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(t[s.notification.channel+"Message"])return t[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(t[s.notification.channel+"Message"])return t[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var t=this;t.init=function(e){t.tab=e,t.tab&&(t.tab.saved=!0,t.html=t.tab.html)}})}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:e.ChatWebsiteId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("chatInteraction:save",i.onSaveChatInteraction),t.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("chatInteraction:save"),t.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},n.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=t(function(){d(),c()},999),n.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){n.removeAllListeners("voice_queue:save"),n.removeAllListeners("campaign:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:e.FaxAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("faxInteraction:save",i.onSaveFaxInteraction),t.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("faxInteraction:save"),t.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:e.MailAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("mailInteraction:save",i.onSaveMailInteraction),t.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("mailInteraction:save"),t.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:e.OpenchannelAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),t.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("openchannelInteraction:save"),t.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:e.SmsAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("smsInteraction:save",i.onSaveSmsInteraction),t.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("smsInteraction:save"),t.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(n){var i=[],s=function(){var n=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(n.queues,function(e,t){n.rpcQueues[t]&&(a.waiting+=n.rpcQueues[t].waiting||0,a.talking+=(n.rpcQueues[t].talking||0)+(n.rpcQueues[t].pTalking||0),a.answered+=n.rpcQueues[t].answered||0,a.abandoned+=n.rpcQueues[t].abandoned||0,a.sumHoldTime+=n.rpcQueues[t].sumHoldTime||0,a.sumBillable+=n.rpcQueues[t].sumBillable||0,a.total+=n.rpcQueues[t].total||0,a.originated+=n.rpcQueues[t].originated||0,a.outboundDropCallsDayCallersExit+=n.rpcQueues[t].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=n.rpcQueues[t].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),n.defer.resolve(a),0<i.length&&s()};return function(e){var t=n.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:t}),1===i.length&&s(),t.promise}}function t(n){var i=[],s=function(){var n=i[0],a={originated:0,limitCalls:0};_.forIn(n.rpcCampaigns,function(e,t){n.rpcCampaigns[t]&&(a.originated+=n.rpcCampaigns[t].originated||0,a.limitCalls+=n.rpcCampaigns[t].limitCalls||0)}),i.shift(),n.defer.resolve(a),0<i.length&&s()};return function(e){var t=n.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:t}),1===i.length&&s(),t.promise}}function n(e,o,t,n){var r=this;r.hasPermission=function(){return t.hasPermission(101)||t.hasRole("admin")},r.license=n,e.$on("$stateChangeSuccess",function(e,t,n,a,i){var s=[];r.license.voice&&s.push("app.dashboards.general.voice"),r.license.dialer&&s.push("app.dashboards.general.dialer"),r.license.chat&&s.push("app.dashboards.general.chat"),r.license.mail&&s.push("app.dashboards.general.mail"),r.license.messaging&&s.push("app.dashboards.general.sms"),r.license.openchannel&&s.push("app.dashboards.general.openchannel"),r.license.fax&&s.push("app.dashboards.general.fax"),r.selectedTab=_.indexOf(s,t.name),r.selectedTab<0&&(r.selectedTab=0)<s.length&&o.go(_.first(s))})}e.$inject=["$q"],t.$inject=["$q"],n.$inject=["$scope","$state","Auth","license"],angular.module("app.dashboards").filter("secToTime",function(){return function(e){return new Date(1e3*e).toISOString().substr(11,8)}}).factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",t).controller("UserDashboardGeneralController",n)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=n?_.keyBy(n.rows?n.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},t.on("voice_queue:save",o.onSaveQueue),t.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){t.removeAllListeners("voice_queue:save"),t.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),t.params.id&&(g.faxAccount.FaxAccountId=t.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var t=_.find(g.faxAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),n=null;if(g.faxAccount&&(n=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.trunks,{id:n.id});a.canSelect=!1,t.push(a)}g.trunks=t})}else{var n=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,n.push(g.trunks[i]));g.trunks=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.faxAccount&&(n=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:n,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[t]=e:r.faxAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.faxAccountApps.rows.length;n++,0){var a=r.faxAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.faxAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,n).$promise},r.editFaxAccountApp=t,r.editInterval=function(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("fax")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountFaxDispositions={count:0,rows:[]},c.selectedFaxAccountFaxDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.faxAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.faxAccount.id,c.query.FaxAccountId=c.faxAccount.id,c.getFaxAccountFaxDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the faxDisposition?").htmlContent("<b>"+(e.name||"faxDisposition")+"</b> will be deleted.").ariaLabel("delete faxDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountFaxDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getDispositions(c.query,p).$promise},c.createOrEditFaxAccountFaxDisposition=function(e,t){s.show({controller:"CreateOrEditFaxDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,faxDisposition:t,faxDispositions:c.faxAccountFaxDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedFaxAccountFaxDispositions=function(){var e=angular.copy(c.selectedFaxAccountFaxDispositions);return c.selectedFaxAccountFaxDispositions=[],e},c.deleteFaxAccountFaxDisposition=g,c.deleteSelectedFaxAccountFaxDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected faxDispositions?").htmlContent("<b>"+c.selectedFaxAccountFaxDispositions.length+" selected</b> will be deleted.").ariaLabel("delete faxDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedFaxAccountFaxDispositions.forEach(function(e){g(e)}),c.selectedFaxAccountFaxDispositions=[]})};var m=!0,u=1;function p(e){c.faxAccountFaxDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountFaxDispositions.rows,{id:e.id}),c.faxAccountFaxDispositions.count-=1,c.faxAccountFaxDispositions.rows.length||c.getFaxAccountFaxDispositions(),r.success({title:"FaxDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountFaxDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountFaxDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXDISPOSITION",g.faxDisposition=angular.copy(l),g.faxDispositions=r,g.newFaxDisposition=!1,g.faxDisposition||(g.faxDisposition={},g.title="FAX.NEW_FAXDISPOSITION",g.newFaxDisposition=!0),t.params.id&&(g.faxDisposition.FaxAccountId=t.params.id),g.addNewFaxDisposition=function(){g.errors=[],d.disposition.save(g.faxDisposition).$promise.then(function(e){g.faxDispositions.unshift(e.toJSON()),o.success({title:"FaxDisposition properly created",msg:g.faxDisposition.name?g.faxDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxDisposition=function(){g.errors=[],d.disposition.update({id:g.faxDisposition.id},g.faxDisposition).$promise.then(function(e){var t=_.find(g.faxDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxDisposition properly saved!",msg:g.faxDisposition.name?g.faxDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxDisposition will be deleted.").ariaLabel("Delete FaxDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.faxDisposition.id}).$promise.then(function(){_.remove(g.faxDispositions,{id:g.faxDisposition.id}),o.success({title:"FaxDisposition properly deleted!",msg:(g.faxDisposition.name||"faxDisposition")+" has been deleted!"}),v(g.faxDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxDispositions","faxDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxDispositionDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountInteractions={count:0,rows:[]},c.selectedFaxAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,FaxAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.faxAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.faxAccount.id,c.getFaxAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.faxInteractionDownload=function(s,e,t){return l.faxInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getFaxAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getInteractions(c.query,p).$promise},c.createOrEditFaxAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,interaction:t,interactions:c.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spyfaxInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"fax",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(c.selectedFaxAccountInteractions);return c.selectedFaxAccountInteractions=[],e},c.deleteFaxAccountInteraction=g,c.deleteSelectedFaxAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedFaxAccountInteractions.forEach(function(e){g(e)}),c.selectedFaxAccountInteractions=[]})};var m=!0,u=1;function p(e){c.faxAccountInteractions=e||{count:0,rows:[]}}function g(e){l.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountInteractions.rows,{id:e.id}),c.faxAccountInteractions.count-=1,c.faxAccountInteractions.rows.length||c.getFaxAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.faxAccount=c||n.params.faxAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.accounts",{})}},u.agentadddialog=function(e,t){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:u.faxAccounts?u.faxAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxAccounts=function(){n.go("app.fax.faxAccounts")},u.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(u.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:u.faxAccount.name?u.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),n=null;if(u.faxAccount&&(n=_.find(u.trunks,{id:Number(u.faxAccount.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.trunks,{id:n.id});a.canSelect=!1,t.push(a)}u.trunks=t})}else{var n=[],a=null;u.faxAccount&&(a=_.find(u.trunks,{id:Number(u.faxAccount.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,n.push(u.trunks[i]));u.trunks=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.faxAccount&&(n=_.find(u.lists,{id:Number(u.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.faxAccount&&(a=_.find(u.lists,{id:Number(u.faxAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.faxAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="faxAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedFaxAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.accounts",{})}},b.agentadddialog=function(e,t){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:b.faxAccounts?b.faxAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getFaxAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.faxAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FaxAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFaxAccount=function(e,t){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:t,faxAccounts:b.faxAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFaxAccount=S,b.exportSelectedFaxAccounts=function(){var e=angular.copy(b.selectedFaxAccounts);return b.selectedFaxAccounts=[],e},b.deleteSelectedFaxAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+b.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFaxAccounts.forEach(function(e){S(e)}),b.selectedFaxAccounts=[]})},b.deselectFaxAccounts=function(){b.selectedFaxAccounts=[]},b.selectAllFaxAccounts=function(){b.selectedFaxAccounts=b.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})}),a=null;a=[],b.faxAccounts.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.trunks,{id:e.id});t.canSelect=!1,n.push(t)}}),b.trunks=n})}else{var n=[],a=[];b.faxAccounts.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)});for(var i=0;i<b.trunks.length;i++){_.some(a,{id:b.trunks[i].id})&&(b.trunks[i].canSelect=!1,n.push(b.trunks[i]))}b.trunks=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.faxAccount&&(n=_.find(b.lists,{id:Number(b.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.faxAccount&&(a=_.find(b.lists,{id:Number(b.faxAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.faxAccounts=e||{count:0,rows:[]}}function S(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.faxAccounts.rows,{id:e.id}),b.faxAccounts.count-=1,b.faxAccounts.rows.length||b.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXQUEUE",g.faxQueue=angular.copy(l),g.faxQueues=r,g.newFaxQueue=!1,g.faxQueue||(g.faxQueue={strategy:"beepall",timeout:10},g.title="FAX.NEW_FAXQUEUE",g.newFaxQueue=!0),g.addNewFaxQueue=function(){g.errors=[],d.faxQueue.save(g.faxQueue).$promise.then(function(e){g.faxQueues.unshift(e.toJSON()),o.success({title:"FaxQueue properly created",msg:g.faxQueue.name?g.faxQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxQueue=function(){g.errors=[],d.faxQueue.update({id:g.faxQueue.id},g.faxQueue).$promise.then(function(e){var t=_.find(g.faxQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxQueue properly saved!",msg:g.faxQueue.name?g.faxQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.faxQueue.delete({id:g.faxQueue.id}).$promise.then(function(){_.remove(g.faxQueues,{id:g.faxQueue.id}),o.success({title:"FaxQueue properly deleted!",msg:(g.faxQueue.name||"faxQueue")+" has been deleted!"}),v(g.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxQueues","faxQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("FAX.ALL_TEAMS"),labelSelected:n.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues")},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.faxQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="faxQueues",b.listOrder="",b.listOrderAsc=null,b.selectedFaxQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:b.faxQueues?b.faxQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:b.faxQueues?b.faxQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.queues",{})}},b.success=y,b.getFaxQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.faxQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FaxQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFaxQueue=function(e,t){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:b.faxQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFaxQueue=S,b.exportSelectedFaxQueues=function(){var e=angular.copy(b.selectedFaxQueues);return b.selectedFaxQueues=[],e},b.deleteSelectedFaxQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+b.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFaxQueues.forEach(function(e){S(e)}),b.selectedFaxQueues=[]})},b.deselectFaxQueues=function(){b.selectedFaxQueues=[]},b.selectAllFaxQueues=function(){b.selectedFaxQueues=b.faxQueues.rows};var E=!0,A=1;function y(e){b.faxQueues=e||{count:0,rows:[]}}function S(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.faxQueues.rows,{id:e.id}),b.faxQueues.count-=1,b.faxQueues.rows.length||b.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.faxAccounts,function(e,t){p.rpcFaxAccounts[t]&&_.merge(e,p.rpcFaxAccounts[t])}),_.forIn(p.faxAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};s.faxAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",s.faxAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getFaxAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.faxAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="FaxAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.faxAccounts[e.id]&&_.merge(p.faxAccounts[e.id],e)},p.onFaxMessageSave=function(e){p.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(p.faxAccounts[e.FaxAccountId].in+=1,p.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(p.faxAccounts[e.FaxAccountId].out+=1,p.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},p.goToFaxAccount=function(e,t){i.go("app.fax.faxAccounts.edit",{id:t.id,faxAccount:t})},p.order=[],_.forIn(p.faxAccounts,function(e,t){p.order.push(e.id)}),o.on("faxAccount:save",p.onSave),o.on("faxAccount:update",p.onSave),o.on("faxMessage:save",p.onFaxMessageSave);var v=!0,h=1;function f(e){if(p.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var t=0;t<e.rows.length;t++)p.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getFaxAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("faxAccount:save"),o.removeAllListeners("faxAccount:update"),o.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"fax",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsFaxRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.faxQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].FaxQueueId].paused++,g.queues[e[t].rows[n].FaxQueueId].loggedInDb++,g.queues[e[t].rows[n].FaxQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].FaxQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.faxQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="FaxQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditFaxQueue=function(e,t){a.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.faxQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.FaxQueueId]&&g.queues[e.FaxQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.FaxQueueId]&&g.queues[e.FaxQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.FaxQueueId]&&(g.queues[e.FaxQueueId].loggedInDb+=1,g.queues[e.FaxQueueId].agents[e.UserId]=e.FaxQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.FaxQueueId]&&0<g.queues[e.FaxQueueId].loggedInDb&&(g.queues[e.FaxQueueId].loggedInDb-=1,delete g.queues[e.FaxQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("fax_queue:save",g.onSave),d.on("userFaxQueue:save",g.onSaveMember),d.on("userFaxQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("fax_queue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,n.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.fax.realtime.agents");break;case 1:n.go("app.fax.realtime.trunks");break;case 2:n.go("app.fax.realtime.queues");break;case 3:n.go("app.fax.realtime.accounts");break;default:n.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,t=0;t<u.trunks.length;t+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[t].id]))&&_.merge(u.trunks[t],_.pick(u.rpcTrunks[e],p))}function v(e,t,n){0<=t&&_.merge(e[t],_.pick(n,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},u.onSave=function(e){var t=_.findIndex(u.trunks,["id",e.id]),n=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,t,e),v(u.rpcTrunks,n,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,t){this.info=e,this.license=t}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var t=_.find(g.deskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.deskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="deskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedDeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intDeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="DeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDeskAccount=function(e,t){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:t,deskAccounts:b.deskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDeskAccount=S,b.exportSelectedDeskAccounts=function(){var e=angular.copy(b.selectedDeskAccounts);return b.selectedDeskAccounts=[],e},b.deleteSelectedDeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+b.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDeskAccounts.forEach(function(e){S(e)}),b.selectedDeskAccounts=[]})},b.deselectDeskAccounts=function(){b.selectedDeskAccounts=[]},b.selectAllDeskAccounts=function(){b.selectedDeskAccounts=b.deskAccounts.rows};var E=!0,A=1;function y(e){b.deskAccounts=e||{count:0,rows:[]}}function S(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.deskAccounts.rows,{id:e.id}),b.deskAccounts.count-=1,b.deskAccounts.rows.length||b.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.deskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,t){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(t.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"DeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.deskConfiguration.id},o.deskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:t.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts")},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",g.dynamics365Account=angular.copy(l),g.dynamics365Accounts=r,g.newDynamics365Account=!1,g.dynamics365Account||(g.dynamics365Account={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",g.newDynamics365Account=!0),g.addNewDynamics365Account=function(){g.errors=[],d.intDynamics365Account.save(g.dynamics365Account).$promise.then(function(e){g.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:g.dynamics365Account.name?g.dynamics365Account.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Account=function(){g.errors=[],d.intDynamics365Account.update({id:g.dynamics365Account.id},g.dynamics365Account).$promise.then(function(e){var t=_.find(g.dynamics365Accounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Dynamics365Account properly saved!",msg:g.dynamics365Account.name?g.dynamics365Account.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Account=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDynamics365Account.delete({id:g.dynamics365Account.id}).$promise.then(function(){_.remove(g.dynamics365Accounts,{id:g.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(g.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),v(g.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,t){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:t,dynamics365Accounts:b.dynamics365Accounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var E=!0,A=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){m.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),p.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,t){o.dynamics365Account=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,t){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,t){var n=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(t.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDynamics365Configuration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"Dynamics365Configuration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:t.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.dynamics365Account=c||e.params.dynamics365Account||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts")},u.saveDynamics365Account=function(){r.intDynamics365Account.update({id:u.dynamics365Account.id},u.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:u.dynamics365Account.name?u.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var t=_.find(g.freshdeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.freshdeskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,t){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(t.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intFreshdeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.freshdeskConfiguration.id},o.freshdeskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:t.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts")},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.freshdeskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="freshdeskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedFreshdeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getFreshdeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intFreshdeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FreshdeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFreshdeskAccount=function(e,t){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:t,freshdeskAccounts:b.freshdeskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFreshdeskAccount=S,b.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(b.selectedFreshdeskAccounts);return b.selectedFreshdeskAccounts=[],e},b.deleteSelectedFreshdeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+b.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFreshdeskAccounts.forEach(function(e){S(e)}),b.selectedFreshdeskAccounts=[]})},b.deselectFreshdeskAccounts=function(){b.selectedFreshdeskAccounts=[]},b.selectAllFreshdeskAccounts=function(){b.selectedFreshdeskAccounts=b.freshdeskAccounts.rows};var E=!0,A=1;function y(e){b.freshdeskAccounts=e||{count:0,rows:[]}}function S(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.freshdeskAccounts.rows,{id:e.id}),b.freshdeskAccounts.count-=1,b.freshdeskAccounts.rows.length||b.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var t=_.find(g.salesforceAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.salesforceAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,t){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(t.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSalesforceConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"SalesforceConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:t.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts")},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.salesforceAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="salesforceAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSalesforceAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSalesforceAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intSalesforceAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SalesforceAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSalesforceAccount=function(e,t){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:t,salesforceAccounts:b.salesforceAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSalesforceAccount=S,b.exportSelectedSalesforceAccounts=function(){var e=angular.copy(b.selectedSalesforceAccounts);return b.selectedSalesforceAccounts=[],e},b.deleteSelectedSalesforceAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+b.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSalesforceAccounts.forEach(function(e){S(e)}),b.selectedSalesforceAccounts=[]})},b.deselectSalesforceAccounts=function(){b.selectedSalesforceAccounts=[]},b.selectAllSalesforceAccounts=function(){b.selectedSalesforceAccounts=b.salesforceAccounts.rows};var E=!0,A=1;function y(e){b.salesforceAccounts=e||{count:0,rows:[]}}function S(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.salesforceAccounts.rows,{id:e.id}),b.salesforceAccounts.count-=1,b.salesforceAccounts.rows.length||b.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var t=_.find(g.servicenowAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.servicenowAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,t){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(t.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intServicenowConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"ServicenowConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.servicenowConfiguration.id},o.servicenowConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:t.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts")},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.servicenowAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="servicenowAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedServicenowAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getServicenowAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intServicenowAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ServicenowAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditServicenowAccount=function(e,t){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:t,servicenowAccounts:b.servicenowAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteServicenowAccount=S,b.exportSelectedServicenowAccounts=function(){var e=angular.copy(b.selectedServicenowAccounts);return b.selectedServicenowAccounts=[],e},b.deleteSelectedServicenowAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+b.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedServicenowAccounts.forEach(function(e){S(e)}),b.selectedServicenowAccounts=[]})},b.deselectServicenowAccounts=function(){b.selectedServicenowAccounts=[]},b.selectAllServicenowAccounts=function(){b.selectedServicenowAccounts=b.servicenowAccounts.rows};var E=!0,A=1;function y(e){b.servicenowAccounts=e||{count:0,rows:[]}}function S(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.servicenowAccounts.rows,{id:e.id}),b.servicenowAccounts.count-=1,b.servicenowAccounts.rows.length||b.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var t=_.find(g.sugarcrmAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.sugarcrmAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,t){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(t.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSugarcrmConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.sugarcrmConfiguration.id},o.sugarcrmConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:t.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts")},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.sugarcrmAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="sugarcrmAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSugarcrmAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSugarcrmAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intSugarcrmAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SugarcrmAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSugarcrmAccount=function(e,t){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:t,sugarcrmAccounts:b.sugarcrmAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSugarcrmAccount=S,b.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(b.selectedSugarcrmAccounts);return b.selectedSugarcrmAccounts=[],e},b.deleteSelectedSugarcrmAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+b.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSugarcrmAccounts.forEach(function(e){S(e)}),b.selectedSugarcrmAccounts=[]})},b.deselectSugarcrmAccounts=function(){b.selectedSugarcrmAccounts=[]},b.selectAllSugarcrmAccounts=function(){b.selectedSugarcrmAccounts=b.sugarcrmAccounts.rows};var E=!0,A=1;function y(e){b.sugarcrmAccounts=e||{count:0,rows:[]}}function S(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.sugarcrmAccounts.rows,{id:e.id}),b.sugarcrmAccounts.count-=1,b.sugarcrmAccounts.rows.length||b.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var t=_.find(g.vtigerAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.vtigerAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,t){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(t.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intVtigerConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"VtigerConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.vtigerConfiguration.id},o.vtigerConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:t.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts")},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.vtigerAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="vtigerAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedVtigerAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVtigerAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intVtigerAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VtigerAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVtigerAccount=function(e,t){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:t,vtigerAccounts:b.vtigerAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVtigerAccount=S,b.exportSelectedVtigerAccounts=function(){var e=angular.copy(b.selectedVtigerAccounts);return b.selectedVtigerAccounts=[],e},b.deleteSelectedVtigerAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+b.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVtigerAccounts.forEach(function(e){S(e)}),b.selectedVtigerAccounts=[]})},b.deselectVtigerAccounts=function(){b.selectedVtigerAccounts=[]},b.selectAllVtigerAccounts=function(){b.selectedVtigerAccounts=b.vtigerAccounts.rows};var E=!0,A=1;function y(e){b.vtigerAccounts=e||{count:0,rows:[]}}function S(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.vtigerAccounts.rows,{id:e.id}),b.vtigerAccounts.count-=1,b.vtigerAccounts.rows.length||b.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var t=_.find(g.zendeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts")},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.zendeskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,t){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:t,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(t.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZendeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:t.id}),s.success({title:"ZendeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.zendeskConfiguration.id},o.zendeskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:t.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var t=_.find(g.zendeskConfigurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.zendeskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="zendeskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedZendeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getZendeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intZendeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ZendeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditZendeskAccount=function(e,t){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:t,zendeskAccounts:b.zendeskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteZendeskAccount=S,b.exportSelectedZendeskAccounts=function(){var e=angular.copy(b.selectedZendeskAccounts);return b.selectedZendeskAccounts=[],e},b.deleteSelectedZendeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+b.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedZendeskAccounts.forEach(function(e){S(e)}),b.selectedZendeskAccounts=[]})},b.deselectZendeskAccounts=function(){b.selectedZendeskAccounts=[]},b.selectAllZendeskAccounts=function(){b.selectedZendeskAccounts=b.zendeskAccounts.rows};var E=!0,A=1;function y(e){b.zendeskAccounts=e||{count:0,rows:[]}}function S(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.zendeskAccounts.rows,{id:e.id}),b.zendeskAccounts.count-=1,b.zendeskAccounts.rows.length||b.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var t=_.find(g.zohoAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.zohoAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,t){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(t.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZohoConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"ZohoConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:t.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts")},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.zohoAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="zohoAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedZohoAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,page:1},b.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getZohoAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intZohoAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ZohoAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditZohoAccount=function(e,t){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:t,zohoAccounts:b.zohoAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteZohoAccount=S,b.exportSelectedZohoAccounts=function(){var e=angular.copy(b.selectedZohoAccounts);return b.selectedZohoAccounts=[],e},b.deleteSelectedZohoAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+b.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedZohoAccounts.forEach(function(e){S(e)}),b.selectedZohoAccounts=[]})},b.deselectZohoAccounts=function(){b.selectedZohoAccounts=[]},b.selectAllZohoAccounts=function(){b.selectedZohoAccounts=b.zohoAccounts.rows};var E=!0,A=1;function y(e){b.zohoAccounts=e||{count:0,rows:[]}}function S(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.zohoAccounts.rows,{id:e.id}),b.zohoAccounts.count-=1,b.zohoAccounts.rows.length||b.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var t=_.find(g.projects,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.project={},o.localizationMap=s;var r=new Date;r.setHours(0,0,0,0),o.pickerModel={dateStart:r,dateEnd:null,selectedTemplate:"TD"},o.init=function(e){o.project=e,o.getAnswers()},o.getSummary=function(){return a.jscriptyProject.getSummary({id:o.project.id,startTime:{$gte:o.pickerModel.dateStart,$lte:moment(o.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download","jscriptyProjectSummary_"+o.project.id+".csv"),a.click()}else i.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getAnswers=function(){return o.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:o.project.id,sort:"-createdAt,questionId",createdAt:{$gte:o.pickerModel.dateStart,$lte:moment(o.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){o.answers={};for(var t=0,n=e.count;t<n;t++)e.rows[t].questionId&&(o.hasIdAnswers=!0,o.answers.hasOwnProperty(e.rows[t].questionId)||(o.answers[e.rows[t].questionId]={question:e.rows[t].question,answers:{},sum:0}),""===e.rows[t].answer&&(e.rows[t].answer="NO_ANSWER"),o.answers[e.rows[t].questionId].answers[e.rows[t].answer]?o.answers[e.rows[t].questionId].answers[e.rows[t].answer]+=1:o.answers[e.rows[t].questionId].answers[e.rows[t].answer]=1,o.answers[e.rows[t].questionId].sum+=1)}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var t=this;t.project={},t.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},t.init=function(e){t.project=e,_.isObjectLike(e.formData)?t.project.formData=e.formData:t.isJsonString(e.formData)?t.project.formData=JSON.parse(e.formData):t.project.formData={}},t.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),n.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,t){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,t.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&o.project.formData&&o.project.formData.pages)for(var n=0,a=o.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&o.project.formData.pages[n].elements)for(var i=0,s=o.project.formData.pages[n].elements.length;i<s;i++)"question"===o.project.formData.pages[n].elements[i].type&&o.project.formData.pages[n].elements[i].question&&delete o.responseData[o.project.formData.pages[n].elements[i].question.id]})},o.onSubmit=function(e){var t=a.defer(),n=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(n).then(function(){t.resolve(!0)},function(){t.reject()}),t.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.project={},c.projectSessions={count:0,rows:[]},c.selectedProjectSessions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},c.init=function(e,t){c.project=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.project.id,c.getProjectSessions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getProjectSessions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.jscriptyProject.getSessions(c.query,p).$promise},c.createOrEditProjectSession=function(e,t){s.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:c.project,session:t,sessions:c.projectSessions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.showQuestionsProjectSession=function(e,n){s.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:n.id})}]},locals:{project:c.project,session:n}})},c.exportSelectedProjectSessions=function(){var e=angular.copy(c.selectedProjectSessions);return c.selectedProjectSessions=[],e},c.deleteProjectSession=g,c.deleteSelectedProjectSessions=function(e){var t=s.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+c.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedProjectSessions.forEach(function(e){g(e)}),c.selectedProjectSessions=[]})};var m=!0,u=1;function p(e){c.projectSessions=e||{count:0,rows:[]}}function g(e){l.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(c.projectSessions.rows,{id:e.id}),c.projectSessions.count-=1,c.projectSessions.rows.length||c.getProjectSessions(),r.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getProjectSessions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.project=c||e.params.project||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.clonedialog=function(e,t){n.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:u.projects?u.projects.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoProjects=function(){e.go("app.jscripty.projects")},u.saveProject=function(){r.jscriptyProject.update({id:u.project.id},u.project).$promise.then(function(){l.success({title:"Project updated!",msg:u.project.name?u.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.projects=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="projects",b.listOrder="",b.listOrderAsc=null,b.selectedProjects=[],b.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:b.projects?b.projects.rows:[],crudPermissions:b.crudPermissions}})},b.sessionsgoto=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,tab:3})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getProjects=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.jscriptyProject.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Projects",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditProject=function(e,t){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:b.projects.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteProject=S,b.exportSelectedProjects=function(){var e=angular.copy(b.selectedProjects);return b.selectedProjects=[],e},b.deleteSelectedProjects=function(e){var t=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+b.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedProjects.forEach(function(e){S(e)}),b.selectedProjects=[]})},b.deselectProjects=function(){b.selectedProjects=[]},b.selectAllProjects=function(){b.selectedProjects=b.projects.rows};var E=!0,A=1;function y(e){b.projects=e||{count:0,rows:[]}}function S(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(b.projects.rows,{id:e.id}),b.projects.count-=1,b.projects.rows.length||b.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILACCOUNT",g.mailAccount=angular.copy(l),g.mailAccounts=r,g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,cservice:"null",cauthentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="MAIL.NEW_MAILACCOUNT",g.newMailAccount=!0),t.params.id&&(g.mailAccount.MailAccountId=t.params.id),g.addNewMailAccount=function(){g.errors=[],d.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),o.success({title:"MailAccount properly created",msg:g.mailAccount.name?g.mailAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],d.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var t=_.find(g.mailAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailAccount properly saved!",msg:g.mailAccount.name?g.mailAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return o.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailAccount will be deleted.").ariaLabel("Delete MailAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),o.success({title:"MailAccount properly deleted!",msg:(g.mailAccount.name||"mailAccount")+" has been deleted!"}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.mailAccount&&(n=_.find(g.lists,{id:Number(g.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.mailAccount&&(a=_.find(g.lists,{id:Number(g.mailAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailAccounts","mailAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:n,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[t]=e:r.mailAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.mailAccountApps.rows.length;n++,0){var a=r.mailAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"html",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.mailAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,n).$promise},r.editMailAccountApp=t,r.editInterval=function(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("mail")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountInteractions={count:0,rows:[]},c.selectedMailAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,UserId,ContactId,MailAccountId,id,Contact.firstName,Owner.name,closedAt,disposition,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.getMailAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.mailInteractionDownload=function(s,e,t){return l.mailInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMailAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getInteractions(c.query,p).$promise},c.createOrEditMailAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,interaction:t,interactions:c.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spymailInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"mail",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedMailAccountInteractions=function(){var e=angular.copy(c.selectedMailAccountInteractions);return c.selectedMailAccountInteractions=[],e},c.deleteMailAccountInteraction=g,c.deleteSelectedMailAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountInteractions.forEach(function(e){g(e)}),c.selectedMailAccountInteractions=[]})};var m=!0,u=1;function p(e){c.mailAccountInteractions=e||{count:0,rows:[]}}function g(e){l.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountInteractions.rows,{id:e.id}),c.mailAccountInteractions.count-=1,c.mailAccountInteractions.rows.length||c.getMailAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailCannedAnswers={count:0,rows:[]},c.selectedMailAccountMailCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getAnswers(c.query,p).$promise},c.createOrEditMailAccountMailCannedAnswer=function(e,t){s.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailCannedAnswer:t,mailCannedAnswers:c.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(c.selectedMailAccountMailCannedAnswers);return c.selectedMailAccountMailCannedAnswers=[],e},c.deleteMailAccountMailCannedAnswer=g,c.deleteSelectedMailAccountMailCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+c.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),c.selectedMailAccountMailCannedAnswers=[]})};var m=!0,u=1;function p(e){c.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailCannedAnswers.rows,{id:e.id}),c.mailAccountMailCannedAnswers.count-=1,c.mailAccountMailCannedAnswers.rows.length||c.getMailAccountMailCannedAnswers(),r.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),t.params.id&&(g.mailCannedAnswer.MailAccountId=t.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var t=_.find(g.mailCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailDispositions={count:0,rows:[]},c.selectedMailAccountMailDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mailDisposition?").htmlContent("<b>"+(e.name||"mailDisposition")+"</b> will be deleted.").ariaLabel("delete mailDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getDispositions(c.query,p).$promise},c.createOrEditMailAccountMailDisposition=function(e,t){s.show({controller:"CreateOrEditMailDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailDisposition:t,mailDispositions:c.mailAccountMailDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMailAccountMailDispositions=function(){var e=angular.copy(c.selectedMailAccountMailDispositions);return c.selectedMailAccountMailDispositions=[],e},c.deleteMailAccountMailDisposition=g,c.deleteSelectedMailAccountMailDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected mailDispositions?").htmlContent("<b>"+c.selectedMailAccountMailDispositions.length+" selected</b> will be deleted.").ariaLabel("delete mailDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountMailDispositions.forEach(function(e){g(e)}),c.selectedMailAccountMailDispositions=[]})};var m=!0,u=1;function p(e){c.mailAccountMailDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailDispositions.rows,{id:e.id}),c.mailAccountMailDispositions.count-=1,c.mailAccountMailDispositions.rows.length||c.getMailAccountMailDispositions(),r.success({title:"MailDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILDISPOSITION",g.mailDisposition=angular.copy(l),g.mailDispositions=r,g.newMailDisposition=!1,g.mailDisposition||(g.mailDisposition={},g.title="MAIL.NEW_MAILDISPOSITION",g.newMailDisposition=!0),t.params.id&&(g.mailDisposition.MailAccountId=t.params.id),g.addNewMailDisposition=function(){g.errors=[],d.disposition.save(g.mailDisposition).$promise.then(function(e){g.mailDispositions.unshift(e.toJSON()),o.success({title:"MailDisposition properly created",msg:g.mailDisposition.name?g.mailDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailDisposition=function(){g.errors=[],d.disposition.update({id:g.mailDisposition.id},g.mailDisposition).$promise.then(function(e){var t=_.find(g.mailDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailDisposition properly saved!",msg:g.mailDisposition.name?g.mailDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailDisposition will be deleted.").ariaLabel("Delete MailDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.mailDisposition.id}).$promise.then(function(){_.remove(g.mailDispositions,{id:g.mailDisposition.id}),o.success({title:"MailDisposition properly deleted!",msg:(g.mailDisposition.name||"mailDisposition")+" has been deleted!"}),v(g.mailDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailDispositions","mailDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.mailAccount=c||n.params.mailAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.accounts",{})}},u.agentadddialog=function(e,t){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:u.mailAccounts?u.mailAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailAccounts=function(){n.go("app.mail.mailAccounts")},u.saveMailAccount=function(){r.mailAccount.update({id:u.mailAccount.id},u.mailAccount).$promise.then(function(){l.success({title:"MailAccount updated!",msg:u.mailAccount.name?u.mailAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.mailAccount&&(n=_.find(u.lists,{id:Number(u.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.mailAccount&&(a=_.find(u.lists,{id:Number(u.mailAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailAccount","userProfileSection"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedMailAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arraycservice=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b["arrayImap.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b["arraySmtp.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:b.crudPermissions})},b.verifysmtpverifysmtp=function(e,t){{if(e&&e.id)return m.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){p.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});p.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},b.interactionsgoto=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,tab:7})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.accounts",{})}},b.agentadddialog=function(e,t){i.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:b.mailAccounts?b.mailAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailAccount")+"?").htmlContent("<b>"+(e.name||"mailAccount")+"</b> will be deleted.").ariaLabel("delete mailAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMailAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailAccount=function(e,t){i.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:t,mailAccounts:b.mailAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailAccount=S,b.exportSelectedMailAccounts=function(){var e=angular.copy(b.selectedMailAccounts);return b.selectedMailAccounts=[],e},b.deleteSelectedMailAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailAccounts?").htmlContent("<b>"+b.selectedMailAccounts.length+" selected</b> will be deleted.").ariaLabel("delete MailAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailAccounts.forEach(function(e){S(e)}),b.selectedMailAccounts=[]})},b.deselectMailAccounts=function(){b.selectedMailAccounts=[]},b.selectAllMailAccounts=function(){b.selectedMailAccounts=b.mailAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.mailAccount&&(n=_.find(b.lists,{id:Number(b.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.mailAccount&&(a=_.find(b.lists,{id:Number(b.mailAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.mailAccounts=e||{count:0,rows:[]}}function S(e){if(e.service)return p.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});m.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.mailAccounts.rows,{id:e.id}),b.mailAccounts.count-=1,b.mailAccounts.rows.length||b.getMailAccounts(),p.success({title:_.startCase("MailAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILQUEUE",g.mailQueue=angular.copy(l),g.mailQueues=r,g.newMailQueue=!1,g.mailQueue||(g.mailQueue={strategy:"beepall",timeout:10},g.title="MAIL.NEW_MAILQUEUE",g.newMailQueue=!0),g.addNewMailQueue=function(){g.errors=[],d.mailQueue.save(g.mailQueue).$promise.then(function(e){g.mailQueues.unshift(e.toJSON()),o.success({title:"MailQueue properly created",msg:g.mailQueue.name?g.mailQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailQueue=function(){g.errors=[],d.mailQueue.update({id:g.mailQueue.id},g.mailQueue).$promise.then(function(e){var t=_.find(g.mailQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailQueue properly saved!",msg:g.mailQueue.name?g.mailQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailQueue.delete({id:g.mailQueue.id}).$promise.then(function(){_.remove(g.mailQueues,{id:g.mailQueue.id}),o.success({title:"MailQueue properly deleted!",msg:(g.mailQueue.name||"mailQueue")+" has been deleted!"}),v(g.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailQueues","mailQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MAIL.ALL_TEAMS"),labelSelected:n.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues")},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailQueues",b.listOrder="",b.listOrderAsc=null,b.selectedMailQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:b.mailQueues?b.mailQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:b.mailQueues?b.mailQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.queues",{})}},b.success=y,b.getMailQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailQueue=function(e,t){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:b.mailQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailQueue=S,b.exportSelectedMailQueues=function(){var e=angular.copy(b.selectedMailQueues);return b.selectedMailQueues=[],e},b.deleteSelectedMailQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+b.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailQueues.forEach(function(e){S(e)}),b.selectedMailQueues=[]})},b.deselectMailQueues=function(){b.selectedMailQueues=[]},b.selectAllMailQueues=function(){b.selectedMailQueues=b.mailQueues.rows};var E=!0,A=1;function y(e){b.mailQueues=e||{count:0,rows:[]}}function S(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.mailQueues.rows,{id:e.id}),b.mailQueues.count-=1,b.mailQueues.rows.length||b.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var t=_.find(g.mailSubtatuses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailSubtatuses=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailSubtatuses",b.listOrder="",b.listOrderAsc=null,b.selectedMailSubstatuses=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:b.mailSubtatuses.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMailSubstatuses=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailSubstatus.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailSubstatuses",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailSubstatus=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:t,mailSubtatuses:b.mailSubtatuses.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailSubstatus=S,b.exportSelectedMailSubstatuses=function(){var e=angular.copy(b.selectedMailSubstatuses);return b.selectedMailSubstatuses=[],e},b.deleteSelectedMailSubstatuses=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+b.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailSubstatuses.forEach(function(e){S(e)}),b.selectedMailSubstatuses=[]})},b.deselectMailSubstatuses=function(){b.selectedMailSubstatuses=[]},b.selectAllMailSubstatuses=function(){b.selectedMailSubstatuses=b.mailSubtatuses.rows};var E=!0,A=1;function y(e){b.mailSubtatuses=e||{count:0,rows:[]}}function S(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(b.mailSubtatuses.rows,{id:e.id}),b.mailSubtatuses.count-=1,b.mailSubtatuses.rows.length||b.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.mailAccounts,function(e,t){p.rpcMailAccounts[t]&&_.merge(e,p.rpcMailAccounts[t])}),_.forIn(p.mailAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};s.mailAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",s.mailAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getMailAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.mailAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="MailAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.mailAccounts[e.id]&&_.merge(p.mailAccounts[e.id],e)},p.onMailMessageSave=function(e){p.mailAccounts[e.MailAccountId]&&("in"==e.direction?(p.mailAccounts[e.MailAccountId].in+=1,p.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(p.mailAccounts[e.MailAccountId].out+=1,p.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},p.goToMailAccount=function(e,t){i.go("app.mail.mailAccounts.edit",{id:t.id,mailAccount:t})},p.verifySmtp=function(e,t){{if(t&&t.id)return s.mailAccount.verifySmtp({id:t.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},p.order=[],_.forIn(p.mailAccounts,function(e,t){p.order.push(e.id)}),o.on("mailAccount:save",p.onSave),o.on("mailAccount:update",p.onSave),o.on("mailMessage:save",p.onMailMessageSave);var v=!0,h=1;function f(e){if(p.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var t=0;t<e.rows.length;t++)p.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getMailAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("mailAccount:save"),o.removeAllListeners("mailAccount:update"),o.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"mail",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMailRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.mailQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].MailQueueId].paused++,g.queues[e[t].rows[n].MailQueueId].loggedInDb++,g.queues[e[t].rows[n].MailQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].MailQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.mailQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="MailQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditMailQueue=function(e,t){a.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.mailQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.MailQueueId]&&g.queues[e.MailQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.MailQueueId]&&g.queues[e.MailQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.MailQueueId]&&(g.queues[e.MailQueueId].loggedInDb+=1,g.queues[e.MailQueueId].agents[e.UserId]=e.MailQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.MailQueueId]&&0<g.queues[e.MailQueueId].loggedInDb&&(g.queues[e.MailQueueId].loggedInDb-=1,delete g.queues[e.MailQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("mail_queue:save",g.onSave),d.on("userMailQueue:save",g.onSaveMember),d.on("userMailQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("mail_queue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,n.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.mail.realtime.agents");break;case 1:n.go("app.mail.realtime.queues");break;case 2:n.go("app.mail.realtime.accounts");break;default:n.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var t=_.find(g.plugins,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins")},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.plugins=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="plugins",b.listOrder="",b.listOrderAsc=null,b.selectedPlugins=[],b.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,page:1},b.installing=!1,b.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});b.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){b.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},b.editstate=function(e,t){n.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:b.crudPermissions})},b.stopplugin=function(e,t){var n=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){var n;n=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.update({id:t.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},b.restartplugin=function(e,t){var n=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){var n;n=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.update({id:t.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},b.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.uninstallplugin=function(e,t){var n=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){!function(n){"script"===n.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.delete({id:t.pm_id,name:n.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});n.active=!1,m.plugin.update({id:n.id},n).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:n.name?n.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getPlugins=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.plugin.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Plugins",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditPlugin=function(e,t){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:t,plugins:b.plugins.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletePlugin=S,b.exportSelectedPlugins=function(){var e=angular.copy(b.selectedPlugins);return b.selectedPlugins=[],e},b.deleteSelectedPlugins=function(e){var t=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+b.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedPlugins.forEach(function(e){S(e)}),b.selectedPlugins=[]})},b.deselectPlugins=function(){b.selectedPlugins=[]},b.selectAllPlugins=function(){b.selectedPlugins=b.plugins.rows},b.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:b.plugins.rows}})};var E=!0,A=1;function y(e){b.plugins=e||{count:0,rows:[]}}function S(n){n.active&&"script"==n.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var t=_.find(e.rows,{name:n.scriptName});t?m.pm2.delete({id:t.pm_id,name:n.scriptName}).$promise:console.log("No '%s' process found",n.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:n.id}).$promise.then(function(){_.remove(b.plugins.rows,{id:n.id}),b.plugins.count-=1,b.plugins.rows.length||b.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this,r=2,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["zip"];if(!_.includes(t,e.getExtension()))return n.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>l)return n.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result}}})},o.uploadError=function(e,t){o.ngFlow.flow.cancel(),n.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",n.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var t=_.find(g.ivrCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),g.trunks=t})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),n=null;if(g.ivrCampaign&&(n=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.projects,{id:n.id});a.canSelect=!1,t.push(a)}g.projects=t})}else{var n=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,n.push(g.projects[i]));g.projects=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.ivrCampaign&&(n=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperBlacks={count:0,rows:[]},c.selectedIvrCampaignHopperBlacks=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperBlacks(c.query,p).$promise},c.createOrEditIvrCampaignHopperBlack=function(e,t){s.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperBlack:t,hopperBlacks:c.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(c.selectedIvrCampaignHopperBlacks);return c.selectedIvrCampaignHopperBlacks=[],e},c.deleteIvrCampaignHopperBlack=g,c.deleteSelectedIvrCampaignHopperBlacks=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperBlacks.rows,{id:e.id}),c.ivrCampaignHopperBlacks.count-=1,c.ivrCampaignHopperBlacks.rows.length||c.getIvrCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.ivrCampaign={},c.ivrCampaignHopperFinals={count:0,rows:[]},c.selectedIvrCampaignHopperFinals=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperFinals(c.query,p).$promise},c.createOrEditIvrCampaignHopperFinal=function(e,t){s.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperFinal:t,hopperFinals:c.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(c.selectedIvrCampaignHopperFinals);return c.selectedIvrCampaignHopperFinals=[],e},c.deleteIvrCampaignHopperFinal=g,c.deleteSelectedIvrCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperFinals=[]})},c.moveIvrCampaignHopperFinal=v,c.moveContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=s.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedIvrCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedIvrCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperFinals.rows,{id:e.id}),c.ivrCampaignHopperFinals.count-=1,c.ivrCampaignHopperFinals.rows.length||c.getIvrCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperHistories={count:0,rows:[]},c.selectedIvrCampaignHopperHistories=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperHistories(c.query,p).$promise},c.createOrEditIvrCampaignHopperHistory=function(e,t){s.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperHistory:t,hopperHistories:c.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(c.selectedIvrCampaignHopperHistories);return c.selectedIvrCampaignHopperHistories=[],e},c.deleteIvrCampaignHopperHistory=g,c.deleteSelectedIvrCampaignHopperHistories=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperHistories.rows,{id:e.id}),c.ivrCampaignHopperHistories.count-=1,c.ivrCampaignHopperHistories.rows.length||c.getIvrCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHoppers={count:0,rows:[]},c.selectedIvrCampaignHoppers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHoppers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHoppers(c.query,p).$promise},c.createOrEditIvrCampaignHopper=function(e,t){s.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopper:t,hoppers:c.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(c.selectedIvrCampaignHoppers);return c.selectedIvrCampaignHoppers=[],e},c.deleteIvrCampaignHopper=g,c.deleteSelectedIvrCampaignHoppers=function(e){var t=s.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),c.selectedIvrCampaignHoppers=[]})},d.hasRole("admin")?l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.agents,{id:e.resourceId})});c.agents.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),c.agents=t})}else c.agents=[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.ivrCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHoppers.rows,{id:e.id}),c.ivrCampaignHoppers.count-=1,c.ivrCampaignHoppers.rows.length||c.getIvrCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),t.params.id&&(g.hopper.CampaignId=t.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var n,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(g.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),g.agents=t})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.ivrCampaign={},i.init=function(t){i.ivrCampaign=t,n.cmHopper.get({limit:0,CampaignId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,CampaignId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,CampaignId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=t,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return i.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(s.id,l.selected[n]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(n,e,i,s,a,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||n.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(t,n){r.campaign.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=u.ivrCampaign.id,t=a.rows[0],n=t.id,r.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return r.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!1,locals:{ivrCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){n.go("app.motiondialer.ivrCampaigns")},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.trunks=t})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),n=null;if(u.ivrCampaign&&(n=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.projects,{id:n.id});a.canSelect=!1,t.push(a)}u.projects=t})}else{var n=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,n.push(u.projects[i]));u.projects=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.ivrCampaign&&(n=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.ivrCampaigns=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="ivrCampaigns",b.listOrder="",b.listOrderAsc=null,b.selectedIvrCampaigns=[],b.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},b.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.ivr_campaigns",{})}},b.success=y,b.getIvrCampaigns=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.campaign.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="IvrCampaigns",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditIvrCampaign=function(e,t){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:b.ivrCampaigns.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteIvrCampaign=S,b.exportSelectedIvrCampaigns=function(){var e=angular.copy(b.selectedIvrCampaigns);return b.selectedIvrCampaigns=[],e},b.deleteSelectedIvrCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+b.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedIvrCampaigns.forEach(function(e){S(e)}),b.selectedIvrCampaigns=[]})},b.deselectIvrCampaigns=function(){b.selectedIvrCampaigns=[]},b.selectAllIvrCampaigns=function(){b.selectedIvrCampaigns=b.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})});b.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),b.trunks=t})}else b.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.projects,{id:e.resourceId})}),a=null;a=[],b.ivrCampaigns.rows.forEach(function(e){var t=_.find(b.projects,{id:Number(e.SquareProjectId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.projects,{id:e.id});t.canSelect=!1,n.push(t)}}),b.projects=n})}else{var n=[],a=[];b.ivrCampaigns.rows.forEach(function(e){var t=_.find(b.projects,{id:Number(e.SquareProjectId)});a.push(t)});for(var i=0;i<b.projects.length;i++){_.some(a,{id:b.projects[i].id})&&(b.projects[i].canSelect=!1,n.push(b.projects[i]))}b.projects=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.ivrCampaign&&(n=_.find(b.interval,{id:Number(b.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.ivrCampaign&&(a=_.find(b.interval,{id:Number(b.ivrCampaign.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.ivrCampaigns=e||{count:0,rows:[]}}function S(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(b.ivrCampaigns.rows,{id:e.id}),b.ivrCampaigns.count-=1,b.ivrCampaigns.rows.length||b.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var t=_.find(g.queueCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),n=null;if(g.queueCampaign&&(n=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.trunks,{id:n.id});a.canSelect=!1,t.push(a)}g.trunks=t})}else{var n=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,n.push(g.trunks[i]));g.trunks=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.queueCampaign&&(n=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=t,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!i,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),n.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperBlacks={count:0,rows:[]},c.selectedQueueCampaignHopperBlacks=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperBlacks(c.query,p).$promise},c.createOrEditQueueCampaignHopperBlack=function(e,t){s.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperBlack:t,hopperBlacks:c.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(c.selectedQueueCampaignHopperBlacks);return c.selectedQueueCampaignHopperBlacks=[],e},c.deleteQueueCampaignHopperBlack=g,c.deleteSelectedQueueCampaignHopperBlacks=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperBlacks.rows,{id:e.id}),c.queueCampaignHopperBlacks.count-=1,c.queueCampaignHopperBlacks.rows.length||c.getQueueCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.queueCampaign={},c.queueCampaignHopperFinals={count:0,rows:[]},c.selectedQueueCampaignHopperFinals=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperFinals(c.query,p).$promise},c.createOrEditQueueCampaignHopperFinal=function(e,t){s.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperFinal:t,hopperFinals:c.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(c.selectedQueueCampaignHopperFinals);return c.selectedQueueCampaignHopperFinals=[],e},c.deleteQueueCampaignHopperFinal=g,c.deleteSelectedQueueCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperFinals=[]})},c.moveQueueCampaignHopperFinal=v,c.moveContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=s.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedQueueCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedQueueCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperFinals.rows,{id:e.id}),c.queueCampaignHopperFinals.count-=1,c.queueCampaignHopperFinals.rows.length||c.getQueueCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperHistories={count:0,rows:[]},c.selectedQueueCampaignHopperHistories=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperHistories(c.query,p).$promise},c.createOrEditQueueCampaignHopperHistory=function(e,t){s.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperHistory:t,hopperHistories:c.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(c.selectedQueueCampaignHopperHistories);return c.selectedQueueCampaignHopperHistories=[],e},c.deleteQueueCampaignHopperHistory=g,c.deleteSelectedQueueCampaignHopperHistories=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperHistories.rows,{id:e.id}),c.queueCampaignHopperHistories.count-=1,c.queueCampaignHopperHistories.rows.length||c.getQueueCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHoppers={count:0,rows:[]},c.selectedQueueCampaignHoppers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHoppers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHoppers(c.query,p).$promise},c.createOrEditQueueCampaignHopper=function(e,t){s.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopper:t,hoppers:c.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(c.selectedQueueCampaignHoppers);return c.selectedQueueCampaignHoppers=[],e},c.deleteQueueCampaignHopper=g,c.deleteSelectedQueueCampaignHoppers=function(e){var t=s.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),c.selectedQueueCampaignHoppers=[]})},d.hasRole("admin")?l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.agents,{id:e.resourceId})}),n=null;if(c.queueCampaign&&(n=_.find(c.agents,{id:Number(c.queueCampaign.UserId)})),n&&!_.some(t,["id",n.id])){var a=_.find(c.agents,{id:n.id});a.canSelect=!1,t.push(a)}c.agents=t})}else{var n=[],a=null;c.queueCampaign&&(a=_.find(c.agents,{id:Number(c.queueCampaign.UserId)}));for(var i=0;i<c.agents.length;i++)a&&c.agents[i].id===a.id&&(c.agents[i].canSelect=!1,n.push(c.agents[i]));c.agents=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.queueCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHoppers.rows,{id:e.id}),c.queueCampaignHoppers.count-=1,c.queueCampaignHoppers.rows.length||c.getQueueCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),t.params.id&&(g.hopper.VoiceQueueId=t.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var n,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(g.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),n=null;if(g.hopper&&(n=_.find(g.agents,{id:Number(g.hopper.UserId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.agents,{id:n.id});a.canSelect=!1,t.push(a)}g.agents=t})}else{var n=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,n.push(g.agents[i]));g.agents=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.queueCampaign={},i.init=function(t){i.queueCampaign=t,n.cmHopper.get({limit:0,VoiceQueueId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,VoiceQueueId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,VoiceQueueId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(s.id,l.selected[n]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s){var c=this;function o(){return l(function(n,t){return l(function(t,n){return d.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],i.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:i.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});i.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getTeams({id:c.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){return _.find(c.items,{id:e.id})}),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=i.getCurrentUser(),c.queueCampaign=t,c.crudPermissions=s,c.penalty=0,c.items=[],c.allowedItems=[],c.selectedItems=[],c.addedItems=[],c.removedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,t){t?c.removedItems=_.unionBy(e,c.removedItems,"id"):(e.forEach(function(e){e.penalty="penalty "+c.penalty}),c.addedItems=_.unionBy(e,c.addedItems,"id")),c.pendingChanges=!0}},c.onInit=function(){return i.hasRole("admin")?o().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,o()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveTeams=function(){var e=c.removedItems,t=c.addedItems;return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeTeams({id:c.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addTeams({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.addedItems=[],c.removedItems=[],a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(n,e,i,s,a,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||n.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(t,n){r.voiceQueue.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=u.queueCampaign.id,t=a.rows[0],n=t.id,r.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!1,locals:{queueCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){n.go("app.motiondialer.queueCampaigns")},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),n&&!_.some(t,["id",n.id])){var a=_.find(u.musiconholds,{id:n.id});a.canSelect=!1,t.push(a)}u.musiconholds=t}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.trunks,{id:n.id});a.canSelect=!1,t.push(a)}u.trunks=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,n.push(u.trunks[i]));u.trunks=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),n&&!_.some(t,["id",n.id])){var a=_.find(u.projects,{id:n.id});a.canSelect=!1,t.push(a)}u.projects=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,n.push(u.projects[i]));u.projects=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.queueCampaigns=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="queueCampaigns",b.listOrder="",b.listOrderAsc=null,b.selectedQueueCampaigns=[],b.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},b.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.queues",{})}},b.success=y,b.getQueueCampaigns=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="QueueCampaigns",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditQueueCampaign=function(e,t){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:b.queueCampaigns.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteQueueCampaign=S,b.exportSelectedQueueCampaigns=function(){var e=angular.copy(b.selectedQueueCampaigns);return b.selectedQueueCampaigns=[],e},b.deleteSelectedQueueCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+b.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedQueueCampaigns.forEach(function(e){S(e)}),b.selectedQueueCampaigns=[]})},b.deselectQueueCampaigns=function(){b.selectedQueueCampaigns=[]},b.selectAllQueueCampaigns=function(){b.selectedQueueCampaigns=b.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})}),a=null;a=[],b.queueCampaigns.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.trunks,{id:e.id});t.canSelect=!1,n.push(t)}}),b.trunks=n})}else{var n=[],a=[];b.queueCampaigns.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)});for(var i=0;i<b.trunks.length;i++){_.some(a,{id:b.trunks[i].id})&&(b.trunks[i].canSelect=!1,n.push(b.trunks[i]))}b.trunks=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.queueCampaign&&(n=_.find(b.interval,{id:Number(b.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.queueCampaign&&(a=_.find(b.interval,{id:Number(b.queueCampaign.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.queueCampaigns=e||{count:0,rows:[]}}function S(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.queueCampaigns.rows,{id:e.id}),b.queueCampaigns.count-=1,b.queueCampaigns.rows.length||b.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this,h=!0;function f(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.contacts:"+v.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(v.query=_.merge(e.query,_.omit(v.query,["sort","limit","page"])),v.query=_.omit(v.query,"filter")),d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()}):o.userProfile.getResources({id:v.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()})}function b(e){v.contacts=e||{count:0,rows:[]},h=!1,v.refresh=!0}v.showTooltip=!1,v.refresh=!0,v.disable=[],v.agents=p||[],v.currentUser=d.getCurrentUser(),v.localizationMap=u,v.pickerModel={dateStart:null,dateEnd:null},v.queues={},v.contacts={count:0,rows:[]},v.dispositions=g,v.userProfile=r,v.userProfileSection=l&&1==l.count?l.rows[0]:null,v.crudPermissions=d.parseCrudPermissions(v.userProfileSection?v.userProfileSection.crudPermissions:null),v.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},v.clearAll=function(){v.query.createdAt=void 0,v.pickerModel={dateStart:null,dateEnd:null},v.getContacts()},v.getContacts=function(){if(v.refresh=!1,v.pickerModel.dateStart&&!h){var e=moment(v.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();v.query.createdAt={$gte:v.pickerModel.dateStart,$lte:e}}else v.query.createdAt=void 0;v.query.queue=v.query.queue,v.query.offset=(v.query.page-1)*v.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.contacts:"+v.currentUser.id,JSON.stringify({query:_.omit(v.query,"queue")})),v.promise=o.voiceQueueReport.getVoiceQueuesReport(v.query,b).$promise},v.refreshContacts=function(){v.showTooltip=!1,v.getContacts()},v.onInit=f,v.assignedA=function(e,t){e&&(v.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){v.disable[e.id]=!1}))},v.disposed=function(e,t){e&&o.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},v.onSavevoiceQueueReport=function(e){e&&v.queuesMap&&"outbound"===e.type&&v.queuesMap[e.queue]&&(v.showTooltip=!0)},v.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(v.contacts.rows,["id",e.id]);0<=t&&_.merge(v.contacts.rows[t],e)}},c.onWithoutApply("voiceQueueReport:save",v.onSavevoiceQueueReport),c.on("voiceQueueReport:update",v.onUpdatevoiceQueueReport),f();var E=!0,A=1;e.$watch("vm.query.filter",function(e,t){E?n(function(){E=!1}):(t||(A=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=A),v.getContacts())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","dateFilterLocalizationFactory","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",direction:"outbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){_.forIn(u.campaigns,function(e,t){u.rpcCampaigns[t]&&_.merge(e,_.pick(u.rpcCampaigns[t],p))})}u.currentUser=m.getCurrentUser(),u.count=o.count,u.campaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"-updatedAt",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){u.campaigns[e.id]&&(_.merge(u.campaigns[e.id],_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,t){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:_.values(u.campaigns),license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=t(function(){},999);var v=!0,h=1;function f(e){u.count=e.count,u.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&t.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.agents=n||{count:0,rows:[]},p.queues=i?_.keyBy(i.rows?i.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=s?_.keyBy(s.rows?_.filter(s.rows,{type:"outbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,t){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[t]=e)})},p.onSave=function(e){"outbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){d.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(t,e,n){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e,context:n}).$promise.then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){_.forIn(c.queues,function(e,t){c.rpcQueues[t]&&_.merge(e,_.pick(c.rpcQueues[t],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].VoiceQueueId].paused++,g.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,g.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"outbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.voiceQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="QueueCampaigns",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditMotionDialerQueue=function(e,t){a.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:g.queues?g.queues.rows:[],realtime:!0,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.MotionDialerQueueId]&&g.queues[e.MotionDialerQueueId].loggedInDb++},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.VoiceQueueId]&&(g.queues[e.VoiceQueueId].loggedInDb+=1,g.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.VoiceQueueId]&&0<g.queues[e.VoiceQueueId].loggedInDb&&(g.queues[e.VoiceQueueId].loggedInDb-=1,delete g.queues[e.VoiceQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.onWithoutApply("voice_queue:save",g.onSave),g.interval=s(function(){},999),d.on("userVoiceQueueRt:save",g.onSaveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),g.interval&&s.cancel(g.interval),d.removeAllListeners("userVoiceQueueRt:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,n.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.motiondialer.realtime.agents");break;case 1:n.go("app.motiondialer.realtime.queues");break;case 2:n.go("app.motiondialer.realtime.queue_calls");break;case 3:n.go("app.motiondialer.realtime.abandonedcalls");break;case 4:n.go("app.motiondialer.realtime.queue_params");break;case 5:n.go("app.motiondialer.realtime.ivr_campaigns");break;default:n.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),t.params.id&&(g.openchannelAccount.OpenchannelAccountId=t.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var t=_.find(g.openchannelAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.openchannelAccount&&(n=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:n,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[t]=e:r.openchannelAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.openchannelAccountApps.rows.length;n++,0){var a=r.openchannelAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.openchannelAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,n).$promise},r.editOpenchannelAccountApp=t,r.editInterval=function(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("openChannel")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountInteractions={count:0,rows:[]},c.selectedOpenchannelAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,OpenchannelAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.getOpenchannelAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.openchannelInteractionDownload=function(s,e,t){return l.openchannelInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getOpenchannelAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getInteractions(c.query,p).$promise},c.createOrEditOpenchannelAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,interaction:t,interactions:c.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spyopenchannelInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"openchannel",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(c.selectedOpenchannelAccountInteractions);return c.selectedOpenchannelAccountInteractions=[],e},c.deleteOpenchannelAccountInteraction=g,c.deleteSelectedOpenchannelAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountInteractions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountInteractions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountInteractions=e||{count:0,rows:[]}}function g(e){l.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountInteractions.rows,{id:e.id}),c.openchannelAccountInteractions.count-=1,c.openchannelAccountInteractions.rows.length||c.getOpenchannelAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getAnswers(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,t){s.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelCannedAnswer:t,openchannelCannedAnswers:c.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelCannedAnswers);return c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},c.deleteOpenchannelAccountOpenchannelCannedAnswer=g,c.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),c.openchannelAccountOpenchannelCannedAnswers.count-=1,c.openchannelAccountOpenchannelCannedAnswers.rows.length||c.getOpenchannelAccountOpenchannelCannedAnswers(),r.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),t.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=t.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var t=_.find(g.openchannelCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelDispositions={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the openchannelDisposition?").htmlContent("<b>"+(e.name||"openchannelDisposition")+"</b> will be deleted.").ariaLabel("delete openchannelDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getDispositions(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelDisposition=function(e,t){s.show({controller:"CreateOrEditOpenchannelDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelDisposition:t,openchannelDispositions:c.openchannelAccountOpenchannelDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedOpenchannelAccountOpenchannelDispositions=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelDispositions);return c.selectedOpenchannelAccountOpenchannelDispositions=[],e},c.deleteOpenchannelAccountOpenchannelDisposition=g,c.deleteSelectedOpenchannelAccountOpenchannelDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected openchannelDispositions?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelDispositions.length+" selected</b> will be deleted.").ariaLabel("delete openchannelDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelDispositions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelDispositions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelDispositions.rows,{id:e.id}),c.openchannelAccountOpenchannelDispositions.count-=1,c.openchannelAccountOpenchannelDispositions.rows.length||c.getOpenchannelAccountOpenchannelDispositions(),r.success({title:"OpenchannelDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION",g.openchannelDisposition=angular.copy(l),g.openchannelDispositions=r,g.newOpenchannelDisposition=!1,g.openchannelDisposition||(g.openchannelDisposition={},g.title="OPENCHANNEL.NEW_OPENCHANNELDISPOSITION",g.newOpenchannelDisposition=!0),t.params.id&&(g.openchannelDisposition.OpenchannelAccountId=t.params.id),g.addNewOpenchannelDisposition=function(){g.errors=[],d.disposition.save(g.openchannelDisposition).$promise.then(function(e){g.openchannelDispositions.unshift(e.toJSON()),o.success({title:"OpenchannelDisposition properly created",msg:g.openchannelDisposition.name?g.openchannelDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelDisposition=function(){g.errors=[],d.disposition.update({id:g.openchannelDisposition.id},g.openchannelDisposition).$promise.then(function(e){var t=_.find(g.openchannelDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelDisposition properly saved!",msg:g.openchannelDisposition.name?g.openchannelDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelDisposition will be deleted.").ariaLabel("Delete OpenchannelDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.openchannelDisposition.id}).$promise.then(function(){_.remove(g.openchannelDispositions,{id:g.openchannelDisposition.id}),o.success({title:"OpenchannelDisposition properly deleted!",msg:(g.openchannelDisposition.name||"openchannelDisposition")+" has been deleted!"}),v(g.openchannelDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelDispositions","openchannelDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.openchannelAccount=c||e.params.openchannelAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:u.openchannelAccounts?u.openchannelAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts")},u.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:u.openchannelAccount.id},u.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:u.openchannelAccount.name?u.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.openchannelAccount&&(n=_.find(u.lists,{id:Number(u.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.openchannelAccount&&(a=_.find(u.lists,{id:Number(u.openchannelAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:u.openchannelAccount.ListId}).$promise.then(function(e){u.fields=[];e=_.values(e.toJSON());for(var t=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],n=0;n<e.length;n++)_.includes(t,e[n].columnName)||u.fields.push(e[n])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.openchannelAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="openchannelAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedOpenchannelAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},b.agentadddialog=function(e,t){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:b.openchannelAccounts?b.openchannelAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getOpenchannelAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.openchannelAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OpenchannelAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOpenchannelAccount=function(e,t){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:t,openchannelAccounts:b.openchannelAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOpenchannelAccount=S,b.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(b.selectedOpenchannelAccounts);return b.selectedOpenchannelAccounts=[],e},b.deleteSelectedOpenchannelAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+b.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOpenchannelAccounts.forEach(function(e){S(e)}),b.selectedOpenchannelAccounts=[]})},b.deselectOpenchannelAccounts=function(){b.selectedOpenchannelAccounts=[]},b.selectAllOpenchannelAccounts=function(){b.selectedOpenchannelAccounts=b.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.openchannelAccount&&(n=_.find(b.lists,{id:Number(b.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.openchannelAccount&&(a=_.find(b.lists,{id:Number(b.openchannelAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.openchannelAccounts=e||{count:0,rows:[]}}function S(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.openchannelAccounts.rows,{id:e.id}),b.openchannelAccounts.count-=1,b.openchannelAccounts.rows.length||b.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",g.openchannelQueue=angular.copy(l),g.openchannelQueues=r,g.newOpenchannelQueue=!1,g.openchannelQueue||(g.openchannelQueue={strategy:"beepall",timeout:10},g.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",g.newOpenchannelQueue=!0),g.addNewOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.save(g.openchannelQueue).$promise.then(function(e){g.openchannelQueues.unshift(e.toJSON()),o.success({title:"OpenchannelQueue properly created",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.update({id:g.openchannelQueue.id},g.openchannelQueue).$promise.then(function(e){var t=_.find(g.openchannelQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelQueue properly saved!",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.openchannelQueue.delete({id:g.openchannelQueue.id}).$promise.then(function(){_.remove(g.openchannelQueues,{id:g.openchannelQueue.id}),o.success({title:"OpenchannelQueue properly deleted!",msg:(g.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),v(g.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:n.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues")},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.openchannelQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="openchannelQueues",b.listOrder="",b.listOrderAsc=null,b.selectedOpenchannelQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:b.openchannelQueues?b.openchannelQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:b.openchannelQueues?b.openchannelQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.openchannel.realtime.queues",{})}},b.success=y,b.getOpenchannelQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.openchannelQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OpenchannelQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOpenchannelQueue=function(e,t){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:b.openchannelQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOpenchannelQueue=S,b.exportSelectedOpenchannelQueues=function(){var e=angular.copy(b.selectedOpenchannelQueues);return b.selectedOpenchannelQueues=[],e},b.deleteSelectedOpenchannelQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+b.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOpenchannelQueues.forEach(function(e){S(e)}),b.selectedOpenchannelQueues=[]})},b.deselectOpenchannelQueues=function(){b.selectedOpenchannelQueues=[]},b.selectAllOpenchannelQueues=function(){b.selectedOpenchannelQueues=b.openchannelQueues.rows};var E=!0,A=1;function y(e){b.openchannelQueues=e||{count:0,rows:[]}}function S(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.openchannelQueues.rows,{id:e.id}),b.openchannelQueues.count-=1,b.openchannelQueues.rows.length||b.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"openchannel",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsOpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.openchannelQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].OpenchannelQueueId].paused++,g.queues[e[t].rows[n].OpenchannelQueueId].loggedInDb++,g.queues[e[t].rows[n].OpenchannelQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].OpenchannelQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.openchannelQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="OpenchannelQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditOpenchannelQueue=function(e,t){a.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.openchannelQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.OpenchannelQueueId]&&g.queues[e.OpenchannelQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.OpenchannelQueueId]&&g.queues[e.OpenchannelQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.OpenchannelQueueId]&&(g.queues[e.OpenchannelQueueId].loggedInDb+=1,g.queues[e.OpenchannelQueueId].agents[e.UserId]=e.OpenchannelQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.OpenchannelQueueId]&&0<g.queues[e.OpenchannelQueueId].loggedInDb&&(g.queues[e.OpenchannelQueueId].loggedInDb-=1,delete g.queues[e.OpenchannelQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("openchannel_queue:save",g.onSave),d.on("userOpenchannelQueue:save",g.onSaveMember),d.on("userOpenchannelQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("openchannel_queue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.openchannel.realtime.agents");break;case 1:n.go("app.openchannel.realtime.queues");break;default:n.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return n.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var t=_.find(g.customizations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?t.setting.update({id:s.customization.id},s.customization).$promise.then(function(){n.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),n.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:10,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var t=_.find(g.generals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),s.saveGeneral=function(){s.general.id?t.setting.update({id:s.general.id},s.general).$promise.then(function(){n.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),n.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(t,n,a,i,e,s){var o=this;o.license=i||{},o.agents=0,o.users=0,o.telephones=0,o.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"}],o.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],o.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"}],o.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],o.others=[{name:"update",icon:"icon-cloud-download"}],o.requestLicense=function(e){n.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:o.channels,modules:o.modules,addons:o.addons,sessions:o.sessions,others:o.others}})},o.updateLicense=function(e){n.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},o.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},s.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return o.agents=e&&e.count?e.count:0,s.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return o.users=e&&e.count?e.count:0,s.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){o.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$mdDialog","$state","license","toasty","api"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(n),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(n[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==n[e]?n[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==n[e]?n[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){t.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.errors=[],s.license=angular.copy(n),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?t.error({title:"License update failed!",msg:"Invalid license key"}):t.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var t=_.find(p.networks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;h.license=p,h.setting=g,h.currentUser=u.getCurrentUser(),h.networks=l||{count:0,rows:[]},h.table="networks",h.listOrder="",h.listOrderAsc=null,h.selectedNetworks=[],h.query={fields:"createdAt,updatedAt,id,type,value",sort:"-updatedAt",limit:10,page:1},h.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),h.editdialog=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{network:e,networks:h.networks.rows,license:h.license,setting:null,crudPermissions:h.crudPermissions}})},h.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},h.success=E,h.getNetworks=function(){h.query.offset=(h.query.page-1)*h.query.limit,u.hasRole("admin")?h.promise=d.network.get(h.query,E).$promise:(h.query.id=h.userProfile.id,h.query.section="Networks",h.promise=d.userProfile.getResources(h.query,E).$promise)},h.createOrEditNetwork=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:t,networks:h.networks.rows,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}})},h.deleteNetwork=A,h.exportSelectedNetworks=function(){var e=angular.copy(h.selectedNetworks);return h.selectedNetworks=[],e},h.deleteSelectedNetworks=function(e){var t=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+h.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){h.selectedNetworks.forEach(function(e){A(e)}),h.selectedNetworks=[]})},h.deselectNetworks=function(){h.selectedNetworks=[]},h.selectAllNetworks=function(){h.selectedNetworks=h.networks.rows};var f=!0,b=1;function E(e){h.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(h.networks.rows,{id:e.id}),h.networks.count-=1,h.networks.rows.length||h.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){f?o(function(){f=!1}):(t||(b=h.query.page),e!==t&&(h.query.page=1),e||(h.query.page=b),h.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_SMTP",g.smtp=angular.copy(l),g.smtps=r,g.newSmtp=!1,g.smtp||(g.smtp={service:!0},g.title="SETTINGS.NEW_SMTP",g.newSmtp=!0),g.addNewSmtp=function(){g.errors=[],d.mailAccount.save(g.smtp).$promise.then(function(e){g.smtps.unshift(e.toJSON()),o.success({title:"Smtp properly created",msg:g.smtp.name?g.smtp.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmtp=function(){g.errors=[],d.mailAccount.update({id:g.smtp.id},g.smtp).$promise.then(function(e){var t=_.find(g.smtps,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Smtp properly saved!",msg:g.smtp.name?g.smtp.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmtp=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smtp will be deleted.").ariaLabel("Delete Smtp").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailAccount.delete({id:g.smtp.id}).$promise.then(function(){_.remove(g.smtps,{id:g.smtp.id}),o.success({title:"Smtp properly deleted!",msg:(g.smtp.name||"smtp")+" has been deleted!"}),v(g.smtp)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smtps","smtp","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditSmtpDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.smtps=e,s.smtp={},s.smtps&&s.smtps.rows&&s.smtps.rows.length?s.smtp=s.smtps.rows[0]:s.smtp={service:!0,Smtp:{service:null}},s.saveSmtp=function(){s.smtp.id?t.mailAccount.update({id:s.smtp.id},s.smtp).$promise.then(function(){n.success({title:"Smtp updated!",msg:s.smtp.name?s.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.mailAccount.save(s.smtp).$promise.then(function(e){_.merge(s.smtp,e),n.success({title:"Smtp updated!",msg:s.smtp.name?s.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.verifySmtp=function(){s.smtp.id&&t.mailAccount.verifySmtp({id:s.smtp.id}).$promise.then(function(){n.success({title:"Smtp verified!",msg:s.smtp.name?s.smtp.name+" has been verified!":""})}).catch(function(e){n.error({title:"Smtp not verified! Remember to save before to verify!",msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})}}e.$inject=["smtps","api","toasty","license","Auth"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,t,n,a,o,r){var l,d=this;d.system=n||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=t.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,t,n){var a=s.confirm().title("Would you like to change the status of the process #"+t+"?").textContent("The status will be changed to: "+n.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:t,status:n})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+n})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=t(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){n.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(t.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(n,e,a,t,i){this.version=t||{},this.updateConfirm=function(e){var t=n.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");n.show(t).then(function(){n.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"sms",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsSmsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.smsQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].SmsQueueId].paused++,g.queues[e[t].rows[n].SmsQueueId].loggedInDb++,g.queues[e[t].rows[n].SmsQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].SmsQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.smsQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="SmsQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditSmsQueue=function(e,t){a.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.smsQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.SmsQueueId]&&g.queues[e.SmsQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.SmsQueueId]&&g.queues[e.SmsQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.SmsQueueId]&&(g.queues[e.SmsQueueId].loggedInDb+=1,g.queues[e.SmsQueueId].agents[e.UserId]=e.SmsQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.SmsQueueId]&&0<g.queues[e.SmsQueueId].loggedInDb&&(g.queues[e.SmsQueueId].loggedInDb-=1,delete g.queues[e.SmsQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("sms_queue:save",g.onSave),d.on("userSmsQueue:save",g.onSaveMember),d.on("userSmsQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("sms_queue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.sms.realtime.agents");break;case 1:n.go("app.sms.realtime.queues");break;default:n.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),t.params.id&&(g.smsAccount.SmsAccountId=t.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var t=_.find(g.smsAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.smsAccount&&(n=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:n,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[t]=e:r.smsAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.smsAccountApps.rows.length;n++,0){var a=r.smsAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.smsAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,n).$promise},r.editSmsAccountApp=t,r.editInterval=function(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("sms")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountInteractions={count:0,rows:[]},c.selectedSmsAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,SmsAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.getSmsAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.smsInteractionDownload=function(s,e,t){return l.smsInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getSmsAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getInteractions(c.query,p).$promise},c.createOrEditSmsAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,interaction:t,interactions:c.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spysmsInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"sms",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(c.selectedSmsAccountInteractions);return c.selectedSmsAccountInteractions=[],e},c.deleteSmsAccountInteraction=g,c.deleteSelectedSmsAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountInteractions.forEach(function(e){g(e)}),c.selectedSmsAccountInteractions=[]})};var m=!0,u=1;function p(e){c.smsAccountInteractions=e||{count:0,rows:[]}}function g(e){l.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountInteractions.rows,{id:e.id}),c.smsAccountInteractions.count-=1,c.smsAccountInteractions.rows.length||c.getSmsAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsCannedAnswers={count:0,rows:[]},c.selectedSmsAccountSmsCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getAnswers(c.query,p).$promise},c.createOrEditSmsAccountSmsCannedAnswer=function(e,t){s.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsCannedAnswer:t,smsCannedAnswers:c.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(c.selectedSmsAccountSmsCannedAnswers);return c.selectedSmsAccountSmsCannedAnswers=[],e},c.deleteSmsAccountSmsCannedAnswer=g,c.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+c.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),c.selectedSmsAccountSmsCannedAnswers=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsCannedAnswers.rows,{id:e.id}),c.smsAccountSmsCannedAnswers.count-=1,c.smsAccountSmsCannedAnswers.rows.length||c.getSmsAccountSmsCannedAnswers(),r.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),t.params.id&&(g.smsCannedAnswer.SmsAccountId=t.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var t=_.find(g.smsCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsDispositions={count:0,rows:[]},c.selectedSmsAccountSmsDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the smsDisposition?").htmlContent("<b>"+(e.name||"smsDisposition")+"</b> will be deleted.").ariaLabel("delete smsDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getDispositions(c.query,p).$promise},c.createOrEditSmsAccountSmsDisposition=function(e,t){s.show({controller:"CreateOrEditSmsDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsDisposition:t,smsDispositions:c.smsAccountSmsDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedSmsAccountSmsDispositions=function(){var e=angular.copy(c.selectedSmsAccountSmsDispositions);return c.selectedSmsAccountSmsDispositions=[],e},c.deleteSmsAccountSmsDisposition=g,c.deleteSelectedSmsAccountSmsDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected smsDispositions?").htmlContent("<b>"+c.selectedSmsAccountSmsDispositions.length+" selected</b> will be deleted.").ariaLabel("delete smsDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountSmsDispositions.forEach(function(e){g(e)}),c.selectedSmsAccountSmsDispositions=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsDispositions.rows,{id:e.id}),c.smsAccountSmsDispositions.count-=1,c.smsAccountSmsDispositions.rows.length||c.getSmsAccountSmsDispositions(),r.success({title:"SmsDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSDISPOSITION",g.smsDisposition=angular.copy(l),g.smsDispositions=r,g.newSmsDisposition=!1,g.smsDisposition||(g.smsDisposition={},g.title="SMS.NEW_SMSDISPOSITION",g.newSmsDisposition=!0),t.params.id&&(g.smsDisposition.SmsAccountId=t.params.id),g.addNewSmsDisposition=function(){g.errors=[],d.disposition.save(g.smsDisposition).$promise.then(function(e){g.smsDispositions.unshift(e.toJSON()),o.success({title:"SmsDisposition properly created",msg:g.smsDisposition.name?g.smsDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsDisposition=function(){g.errors=[],d.disposition.update({id:g.smsDisposition.id},g.smsDisposition).$promise.then(function(e){var t=_.find(g.smsDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsDisposition properly saved!",msg:g.smsDisposition.name?g.smsDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsDisposition will be deleted.").ariaLabel("Delete SmsDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.smsDisposition.id}).$promise.then(function(){_.remove(g.smsDispositions,{id:g.smsDisposition.id}),o.success({title:"SmsDisposition properly deleted!",msg:(g.smsDisposition.name||"smsDisposition")+" has been deleted!"}),v(g.smsDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsDispositions","smsDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.smsAccount=c||e.params.smsAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:u.smsAccounts?u.smsAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts")},u.saveSmsAccount=function(){r.smsAccount.update({id:u.smsAccount.id},u.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:u.smsAccount.name?u.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.smsAccount&&(n=_.find(u.lists,{id:Number(u.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.smsAccount&&(a=_.find(u.lists,{id:Number(u.smsAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.smsAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="smsAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSmsAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},b.agentadddialog=function(e,t){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:b.smsAccounts?b.smsAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSmsAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.smsAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SmsAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSmsAccount=function(e,t){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:t,smsAccounts:b.smsAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSmsAccount=S,b.exportSelectedSmsAccounts=function(){var e=angular.copy(b.selectedSmsAccounts);return b.selectedSmsAccounts=[],e},b.deleteSelectedSmsAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+b.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSmsAccounts.forEach(function(e){S(e)}),b.selectedSmsAccounts=[]})},b.deselectSmsAccounts=function(){b.selectedSmsAccounts=[]},b.selectAllSmsAccounts=function(){b.selectedSmsAccounts=b.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.smsAccount&&(n=_.find(b.lists,{id:Number(b.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.smsAccount&&(a=_.find(b.lists,{id:Number(b.smsAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.smsAccounts=e||{count:0,rows:[]}}function S(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.smsAccounts.rows,{id:e.id}),b.smsAccounts.count-=1,b.smsAccounts.rows.length||b.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSQUEUE",g.smsQueue=angular.copy(l),g.smsQueues=r,g.newSmsQueue=!1,g.smsQueue||(g.smsQueue={strategy:"beepall",timeout:10},g.title="SMS.NEW_SMSQUEUE",g.newSmsQueue=!0),g.addNewSmsQueue=function(){g.errors=[],d.smsQueue.save(g.smsQueue).$promise.then(function(e){g.smsQueues.unshift(e.toJSON()),o.success({title:"SmsQueue properly created",msg:g.smsQueue.name?g.smsQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsQueue=function(){g.errors=[],d.smsQueue.update({id:g.smsQueue.id},g.smsQueue).$promise.then(function(e){var t=_.find(g.smsQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsQueue properly saved!",msg:g.smsQueue.name?g.smsQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.smsQueue.delete({id:g.smsQueue.id}).$promise.then(function(){_.remove(g.smsQueues,{id:g.smsQueue.id}),o.success({title:"SmsQueue properly deleted!",msg:(g.smsQueue.name||"smsQueue")+" has been deleted!"}),v(g.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsQueues","smsQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("SMS.ALL_TEAMS"),labelSelected:n.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues")},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.smsQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="smsQueues",b.listOrder="",b.listOrderAsc=null,b.selectedSmsQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:b.smsQueues?b.smsQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:b.smsQueues?b.smsQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.sms.realtime.queues",{})}},b.success=y,b.getSmsQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.smsQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SmsQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSmsQueue=function(e,t){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:b.smsQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSmsQueue=S,b.exportSelectedSmsQueues=function(){var e=angular.copy(b.selectedSmsQueues);return b.selectedSmsQueues=[],e},b.deleteSelectedSmsQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+b.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSmsQueues.forEach(function(e){S(e)}),b.selectedSmsQueues=[]})},b.deselectSmsQueues=function(){b.selectedSmsQueues=[]},b.selectAllSmsQueues=function(){b.selectedSmsQueues=b.smsQueues.rows};var E=!0,A=1;function y(e){b.smsQueues=e||{count:0,rows:[]}}function S(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.smsQueues.rows,{id:e.id}),b.smsQueues.count-=1,b.smsQueues.rows.length||b.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.agents=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="agents",b.listOrder="",b.listOrderAsc=null,b.selectedAgents=[],b.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,page:1},b.arrayshowWebBar=_.keyBy([{option:"Phonebar",value:"0"},{option:"External",value:"1"},{option:"WebRTC",value:"2"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'",ngIf:"vm.agent.showWebBar == 1"},{option:"wss",value:"'wss'",ngIf:"vm.agent.showWebBar == 1"},{option:"tls",value:"'tls'",ngIf:"vm.agent.showWebBar == 1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayextensionMonitor=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:b.agents?b.agents.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getAgents=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Agents",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditAgent=function(e,t){i.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:t,agents:b.agents.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteAgent=S,b.exportSelectedAgents=function(){var e=angular.copy(b.selectedAgents);return b.selectedAgents=[],e},b.deleteSelectedAgents=function(e){var t=i.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+b.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedAgents.forEach(function(e){S(e)}),b.selectedAgents=[]})},b.deselectAgents=function(){b.selectedAgents=[]},b.selectAllAgents=function(){b.selectedAgents=b.agents.rows};var E=!0,A=1;function y(e){b.agents=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.agents.rows,{id:e.id}),b.agents.count-=1,b.agents.rows.length||b.getAgents(),p.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getAgents())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","agents","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_AGENT",g.agent=angular.copy(l),g.agents=r,g.newAgent=!1,g.agent||(g.agent={role:"agent",showWebBar:"0",autointernal:!0,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0},g.title="STAFF.NEW_AGENT",g.newAgent=!0),g.addNewAgent=function(){g.errors=[],d.user.save(g.agent).$promise.then(function(e){g.agents.unshift(e.toJSON()),o.success({title:"Agent properly created",msg:g.agent.name?g.agent.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveAgent=function(){g.errors=[],d.user.update({id:g.agent.id},g.agent).$promise.then(function(e){var t=_.find(g.agents,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Agent properly saved!",msg:g.agent.name?g.agent.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteAgent=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.agent.id}).$promise.then(function(){_.remove(g.agents,{id:g.agent.id}),o.success({title:"Agent properly deleted!",msg:(g.agent.name||"agent")+" has been deleted!"}),v(g.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","agents","agent","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.agent=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.agent=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.agent.id,newPassword:o.password};o.currentUser.id==o.agent.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"Agent password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,t,i,n,s){var o=this;o.agent={},o.navigation=n.getNavigation(),o.crudPermissions,o.init=function(e,t){o.agent=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,o.agent.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,o.agent.permissions.push(t.children[e].id);t.enabled=!0,o.agent.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d[c.apiName].get({fields:"id,name,strategy,type",channel:"bull"===c.channel?"voice":c.channel,type:c.direction,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:c.direction,channel:c.channel}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return"voice"===c.channel&&(t.penalty=void 0!==t&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.agent=t,c.crudPermissions=r,c.penalty=0,c.channel=n,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.QUEUEADD_AGENT_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_QUEUES_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),labelSelected:s.instant("STAFF.SELECTED_QUEUES_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(n,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){t(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentqueueaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.agent=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("STAFF.ALL_TEAMS"),labelSelected:n.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.user.addTeams({id:l.agent.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,t,i,s,n,a,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=a,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.agent=c||e.params.agent||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.queueaddchannel=function(e,t,n,a){i.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:u.agents?u.agents.rows:[],channel:t,direction:a||"inbound",crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:u.agents?u.agents.rows:[],crudPermissions:u.crudPermissions}})},u.changepassworddialog=function(e,t){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,setting:o,agents:u.agents?u.agents.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoAgents=function(){e.go("app.staff.agents")},u.saveAgent=function(){u.agent=_.omit(u.agent,"userpic"),r.user.update({id:u.agent.id},u.agent).$promise.then(function(){l.success({title:"Agent updated!",msg:u.agent.name?u.agent.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.agent&&(n=_.find(u.contexts,{name:u.agent.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var t=_.find(g.teams,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.team=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.team.removeAgents({id:c.team.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.team.addAgents({id:c.team.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.teams=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="teams",b.listOrder="",b.listOrderAsc=null,b.selectedTeams=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:b.teams.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:b.teams?b.teams.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTeams=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.team.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Teams",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTeam=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:t,teams:b.teams.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTeam=S,b.exportSelectedTeams=function(){var e=angular.copy(b.selectedTeams);return b.selectedTeams=[],e},b.deleteSelectedTeams=function(e){var t=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+b.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTeams.forEach(function(e){S(e)}),b.selectedTeams=[]})},b.deselectTeams=function(){b.selectedTeams=[]},b.selectAllTeams=function(){b.selectedTeams=b.teams.rows};var E=!0,A=1;function y(e){b.teams=e||{count:0,rows:[]}}function S(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(b.teams.rows,{id:e.id}),b.teams.count-=1,b.teams.rows.length||b.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var t=_.find(g.telephones,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.telephone=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.telephone.id,newPassword:o.password};o.currentUser.id==o.telephone.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"Telephone password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,t){n.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones")},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.telephone&&(n=_.find(u.contexts,{name:u.telephone.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.telephones=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="telephones",b.listOrder="",b.listOrderAsc=null,b.selectedTelephones=[],b.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTelephones=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Telephones",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTelephone=function(e,t){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:t,telephones:b.telephones.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTelephone=S,b.exportSelectedTelephones=function(){var e=angular.copy(b.selectedTelephones);return b.selectedTelephones=[],e},b.deleteSelectedTelephones=function(e){var t=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+b.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTelephones.forEach(function(e){S(e)}),b.selectedTelephones=[]})},b.deselectTelephones=function(){b.selectedTelephones=[]},b.selectAllTelephones=function(){b.selectedTelephones=b.telephones.rows};var E=!0,A=1;function y(e){b.telephones=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.telephones.rows,{id:e.id}),b.telephones.count-=1,b.telephones.rows.length||b.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"]},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var t,n;n=[],(t=e).crudPermissions.forEach(function(e){var t;switch(e){case"r":t="READ_PERMISSION";break;case"e":t="EDIT_PERMISSION";break;case"d":t="DELETE_PERMISSION"}n.push(s.instant("STAFF."+t))}),t.selectedcrudPermissions=n.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var t=_.find(g.userProfiles,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o){var r=this;function l(e){t.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(n),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),n&&n.name&&(r.title+=": "+n.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:n.id},r.userProfile).$promise.then(function(e){var t,n;n=[],(t=e).crudPermissions.forEach(function(e){var t;switch(e){case"r":t="READ_PERMISSION";break;case"e":t="EDIT_PERMISSION";break;case"d":t="DELETE_PERMISSION"}n.push(o.instant("STAFF."+t))}),t.selectedcrudPermissions=n.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(n,o,r,l,d,e,t,c){var m=this;function u(e,t){switch(e.allResourcesEnabled="full"===t,t){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(t,n){var i,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(t,n){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})).then(function(e){t(e)}).catch(function(e){n(e)}):(i=e,l(function(a,t){switch(i.route){case"voiceExtension":var e;switch(i.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"user":var n;switch(i.title){case"Agents":n="agent";break;case"Telephones":n="telephone";break;case"Users":n="user"}}if("Reports"===i.title){if(!i.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(n){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var t=_.union(n.rows,e.rows);a({count:t.length,rows:t.rows})})}).catch(function(e){t(e)});switch(i.reportType){case"default":i.route="analyticDefaultReport";break;case"custom":i.route="analyticCustomReport"}}return d[i.route].get({role:n||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){t(e)})})).then(function(e){t(e)}).catch(function(e){n(e)})})}function g(e,t,n){var a=e&&0<e.length?e[0]:null;if(!a)return n;var i,s,o=_.find(t,["sectionId",a.id]);return o?(t=_.remove(t,["sectionId",a.id]),(i=a,s=o.id,l(function(t,n){d.userProfileResource.get({sectionId:s}).$promise.then(function(t){return p(i).then(function(e){return _.differenceBy(t.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?t():n()}).catch(function(e){n(e)})})).then(function(){return n="full",g(e.shift(),t,n)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var n="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:n}).$promise.then(function(e){var t=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(t)?"disabled":t[0].autoAssociation?"full":d.userProfileResource.get({sectionId:t[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var n=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return t.length!==n.length?0===t.length?"disabled":"partial":_.every(t,["autoAssociation",!0])?"full":g(_.filter(n,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),t,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var t=e?"unknown":"partial";a.status=u(a,t),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+n.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var t=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,t)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,t){m.userProfile=e,m.license=t},m.onChangeEnableAllResources=function(t){var e=void 0!==t.permissions&&!t.permissions.association,a="Marketplace"===t.title?"AppZone":t.title;if("Fully Enabled"!==t.status.name){var i=[];if(e)return i.push({category:a,sectionId:t.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){t.status=u(t,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var n=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(t.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(n).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(t.children,function(e){var t=!(void 0===e.permissions||!e.permissions.hidden);if(!t){var n=e.title;switch(a){case"CallySquare":n="Projects"===n?"SquareProjects":n}i.push({category:a,sectionId:e.id,name:n,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){t.status=u(t,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):t.status=u(t,t.status.tag)})}else if("Fully Enabled"===t.status.name){t.status=u(t,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[t.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(t.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,t){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,s,t,o,e,a,r,i,l){var d=this;function c(){var a=void 0!==d.selectedSection.pending&&d.selectedSection.pending;return s(function(n,t){o.userProfileSection.get({userProfileId:d.userProfile.id,sectionId:d.selectedSection.id}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;a||(d.selectedSection.enabled=!!t&&!!t.enabled,d.selectedSection.autoAssociation=!!t&&!!t.autoAssociation,d.selectedSection.crudPermissions=p(t?t.crudPermissions:d.userProfile.crudPermissions)),n(t)}).catch(function(e){t(e)})})}function m(){return s(function(t,n){void 0!==d.selectedSection.channel&&_.includes(d.selectedSection.route,"Queue")?s(function(t,n){var e=void 0!==d.selectedSection.channel&&"bull"===d.selectedSection.channel?"outbound":"inbound";return o[d.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===d.selectedSection.channel?"voice":d.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){t(e)}).catch(function(e){n(e)}):s(function(t,n){var e,a;if("voiceExtension"===d.selectedSection.route)switch(d.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===d.selectedSection.route)switch(d.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===d.selectedSection.route)var i=!0;if("Reports"===d.selectedSection.title)switch(d.selectedSection.reportType){case"default":d.selectedSection.route="analyticDefaultReport";break;case"custom":d.selectedSection.route="analyticCustomReport"}if("Dashboards"!==d.selectedSection.title)return o[d.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)});t({count:1,rows:[{id:101,name:r.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){t(e)}).catch(function(e){n(e)})})}function u(){var a=void 0!==d.selectedSection.pending&&d.selectedSection.pending,i=[];return s(function(t,n){d.loadedSection?o.userProfileResource.get({sectionId:d.loadedSection.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)}):t(null)}).then(function(e){return i=e&&e.rows?e.rows:[],"Reports"===d.selectedSection.title&&(d.associatedReports=d.associatedReports?d.associatedReports:i,i=function(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.filter(e,{type:"DefaultReports"});break;case"custom":t=_.filter(e,{type:"CustomReports"})}return t}(d.associatedReports)),void 0===d.selectedSection.permissions||d.selectedSection.permissions.association?m():{rows:[]}}).then(function(e){d.items=e.rows?_.map(e.rows,function(e){var t,n;return"Reports"===d.selectedSection.title&&(e.fullPath=(t=e.parent,n=d.treeStructure[0].text,n=function e(t,n,a){if(!a||_.isEmpty(a.children))return t;var a=_.find(a.children,function(e){return _.includes(n,e.id)?e:void 0});return t+=a?"/"+a.text:"",e(t,n,a)}(n,t,d.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],a||(d.selectedSection.selectedItems=_.map(i,function(e){return _.find(d.items,{id:e.resourceId})}));var t=_.differenceBy(d.selectedSection.selectedItems,d.items,"id");switch(_.isEmpty(t)||(d.selectedSection.selectedItems=_.pullAllBy(d.selectedSection.selectedItems,t,"id")),d.selectedSection.title){case"Contexts":d.selectedSection.selectedItems=_.filter(d.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(i,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":d.selectedSection.selectedItems=_.filter(d.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(i,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var n=function(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.filter(e,function(e){return _.startsWith(e.parent,"motion")});break;case"custom":t=_.filter(e,function(e){return _.startsWith(e.parent,"custom")})}return t}(d.allReportsSelected);d.selectedSection.selectedItems=h(d.selectedSection.selectedItems),d.selectedSection.selectedItems=_.unionBy(d.selectedSection.selectedItems,n,"parent")}d.dualMultiselectOptions.selectedItems=d.selectedSection.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+d.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function p(e){return e&&(d.selectedSection.allowEdit=!!_.includes(e,"e"),d.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(d.selectedSection.allowEdit)e.push("e");else{var t=_.indexOf(e,["e"]);0<t&&d.selectedSection.crudPermissions.replace("e","")}if(d.selectedSection.allowDelete)e.push("d");else{var t=_.indexOf(e,["d"]);0<t&&d.selectedSection.crudPermissions.replace("d","")}return e}()}function g(e){var t=_.findIndex(d.subsections,function(e){return e.id==d.selectedSection.id});d.subsections[t].pending=e,v()}function v(){return d.pendingChanges=_.some(d.subsections,["pending",!0])}function h(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.remove(e,function(e){return _.startsWith(e.parent,"motion")});break;case"custom":t=_.remove(e,function(e){return _.startsWith(e.parent,"custom")})}return t}d.userProfile=e,d.penalty=0,d.section=angular.copy(l),d.title=r.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:r.instant(d.section.translate)}),d.items=[],d.selectedItems=[],d.subsections=_.filter(d.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),d.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],d.dashboardItems=[],"Dashboards"===d.section.title&&(d.dashboardItems=d.subsections,d.subsections=d.dashboardSections),d.selectedSection=null,d.loadedSection=null,d.closeDialog=function(e){if(d.pendingChanges){var t=n.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(r.instant("STAFF.CLOSE")).cancel(r.instant("STAFF.CANCEL"));n.show(t).then(function(){n.hide()})}else n.hide()},d.onChangeSection=function(){return c().then(function(e){if(d.loadedSection=e,"Reports"===d.selectedSection.title)return s(function(t,n){o.analyticTreeReport.get({}).$promise.then(function(e){d.treeReports=e.rows||[],t(d.treeReports)}).catch(function(e){n(e)})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});u()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+d.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},d.onChangeVisibility=function(){d.selectedSection.enabled=!d.selectedSection.enabled,g(!0)},d.onChangeAutoAssociation=function(){if(!d.selectedSection.autoAssociation){for(var e=[],t=0;t<d.dualMultiselectOptions.items.length;t++)e.push(d.dualMultiselectOptions.items[t]),d.dualMultiselectOptions.selectedItems.push(d.dualMultiselectOptions.items[t]);d.dualMultiselectOptions.items=[],d.dualMultiselectOptions.transferCallback(e,!1)}g(!0)},d.onChangeReportType=function(){d.treeStructure=function(){var e={};switch(d.selectedSection.reportType){case"default":e=d.treeReports[0]?angular.fromJson(d.treeReports[0].tree):[];break;case"custom":e=d.treeReports[1]?angular.fromJson(d.treeReports[1].tree):[]}return e}(),d.selectedSection.selectedItems&&(d.allReportsSelected=h(d.allReportsSelected),d.allReportsSelected=_.unionBy(d.allReportsSelected,d.selectedSection.selectedItems,"parent"));u()},d.setPermission=function(e){switch(e){case"edit":d.selectedSection.allowEdit=!d.selectedSection.allowEdit;break;case"delete":d.selectedSection.allowDelete=!d.selectedSection.allowDelete}d.selectedSection.crudPermissions=p(),g(!0)},d.saveSection=function(){var n="Marketplace"===d.section.title?"AppZone":d.section.title,e=_.map(_.filter(d.subsections,{pending:!0}),function(e){var t=e.selectedItems,a=e.title;switch("Reports"===a&&(t=_.unionBy(d.allReportsSelected,e.selectedItems,"parent")),n){case"CallySquare":a="Projects"===a?"SquareProjects":a;break;case"Integrations":e.autoAssociation=!0}return{category:n,sectionId:e.id,name:a,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:t?_.map(t,function(e){return{name:e.name,resourceId:e.id,type:(t=a,n=e,"Reports"!==t?t:(_.startsWith(n.parent,"motion")?"Default":"Custom")+t)};var t,n}):[]}});return o.userProfile.addSections({id:d.userProfile.id},e).$promise.then(function(){d.subsections.forEach(function(e){e.pending=void 0}),d.allReportsSelected=[],d.associatedReports=null,v(),t.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:r.instant(n.translate)}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return c().then(function(e){d.loadedSection=e})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.dualMultiselectOptions={readOnly:!1,items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:r.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:r.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),labelSearch:r.instant("STAFF.PERMISSIONS_PLACEHOLDER_SEARCH"),transferCallback:function(e,t){g(!0),t?(d.selectedSection.selectedItems=_.pullAllBy(d.selectedSection.selectedItems,e,"id"),d.selectedSection.autoAssociation=!1):d.selectedSection.selectedItems=_.unionBy(d.selectedSection.selectedItems,e,"id")}}}e.$inject=["$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,t){n.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,t){n.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles")},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.userProfiles=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="userProfiles",b.listOrder="",b.listOrderAsc=null,b.selectedUserProfiles=[],b.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions",sort:"-updatedAt",limit:10,page:1},b.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.userProfiles&&0<b.userProfiles.count&&b.userProfiles.rows.forEach(function(e){var t=[];e.crudPermissions.forEach(function(e){t.push(b.arraycrudPermissions[e].option)});var n=[];t.forEach(function(e){n.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=n.join(", ")}),b.editstate=function(e,t){n.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:b.userProfiles?b.userProfiles.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getUserProfiles=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.userProfile.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="UserProfiles",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditUserProfile=function(e,t){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:t,userProfiles:b.userProfiles.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteUserProfile=S,b.exportSelectedUserProfiles=function(){var e=angular.copy(b.selectedUserProfiles);return b.selectedUserProfiles=[],e},b.deleteSelectedUserProfiles=function(e){var t=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+b.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedUserProfiles.forEach(function(e){S(e)}),b.selectedUserProfiles=[]})},b.deselectUserProfiles=function(){b.selectedUserProfiles=[]},b.selectAllUserProfiles=function(){b.selectedUserProfiles=b.userProfiles.rows};var E=!0,A=1;function y(e){b.userProfiles=e||{count:0,rows:[]}}function S(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(b.userProfiles.rows,{id:e.id}),b.userProfiles.count-=1,b.userProfiles.rows.length||b.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USER",g.user=angular.copy(l),g.users=r,g.newUser=!1,g.user||(g.user={role:"user",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_USER",g.newUser=!0),g.addNewUser=function(){g.errors=[],d.user.save(g.user).$promise.then(function(e){g.users.unshift(e.toJSON()),o.success({title:"User properly created",msg:g.user.name?g.user.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUser=function(){g.errors=[],d.user.update({id:g.user.id},g.user).$promise.then(function(e){var t=_.find(g.users,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"User properly saved!",msg:g.user.name?g.user.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUser=function(e){if(c.getCurrentUser().id===g.user.id)return o.error({title:"User not deleted!",msg:"You can't remove yourself"});g.errors=[];var t=a.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.user.id}).$promise.then(function(){_.remove(g.users,{id:g.user.id}),o.success({title:"User properly deleted!",msg:(g.user.name||"user")+" has been deleted!"}),v(g.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","users","user","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],n.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",t.success({title:"User API key updated!"}),o()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],n.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",t.success({title:"User API key removed!"}),o()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.user=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.user=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.user.id,newPassword:o.password};o.currentUser.id==o.user.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"User password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.user=c||e.params.user||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.apikeymanagerdialog=function(e,t){n.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,users:u.users?u.users.rows:[],crudPermissions:u.crudPermissions}})},u.changepassworddialog=function(e,t){n.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,setting:o,users:u.users?u.users.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUsers=function(){e.go("app.staff.users")},u.saveUser=function(){u.user=_.omit(u.user,"userpic"),r.user.update({id:u.user.id},u.user).$promise.then(function(){l.success({title:"User updated!",msg:u.user.name?u.user.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.userProfiles=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.user.getApiKey({id:u.user.id}).$promise.then(function(e){u.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.users=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="users",b.listOrder="",b.listOrderAsc=null,b.selectedUsers=[],b.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",role:"admin,user",sort:"-updatedAt",limit:10,page:1},b.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getUsers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Users",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditUser=function(e,t){i.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:t,users:b.users.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteUser=S,b.exportSelectedUsers=function(){var e=angular.copy(b.selectedUsers);return b.selectedUsers=[],e},b.deleteSelectedUsers=function(e){var t=i.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+b.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedUsers.forEach(function(e){S(e)}),b.selectedUsers=[]})},b.deselectUsers=function(){b.selectedUsers=[]},b.selectAllUsers=function(){b.selectedUsers=b.users.rows},m.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.userProfiles=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.users=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.users.rows,{id:e.id}),b.users.count-=1,b.users.rows.length||b.getUsers(),p.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getUsers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","users","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.cannedAnswers=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="cannedAnswers",b.listOrder="",b.listOrderAsc=null,b.selectedCannedAnswers=[],b.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:b.cannedAnswers.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCannedAnswers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cannedAnswer.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="CannedAnswers",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCannedAnswer=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:t,cannedAnswers:b.cannedAnswers.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCannedAnswer=S,b.exportSelectedCannedAnswers=function(){var e=angular.copy(b.selectedCannedAnswers);return b.selectedCannedAnswers=[],e},b.deleteSelectedCannedAnswers=function(e){var t=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+b.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCannedAnswers.forEach(function(e){S(e)}),b.selectedCannedAnswers=[]})},b.deselectCannedAnswers=function(){b.selectedCannedAnswers=[]},b.selectAllCannedAnswers=function(){b.selectedCannedAnswers=b.cannedAnswers.rows};var E=!0,A=1;function y(e){b.cannedAnswers=e||{count:0,rows:[]}}function S(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(b.cannedAnswers.rows,{id:e.id}),b.cannedAnswers.count-=1,b.cannedAnswers.rows.length||b.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var t=_.find(g.cannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var t=_.find(g.customDashboards,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.customDashboards=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="customDashboards",b.listOrder="",b.listOrderAsc=null,b.selectedCustomDashboards=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:b.customDashboards?b.customDashboards.rows:[],crudPermissions:b.crudPermissions}})},b.gotodashboardgoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCustomDashboards=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.dashboard.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="CustomDashboards",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCustomDashboard=function(e,t){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:t,customDashboards:b.customDashboards.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCustomDashboard=S,b.exportSelectedCustomDashboards=function(){var e=angular.copy(b.selectedCustomDashboards);return b.selectedCustomDashboards=[],e},b.deleteSelectedCustomDashboards=function(e){var t=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+b.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCustomDashboards.forEach(function(e){S(e)}),b.selectedCustomDashboards=[]})},b.deselectCustomDashboards=function(){b.selectedCustomDashboards=[]},b.selectAllCustomDashboards=function(){b.selectedCustomDashboards=b.customDashboards.rows};var E=!0,A=1;function y(e){b.customDashboards=e||{count:0,rows:[]}}function S(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(b.customDashboards.rows,{id:e.id}),b.customDashboards.count-=1,b.customDashboards.rows.length||b.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),n.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(n,a,e,i,s){var o=this;function r(e,t,n){return s.dashboardItem.update(n).$promise.catch(function(e){console.error(e)})}o.customDashboard={},o.voiceQueues=s.rpc.getVoiceQueues({fields:"id,name"}),o.init=function(e,t){return o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},o.customDashboard=e,o.customDashboard.draggable={enabled:!0,handle:".draggable",stop:r},o.customDashboard.resizable={enabled:!0,handle:".resizable",stop:r},o.customDashboard.widgets=[],s.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].voiceQueues=o.voiceQueues,e.rows[t].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",o.customDashboard.widgets.push(e.rows[t])}).catch(function(e){console.error(e)})},o.createOrEditWidget=function(e){if(e&&e.attrs)for(var t=0;t<e.attrs.length;t+=1)"attrReport"===e.attrs[t].name&&(e.reportType=e.attrs[t].type),e[e.attrs[t].name]=e.attrs[t].value;n.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:o.customDashboard.widgets,license:null,setting:null,crudPermissions:o.crudPermissions}}).then(function(e){if(e)for(var t=0;t<o.customDashboard.widgets.length;t+=1)o.customDashboard.widgets[t].id===e.id&&(o.customDashboard.widgets[t].attrs=e.attrs,o.customDashboard.widgets[t].voiceQueues=o.voiceQueues,o.customDashboard.widgets[t].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),o.customDashboard.widgets[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+o.customDashboard.widgets[t].type+"/ms-widget-engine."+o.customDashboard.widgets[t].type+".html")})},o.deleteWidget=function(t){var e=n.confirm().title("Would you like to delete "+t.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");n.show(e).then(function(){return s.dashboardItem.delete({id:t.id}).$promise.then(function(e){_.remove(o.customDashboard.widgets,{id:t.id}),i.success({title:"Widget deleted!",msg:t.name?t.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(t,e,n,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var t=_.find(g.dashboard,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}t.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(t={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,t}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):t),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var t},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:A,select_node:b}:{loaded:y,select_node:E}}function b(e,t){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=t.node.id,S()}function E(e,t){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=t.node.id,S()}function A(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);E(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),T({count:n.length,rows:n})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],t=0;t<v.length;t++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<v.length;a++){var i=_.find(t,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;g.dashboarditem&&(n=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&h.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),g.voiceQueues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(n,e,a,i,t,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||n.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){n.go("app.tools.customDashboards")},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DISPOSITION",g.disposition=angular.copy(l),g.dispositions=r,g.newDisposition=!1,g.disposition||(g.disposition={},g.title="TOOLS.NEW_DISPOSITION",g.newDisposition=!0),g.addNewDisposition=function(){g.errors=[],d.disposition.save(g.disposition).$promise.then(function(e){g.dispositions.unshift(e.toJSON()),o.success({title:"Disposition properly created",msg:g.disposition.name?g.disposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDisposition=function(){g.errors=[],d.disposition.update({id:g.disposition.id},g.disposition).$promise.then(function(e){var t=_.find(g.dispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Disposition properly saved!",msg:g.disposition.name?g.disposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The disposition will be deleted.").ariaLabel("Delete Disposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.disposition.id}).$promise.then(function(){_.remove(g.dispositions,{id:g.disposition.id}),o.success({title:"Disposition properly deleted!",msg:(g.disposition.name||"disposition")+" has been deleted!"}),v(g.disposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dispositions","disposition","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.dispositions=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dispositions",b.listOrder="",b.listOrderAsc=null,b.selectedDispositions=[],b.query={fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{disposition:e,dispositions:b.dispositions.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("disposition")+"?").htmlContent("<b>"+(e.name||"disposition")+"</b> will be deleted.").ariaLabel("delete disposition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDispositions=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.disposition.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dispositions",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDisposition=function(e,t){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:t,dispositions:b.dispositions.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDisposition=S,b.exportSelectedDispositions=function(){var e=angular.copy(b.selectedDispositions);return b.selectedDispositions=[],e},b.deleteSelectedDispositions=function(e){var t=i.confirm().title("Are you sure want to delete the selected dispositions?").htmlContent("<b>"+b.selectedDispositions.length+" selected</b> will be deleted.").ariaLabel("delete Dispositions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDispositions.forEach(function(e){S(e)}),b.selectedDispositions=[]})},b.deselectDispositions=function(){b.selectedDispositions=[]},b.selectAllDispositions=function(){b.selectedDispositions=b.dispositions.rows};var E=!0,A=1;function y(e){b.dispositions=e||{count:0,rows:[]}}function S(e){m.disposition.delete({id:e.id}).$promise.then(function(){_.remove(b.dispositions.rows,{id:e.id}),b.dispositions.count-=1,b.dispositions.rows.length||b.getDispositions(),p.success({title:_.startCase("Disposition")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDispositions())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var t=_.find(g.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.interval={},c.intervalIntervals={count:0,rows:[]},c.selectedIntervalIntervals=[],c.crudPermissions,c.sortableTable={animation:100,onSort:function(e){l.interval.addIntervals({id:c.interval.id},e.models).$promise.then(function(e){c.intervalIntervals.rows=e}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},c.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},c.init=function(e,t){c.interval=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,c.query.id=c.interval.id,c.getIntervalIntervals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIntervalIntervals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.interval.getIntervals(c.query,p).$promise},c.createOrEditIntervalInterval=function(e,t){s.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:c.interval,interval:t,intervals:c.intervalIntervals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIntervalIntervals=function(){var e=angular.copy(c.selectedIntervalIntervals);return c.selectedIntervalIntervals=[],e},c.deleteIntervalInterval=g,c.deleteSelectedIntervalIntervals=function(e){var t=s.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+c.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIntervalIntervals.forEach(function(e){g(e)}),c.selectedIntervalIntervals=[]})};var m=!0,u=1;function p(e){c.intervalIntervals=e||{count:0,rows:[]}}function g(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(c.intervalIntervals.rows,{id:e.id}),c.intervalIntervals.count-=1,c.intervalIntervals.rows.length||c.getIntervalIntervals(),r.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIntervalIntervals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var t=_.find(g.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals")},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.intervals=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="intervals",b.listOrder="",b.listOrderAsc=null,b.selectedIntervals=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getIntervals=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.interval.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Intervals",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInterval=function(e,t){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:t,intervals:b.intervals.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInterval=S,b.exportSelectedIntervals=function(){var e=angular.copy(b.selectedIntervals);return b.selectedIntervals=[],e},b.deleteSelectedIntervals=function(e){var t=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+b.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedIntervals.forEach(function(e){S(e)}),b.selectedIntervals=[]})},b.deselectIntervals=function(){b.selectedIntervals=[]},b.selectAllIntervals=function(){b.selectedIntervals=b.intervals.rows};var E=!0,A=1;function y(e){b.intervals=e||{count:0,rows:[]}}function S(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(b.intervals.rows,{id:e.id}),b.intervals.count-=1,b.intervals.rows.length||b.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var t=_.find(g.pauses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.pauses=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="pauses",b.listOrder="",b.listOrderAsc=null,b.selectedPauses=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{pause:e,pauses:b.pauses.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getPauses=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.pause.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Pauses",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditPause=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:t,pauses:b.pauses.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletePause=S,b.exportSelectedPauses=function(){var e=angular.copy(b.selectedPauses);return b.selectedPauses=[],e},b.deleteSelectedPauses=function(e){var t=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+b.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedPauses.forEach(function(e){S(e)}),b.selectedPauses=[]})},b.deselectPauses=function(){b.selectedPauses=[]},b.selectAllPauses=function(){b.selectedPauses=b.pauses.rows};var E=!0,A=1;function y(e){b.pauses=e||{count:0,rows:[]}}function S(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(b.pauses.rows,{id:e.id}),b.pauses.count-=1,b.pauses.rows.length||b.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:E,select_node:f}:{loaded:A,select_node:b}}function f(e,t){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=t.node.id,y()}function b(e,t){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=t.node.id,y()}function E(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function A(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),S({count:n.length,rows:n})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var t=_.find(g.schedules,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(t={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,t}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):t),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var t},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),n=null;if(g.schedule&&(n=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}g.mailAccounts=t})}else{var n=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,n.push(g.mailAccounts[i]));g.mailAccounts=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.schedules=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="schedules",b.listOrder="",b.listOrderAsc=null,b.selectedScheduler=[],b.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},b.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{schedule:e,schedules:b.schedules.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.runconfirm=function(e,t){var n=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getScheduler=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.schedule.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Scheduler",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSchedule=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:t,schedules:b.schedules.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSchedule=S,b.exportSelectedScheduler=function(){var e=angular.copy(b.selectedScheduler);return b.selectedScheduler=[],e},b.deleteSelectedScheduler=function(e){var t=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+b.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedScheduler.forEach(function(e){S(e)}),b.selectedScheduler=[]})},b.deselectScheduler=function(){b.selectedScheduler=[]},b.selectAllScheduler=function(){b.selectedScheduler=b.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){b.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.mailAccounts,{id:e.resourceId})}),n=null;if(b.schedule&&(n=_.find(b.mailAccounts,{id:Number(b.schedule.MailAccountId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}b.mailAccounts=t})}else{var n=[],a=null;b.schedule&&(a=_.find(b.mailAccounts,{id:Number(b.schedule.MailAccountId)}));for(var i=0;i<b.mailAccounts.length;i++)a&&b.mailAccounts[i].id===a.id&&(b.mailAccounts[i].canSelect=!1,n.push(b.mailAccounts[i]));b.mailAccounts=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.schedules=e||{count:0,rows:[]}}function S(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(b.schedules.rows,{id:e.id}),b.schedules.count-=1,b.schedules.rows.length||b.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var t=_.find(g.sounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.sounds=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="sounds",b.listOrder="",b.listOrderAsc=null,b.selectedSounds=[],b.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{sound:e,sounds:b.sounds.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSounds=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.sound.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Sounds",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSound=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:t,sounds:b.sounds.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSound=S,b.exportSelectedSounds=function(){var e=angular.copy(b.selectedSounds);return b.selectedSounds=[],e},b.deleteSelectedSounds=function(e){var t=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+b.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSounds.forEach(function(e){S(e)}),b.selectedSounds=[]})},b.deselectSounds=function(){b.selectedSounds=[]},b.selectAllSounds=function(){b.selectedSounds=b.sounds.rows},b.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:b.sounds.rows}})};var E=!0,A=1;function y(e){b.sounds=e||{count:0,rows:[]}}function S(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(b.sounds.rows,{id:e.id}),b.sounds.count-=1,b.sounds.rows.length||b.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["wav","mp3","gsm"];if(!_.includes(t,e.getExtension()))return n.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>l)return n.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result}}})},o.uploadError=function(e,t){o.ngFlow.flow.cancel(),n.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",n.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var t=_.find(g.tags,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.tags=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="tags",b.listOrder="",b.listOrderAsc=null,b.selectedTags=[],b.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{tag:e,tags:b.tags.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTags=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.tag.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Tags",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTag=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:t,tags:b.tags.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTag=S,b.exportSelectedTags=function(){var e=angular.copy(b.selectedTags);return b.selectedTags=[],e},b.deleteSelectedTags=function(e){var t=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+b.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTags.forEach(function(e){S(e)}),b.selectedTags=[]})},b.deselectTags=function(){b.selectedTags=[]},b.selectAllTags=function(){b.selectedTags=b.tags.rows};var E=!0,A=1;function y(e){b.tags=e||{count:0,rows:[]}}function S(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(b.tags.rows,{id:e.id}),b.tags.count-=1,b.tags.rows.length||b.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var t=_.find(g.templates,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.templates=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="templates",b.listOrder="",b.listOrderAsc=null,b.selectedTemplates=[],b.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{template:e,templates:b.templates.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTemplates=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.template.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Templates",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTemplate=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:t,templates:b.templates.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTemplate=S,b.exportSelectedTemplates=function(){var e=angular.copy(b.selectedTemplates);return b.selectedTemplates=[],e},b.deleteSelectedTemplates=function(e){var t=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+b.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTemplates.forEach(function(e){S(e)}),b.selectedTemplates=[]})},b.deselectTemplates=function(){b.selectedTemplates=[]},b.selectAllTemplates=function(){b.selectedTemplates=b.templates.rows};var E=!0,A=1;function y(e){b.templates=e||{count:0,rows:[]}}function S(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(b.templates.rows,{id:e.id}),b.templates.count-=1,b.templates.rows.length||b.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRIGGER",g.trigger=angular.copy(l),g.triggers=r,g.newTrigger=!1,g.trigger||(g.trigger={channel:"voice"},g.title="TOOLS.NEW_TRIGGER",g.newTrigger=!0),g.addNewTrigger=function(){g.errors=[],d.trigger.save(g.trigger).$promise.then(function(e){g.triggers.unshift(e.toJSON()),o.success({title:"Trigger properly created",msg:g.trigger.name?g.trigger.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrigger=function(){g.errors=[],d.trigger.update({id:g.trigger.id},g.trigger).$promise.then(function(e){var t=_.find(g.triggers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Trigger properly saved!",msg:g.trigger.name?g.trigger.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrigger=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The trigger will be deleted.").ariaLabel("Delete Trigger").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.trigger.delete({id:g.trigger.id}).$promise.then(function(){_.remove(g.triggers,{id:g.trigger.id}),o.success({title:"Trigger properly deleted!",msg:(g.trigger.name||"trigger")+" has been deleted!"}),v(g.trigger)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerActions={count:0,rows:[]},c.selectedTriggerActions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,action,data1,data2,data7,data3,data4,data5,data6",limit:10,page:1},c.arrayaction=_.keyBy([{option:"CONTACT_MANAGER",value:"'contactManager'",ngIf:"vm.trigger.channel == 'voice'"},{option:"INTEGRATIONS",value:"'integration'",ngIf:"vm.trigger.channel == 'voice' && ((vm.newAction && vm.hasModulePermissions.Integrations) || !vm.newAction)"},{option:"MOTION_BAR",value:"'motionbar'"},{option:"JSCRIPTY",value:"'jscripty'"},{option:"URL_FORWARD",value:"'urlForward'"},{option:"BROWSER",value:"'browser'"},{option:"BOT",value:"'bot'",ngIf:"vm.trigger.channel == 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.browserValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.autoCreateContact=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.urlForwardValues=_.keyBy([{option:"GET",value:"'GET'"},{option:"POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.integrationValues=_.keyBy([{option:"Zendesk",value:"'zendesk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1301])"},{option:"Salesforce",value:"'salesforce'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1302])"},{option:"SugarCRM",value:"'sugarcrm'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1305])"},{option:"Freshdesk",value:"'freshdesk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1303])"},{option:"Desk",value:"'desk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1306])"},{option:"Zoho",value:"'zoho'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1307])"},{option:"vTiger",value:"'vtiger'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1308])"},{option:"Dynamics365",value:"'dynamics365'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1309])"},{option:"ServiceNow",value:"'servicenow'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1310])"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.motionbarValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"},{option:"Windows App",value:"'2'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.eventVariables=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.location=_.keyBy([{option:"NEW_TAB",value:"'0'"},{option:"NEW_WINDOW",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.ActionId=c.trigger.id,c.getTriggerActions(),n=[1301,1302,1303,1305,1306,1307,1308],d.hasModulesPermissions(["Integrations"]).then(function(e){c.hasModulePermissions=_.merge(c.hasModulePermissions,e)}).then(function(){d.hasSectionsPermissions(n).then(function(e){c.hasSectionPermissions=_.merge(c.hasSectionPermissions,e)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTEGRATIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})});var n},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the action?").htmlContent("<b>"+(e.name||"action")+"</b> will be deleted.").ariaLabel("delete action").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getActions(c.query,p).$promise},c.createOrEditTriggerAction=function(e,t){s.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,action:t,actions:c.triggerActions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerActions=function(){var e=angular.copy(c.selectedTriggerActions);return c.selectedTriggerActions=[],e},c.deleteTriggerAction=g,c.deleteSelectedTriggerActions=function(e){var t=s.confirm().title("Are you sure want to delete the selected actions?").htmlContent("<b>"+c.selectedTriggerActions.length+" selected</b> will be deleted.").ariaLabel("delete actions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedTriggerActions.forEach(function(e){g(e)}),c.selectedTriggerActions=[]})},d.hasRole("admin")?l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.lists,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var t=_.find(c.lists,{id:Number(e.data1)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.lists,{id:e.id});t.canSelect=!1,n.push(t)}}),c.lists=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var t=_.find(c.lists,{id:Number(e.data1)});a.push(t)}});for(var i=0;i<c.lists.length;i++){_.some(a,{id:c.lists[i].id})&&(c.lists[i].canSelect=!1,n.push(c.lists[i]))}c.lists=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.projects,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var t=_.find(c.projects,{id:Number(e.data1)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.projects,{id:e.id});t.canSelect=!1,n.push(t)}}),c.projects=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var t=_.find(c.projects,{id:Number(e.data1)});a.push(t)}});for(var i=0;i<c.projects.length;i++){_.some(a,{id:c.projects[i].id})&&(c.projects[i].canSelect=!1,n.push(c.projects[i]))}c.projects=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCEACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intVtigerAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.vtigerAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDynamics365Account.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.dynamics365Accounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intServicenowAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.servicenowAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCECONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intVtigerConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.vtigerConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDynamics365Configuration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.dynamics365Configurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intServicenowConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.servicenowConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.templates,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("motionbar"===e.action){var t=_.find(c.templates,{id:Number(e.data2)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.templates,{id:e.id});t.canSelect=!1,n.push(t)}}),c.templates=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("motionbar"===e.action){var t=_.find(c.templates,{id:Number(e.data2)});a.push(t)}});for(var i=0;i<c.templates.length;i++){_.some(a,{id:c.templates[i].id})&&(c.templates[i].canSelect=!1,n.push(c.templates[i]))}c.templates=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerActions=e||{count:0,rows:[]}}function g(e){l.action.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerActions.rows,{id:e.id}),c.triggerActions.count-=1,c.triggerActions.rows.length||c.getTriggerActions(),r.success({title:"Action deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ACTION",v.action=angular.copy(l),v.actions=r,v.newAction=!1,v.trigger=angular.copy(d),v.action||(v.action={data3:"0",data4:"0",data5:"800",data6:"600"},v.title="TOOLS.NEW_ACTION",v.newAction=!0),t.params.id&&(v.action.ActionId=t.params.id),v.addNewAction=function(){v.errors=[],c.trigger.addAction({id:t.params.id},v.action).$promise.then(function(e){v.actions.unshift(e.toJSON()),o.success({title:"Action properly created",msg:v.action.name?v.action.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAction=function(){v.errors=[],c.action.update({id:v.action.id},v.action).$promise.then(function(e){var t=_.find(v.actions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Action properly saved!",msg:v.action.name?v.action.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAction=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The action will be deleted.").ariaLabel("Delete Action").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.action.delete({id:v.action.id}).$promise.then(function(){_.remove(v.actions,{id:v.action.id}),o.success({title:"Action properly deleted!",msg:(v.action.name||"action")+" has been deleted!"}),h(v.action)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.onActionInit=function(){m.hasModulesPermissions(["Integrations"]).then(function(e){v.hasModulePermissions=_.merge(v.hasModulePermissions,e)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULES_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.onIntegrationInit=function(){m.hasSectionsPermissions([1301,1302,1303,1305,1306,1307,1308,1309,1310]).then(function(e){v.hasSectionPermissions=_.merge(v.hasSectionPermissions,e)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.closeDialog=h,m.hasRole("admin")?c.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.lists=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.lists,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.lists,{id:Number(v.action.data1)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.lists,{id:n.id});a.canSelect=!1,t.push(a)}v.lists=t})}else{var n=[],a=null;v.action&&(a=_.find(v.lists,{id:Number(v.action.data1)}));for(var i=0;i<v.lists.length;i++)a&&v.lists[i].id===a.id&&(v.lists[i].canSelect=!1,n.push(v.lists[i]));v.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.projects=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.projects,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.projects,{id:Number(v.action.data1)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.projects,{id:n.id});a.canSelect=!1,t.push(a)}v.projects=t})}else{var n=[],a=null;v.action&&(a=_.find(v.projects,{id:Number(v.action.data1)}));for(var i=0;i<v.projects.length;i++)a&&v.projects[i].id===a.id&&(v.projects[i].canSelect=!1,n.push(v.projects[i]));v.projects=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zendeskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.deskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zohoAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.salesforceAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCEACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.sugarcrmAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.freshdeskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.vtigerAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.dynamics365Accounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.servicenowAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zendeskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.deskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zohoConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.salesforceConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCECONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.sugarcrmConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.freshdeskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.vtigerConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Configuration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.dynamics365Configurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.servicenowConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.templates=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.templates=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.templates,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.templates,{id:Number(v.action.data2)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.templates,{id:n.id});a.canSelect=!1,t.push(a)}v.templates=t})}else{var n=[],a=null;v.action&&(a=_.find(v.templates,{id:Number(v.action.data2)}));for(var i=0;i<v.templates.length;i++)a&&v.templates[i].id===a.id&&(v.templates[i].canSelect=!1,n.push(v.templates[i]));v.templates=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,t,n,o,a,i,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAllConditions={count:0,rows:[]},c.selectedTriggerAllConditions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,field,operator,value",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.TriggerAllId=c.trigger.id,c.getTriggerAllConditions()},c.deleteConfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the allCondition?").htmlContent("<b>"+(e.name||"allCondition")+"</b> will be deleted.").ariaLabel("delete allCondition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},c.success=v,c.getTriggerAllConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAllConditions(c.query,v).$promise},c.createOrEditTriggerAllCondition=function(e,t){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,allCondition:t,allconditions:c.triggerAllConditions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerAllConditions=function(){var e=angular.copy(c.selectedTriggerAllConditions);return c.selectedTriggerAllConditions=[],e},c.deleteTriggerAllCondition=h,c.deleteSelectedTriggerAllConditions=function(e){var t=i.confirm().title("Are you sure want to delete the selected allconditions?").htmlContent("<b>"+c.selectedTriggerAllConditions.length+" selected</b> will be deleted.").ariaLabel("delete allconditions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){c.selectedTriggerAllConditions.forEach(function(e){h(e)}),c.selectedTriggerAllConditions=[]})},d.hasRole("admin")?l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.chatAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.chatAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.chatAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.chatAccounts.length;i++){_.some(a,{id:c.chatAccounts[i].id})&&(c.chatAccounts[i].canSelect=!1,n.push(c.chatAccounts[i]))}c.chatAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.mailAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.mailAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.mailAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.mailAccounts.length;i++){_.some(a,{id:c.mailAccounts[i].id})&&(c.mailAccounts[i].canSelect=!1,n.push(c.mailAccounts[i]))}c.mailAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.smsAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.smsAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.smsAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.smsAccounts.length;i++){_.some(a,{id:c.smsAccounts[i].id})&&(c.smsAccounts[i].canSelect=!1,n.push(c.smsAccounts[i]))}c.smsAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.faxAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.faxAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.faxAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.faxAccounts.length;i++){_.some(a,{id:c.faxAccounts[i].id})&&(c.faxAccounts[i].canSelect=!1,n.push(c.faxAccounts[i]))}c.faxAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.openchannelAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.openchannelAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.openchannelAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.openchannelAccounts.length;i++){_.some(a,{id:c.openchannelAccounts[i].id})&&(c.openchannelAccounts[i].canSelect=!1,n.push(c.openchannelAccounts[i]))}c.openchannelAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],u=null;d.hasRole("admin")?l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.type===m[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(l.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("queue"===e.field){var t=_.find(u,{name:e.value});a.push(t)}});for(var t=0;t<e.length;t++){(e[t].rows||[]).forEach(function(e){n.push(e)})}_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["resourceId",e.id])){var t=_.find(u,{id:e.id});t.canSelect=!1,n.push(t)}}),c.queues=n}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.outboundRoutes,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.outboundRoutes,{id:e.id});t.canSelect=!1,n.push(t)}}),c.outboundRoutes=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.outboundRoutes.length;i++){_.some(a,{id:c.outboundRoutes[i].id})&&(c.outboundRoutes[i].canSelect=!1,n.push(c.outboundRoutes[i]))}c.outboundRoutes=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var p=!0,g=1;function v(e){c.triggerAllConditions=e||{count:0,rows:[]}}function h(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAllConditions.rows,{id:e.id}),c.triggerAllConditions.count-=1,c.triggerAllConditions.rows.length||c.getTriggerAllConditions(),r.success({title:"AllCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){p?a(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getTriggerAllConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,o,i,s,r,l,d,c,m,u,p,g){var v=this;v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ALLCONDITION",v.allCondition=angular.copy(l),v.allconditions=r,v.newAllCondition=!1,v.trigger=angular.copy(d),v.allCondition||(v.allCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},v.title="TOOLS.NEW_ALLCONDITION",v.newAllCondition=!0),t.params.id&&(v.allCondition.TriggerAllId=t.params.id),v.addNewAllCondition=function(){v.errors=[],c.trigger.addAllCondition({id:t.params.id},v.allCondition).$promise.then(function(e){v.allconditions.unshift(e.toJSON()),s.success({title:"AllCondition properly created",msg:v.allCondition.name?v.allCondition.name+" has been created!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAllCondition=function(){v.errors=[],c.condition.update({id:v.allCondition.id},v.allCondition).$promise.then(function(e){var t=_.find(v.allconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"AllCondition properly saved!",msg:v.allCondition.name?v.allCondition.name+" has been saved!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAllCondition=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The allCondition will be deleted.").ariaLabel("Delete AllCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.condition.delete({id:v.allCondition.id}).$promise.then(function(){_.remove(v.allconditions,{id:v.allCondition.id}),s.success({title:"AllCondition properly deleted!",msg:(v.allCondition.name||"allCondition")+" has been deleted!"}),b(v.allCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=b,m.hasRole("admin")?c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.chatAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.chatAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.chatAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.chatAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.chatAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.chatAccounts.length;i++)a&&v.chatAccounts[i].id===a.id&&(v.chatAccounts[i].canSelect=!1,n.push(v.chatAccounts[i]));v.chatAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.mailAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.mailAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.mailAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.mailAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.mailAccounts.length;i++)a&&v.mailAccounts[i].id===a.id&&(v.mailAccounts[i].canSelect=!1,n.push(v.mailAccounts[i]));v.mailAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.smsAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.smsAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.smsAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.smsAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.smsAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.smsAccounts.length;i++)a&&v.smsAccounts[i].id===a.id&&(v.smsAccounts[i].canSelect=!1,n.push(v.smsAccounts[i]));v.smsAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.faxAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.faxAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.faxAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.faxAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.faxAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.faxAccounts.length;i++)a&&v.faxAccounts[i].id===a.id&&(v.faxAccounts[i].canSelect=!1,n.push(v.faxAccounts[i]));v.faxAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.openchannelAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.openchannelAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.openchannelAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.openchannelAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.openchannelAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.openchannelAccounts.length;i++)a&&v.openchannelAccounts[i].id===a.id&&(v.openchannelAccounts[i].canSelect=!1,n.push(v.openchannelAccounts[i]));v.openchannelAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],f=null;function b(e){a.hide(e)}m.hasRole("admin")?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){v.queues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){f=e.rows||[]}).then(function(){for(var e=[],t=0;t<h.length;t++)e.push(c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:h[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<h.length;a++){var i=_.find(t,["sectionId",h[a].id]);if(i)if(i.autoAssociation){var s=[];f.forEach(function(e){e.type===h[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(c.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;v.allCondition&&(n=_.find(f,{name:v.allCondition.value}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&f.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),v.queues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.outboundRoutes,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.outboundRoutes,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}v.outboundRoutes=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.outboundRoutes,{id:Number(v.allCondition.value)}));for(var i=0;i<v.outboundRoutes.length;i++)a&&v.outboundRoutes[i].id===a.id&&(v.outboundRoutes[i].canSelect=!1,n.push(v.outboundRoutes[i]));v.outboundRoutes=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","allconditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,o,a,i,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAnyConditions={count:0,rows:[]},c.selectedTriggerAnyConditions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,field,operator,value",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.TriggerAnyId=c.trigger.id,c.getTriggerAnyConditions()},c.deleteConfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the anyCondition?").htmlContent("<b>"+(e.name||"anyCondition")+"</b> will be deleted.").ariaLabel("delete anyCondition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},c.success=v,c.getTriggerAnyConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAnyConditions(c.query,v).$promise},c.createOrEditTriggerAnyCondition=function(e,t){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,anyCondition:t,anyconditions:c.triggerAnyConditions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerAnyConditions=function(){var e=angular.copy(c.selectedTriggerAnyConditions);return c.selectedTriggerAnyConditions=[],e},c.deleteTriggerAnyCondition=h,c.deleteSelectedTriggerAnyConditions=function(e){var t=i.confirm().title("Are you sure want to delete the selected anyconditions?").htmlContent("<b>"+c.selectedTriggerAnyConditions.length+" selected</b> will be deleted.").ariaLabel("delete anyconditions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){c.selectedTriggerAnyConditions.forEach(function(e){h(e)}),c.selectedTriggerAnyConditions=[]})},d.hasRole("admin")?l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.chatAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.chatAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.chatAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.chatAccounts.length;i++){_.some(a,{id:c.chatAccounts[i].id})&&(c.chatAccounts[i].canSelect=!1,n.push(c.chatAccounts[i]))}c.chatAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.mailAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.mailAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.mailAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.mailAccounts.length;i++){_.some(a,{id:c.mailAccounts[i].id})&&(c.mailAccounts[i].canSelect=!1,n.push(c.mailAccounts[i]))}c.mailAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.smsAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.smsAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.smsAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.smsAccounts.length;i++){_.some(a,{id:c.smsAccounts[i].id})&&(c.smsAccounts[i].canSelect=!1,n.push(c.smsAccounts[i]))}c.smsAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.faxAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.faxAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.faxAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.faxAccounts.length;i++){_.some(a,{id:c.faxAccounts[i].id})&&(c.faxAccounts[i].canSelect=!1,n.push(c.faxAccounts[i]))}c.faxAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.openchannelAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.openchannelAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.openchannelAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.openchannelAccounts.length;i++){_.some(a,{id:c.openchannelAccounts[i].id})&&(c.openchannelAccounts[i].canSelect=!1,n.push(c.openchannelAccounts[i]))}c.openchannelAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],u=null;d.hasRole("admin")?l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.type===m[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(l.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("queue"===e.field){var t=_.find(u,{name:e.value});a.push(t)}});for(var t=0;t<e.length;t++){(e[t].rows||[]).forEach(function(e){n.push(e)})}_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["resourceId",e.id])){var t=_.find(u,{id:e.id});t.canSelect=!1,n.push(t)}}),c.queues=n}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.outboundRoutes,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.outboundRoutes,{id:e.id});t.canSelect=!1,n.push(t)}}),c.outboundRoutes=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.outboundRoutes.length;i++){_.some(a,{id:c.outboundRoutes[i].id})&&(c.outboundRoutes[i].canSelect=!1,n.push(c.outboundRoutes[i]))}c.outboundRoutes=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var p=!0,g=1;function v(e){c.triggerAnyConditions=e||{count:0,rows:[]}}function h(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAnyConditions.rows,{id:e.id}),c.triggerAnyConditions.count-=1,c.triggerAnyConditions.rows.length||c.getTriggerAnyConditions(),r.success({title:"AnyCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){p?a(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getTriggerAnyConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,o,i,s,r,l,d,c,m,u,p,g){var v=this;v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ANYCONDITION",v.anyCondition=angular.copy(l),v.anyconditions=r,v.newAnyCondition=!1,v.trigger=angular.copy(d),v.anyCondition||(v.anyCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},v.title="TOOLS.NEW_ANYCONDITION",v.newAnyCondition=!0),t.params.id&&(v.anyCondition.TriggerAnyId=t.params.id),v.addNewAnyCondition=function(){v.errors=[],c.trigger.addAnyCondition({id:t.params.id},v.anyCondition).$promise.then(function(e){v.anyconditions.unshift(e.toJSON()),s.success({title:"AnyCondition properly created",msg:v.anyCondition.name?v.anyCondition.name+" has been created!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAnyCondition=function(){v.errors=[],c.condition.update({id:v.anyCondition.id},v.anyCondition).$promise.then(function(e){var t=_.find(v.anyconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"AnyCondition properly saved!",msg:v.anyCondition.name?v.anyCondition.name+" has been saved!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAnyCondition=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The anyCondition will be deleted.").ariaLabel("Delete AnyCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.condition.delete({id:v.anyCondition.id}).$promise.then(function(){_.remove(v.anyconditions,{id:v.anyCondition.id}),s.success({title:"AnyCondition properly deleted!",msg:(v.anyCondition.name||"anyCondition")+" has been deleted!"}),b(v.anyCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=b,m.hasRole("admin")?c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.chatAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.chatAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.chatAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.chatAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.chatAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.chatAccounts.length;i++)a&&v.chatAccounts[i].id===a.id&&(v.chatAccounts[i].canSelect=!1,n.push(v.chatAccounts[i]));v.chatAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.mailAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.mailAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.mailAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.mailAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.mailAccounts.length;i++)a&&v.mailAccounts[i].id===a.id&&(v.mailAccounts[i].canSelect=!1,n.push(v.mailAccounts[i]));v.mailAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.smsAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.smsAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.smsAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.smsAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.smsAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.smsAccounts.length;i++)a&&v.smsAccounts[i].id===a.id&&(v.smsAccounts[i].canSelect=!1,n.push(v.smsAccounts[i]));v.smsAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.faxAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.faxAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.faxAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.faxAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.faxAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.faxAccounts.length;i++)a&&v.faxAccounts[i].id===a.id&&(v.faxAccounts[i].canSelect=!1,n.push(v.faxAccounts[i]));v.faxAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.openchannelAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.openchannelAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.openchannelAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.openchannelAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.openchannelAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.openchannelAccounts.length;i++)a&&v.openchannelAccounts[i].id===a.id&&(v.openchannelAccounts[i].canSelect=!1,n.push(v.openchannelAccounts[i]));v.openchannelAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],f=null;function b(e){a.hide(e)}m.hasRole("admin")?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){v.queues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){f=e.rows||[]}).then(function(){for(var e=[],t=0;t<h.length;t++)e.push(c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:h[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<h.length;a++){var i=_.find(t,["sectionId",h[a].id]);if(i)if(i.autoAssociation){var s=[];f.forEach(function(e){e.type===h[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(c.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;v.anyCondition&&(n=_.find(f,{name:v.anyCondition.value}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&f.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),v.queues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.outboundRoutes,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.outboundRoutes,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}v.outboundRoutes=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.outboundRoutes,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.outboundRoutes.length;i++)a&&v.outboundRoutes[i].id===a.id&&(v.outboundRoutes[i].canSelect=!1,n.push(v.outboundRoutes[i]));v.outboundRoutes=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","anyconditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.trigger=c||e.params.trigger||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoTriggers=function(){e.go("app.tools.triggers")},u.saveTrigger=function(){r.trigger.update({id:u.trigger.id},u.trigger).$promise.then(function(){l.success({title:"Trigger updated!",msg:u.trigger.name?u.trigger.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.triggers=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="triggers",b.listOrder="",b.listOrderAsc=null,b.selectedTriggers=[],b.query={fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,page:1},b.arraychannel=_.keyBy([{option:"Voice",value:"'voice'"},{option:"Openchannel",value:"'openchannel'",ngIf:"vm.license.openchannel"},{option:"Chat",value:"'chat'",ngIf:"vm.license.chat"},{option:"Mail",value:"'mail'",ngIf:"vm.license.mail"},{option:"Sms",value:"'sms'",ngIf:"vm.license.messaging"},{option:"Fax",value:"'fax'",ngIf:"vm.license.fax"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("trigger")+"?").htmlContent("<b>"+(e.name||"trigger")+"</b> will be deleted.").ariaLabel("delete trigger").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTriggers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.trigger.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Triggers",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTrigger=function(e,t){i.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:t,triggers:b.triggers.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTrigger=S,b.exportSelectedTriggers=function(){var e=angular.copy(b.selectedTriggers);return b.selectedTriggers=[],e},b.deleteSelectedTriggers=function(e){var t=i.confirm().title("Are you sure want to delete the selected triggers?").htmlContent("<b>"+b.selectedTriggers.length+" selected</b> will be deleted.").ariaLabel("delete Triggers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTriggers.forEach(function(e){S(e)}),b.selectedTriggers=[]})},b.deselectTriggers=function(){b.selectedTriggers=[]},b.selectAllTriggers=function(){b.selectedTriggers=b.triggers.rows};var E=!0,A=1;function y(e){b.triggers=e||{count:0,rows:[]}}function S(e){m.trigger.delete({id:e.id}).$promise.then(function(){_.remove(b.triggers.rows,{id:e.id}),b.triggers.count-=1,b.triggers.rows.length||b.getTriggers(),p.success({title:_.startCase("Trigger")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTriggers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var t=_.find(g.trunks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),n.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||n.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,t){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){n.go("app.tools.trunks")},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.trunk&&(n=_.find(u.contexts,{name:u.trunk.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.trunks=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="trunks",b.listOrder="",b.listOrderAsc=null,b.selectedTrunks=[],b.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},b.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{trunk:e,trunks:b.trunks?b.trunks.rows:[],crudPermissions:b.crudPermissions}})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.trunks",{})}},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTrunks=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.trunk.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Trunks",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTrunk=function(e,t){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:t,trunks:b.trunks.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTrunk=S,b.exportSelectedTrunks=function(){var e=angular.copy(b.selectedTrunks);return b.selectedTrunks=[],e},b.deleteSelectedTrunks=function(e){var t=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+b.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTrunks.forEach(function(e){S(e)}),b.selectedTrunks=[]})},b.deselectTrunks=function(){b.selectedTrunks=[]},b.selectAllTrunks=function(){b.selectedTrunks=b.trunks.rows};var E=!0,A=1;function y(e){b.trunks=e||{count:0,rows:[]}}function S(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(b.trunks.rows,{id:e.id}),b.trunks.count-=1,b.trunks.rows.length||b.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var t=_.find(g.variables,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.variables=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="variables",b.listOrder="",b.listOrderAsc=null,b.selectedVariables=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{variable:e,variables:b.variables.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVariables=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.variable.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Variables",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVariable=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:t,variables:b.variables.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVariable=S,b.exportSelectedVariables=function(){var e=angular.copy(b.selectedVariables);return b.selectedVariables=[],e},b.deleteSelectedVariables=function(e){var t=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+b.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVariables.forEach(function(e){S(e)}),b.selectedVariables=[]})},b.deselectVariables=function(){b.selectedVariables=[]},b.selectAllVariables=function(){b.selectedVariables=b.variables.rows};var E=!0,A=1;function y(e){b.variables=e||{count:0,rows:[]}}function S(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(b.variables.rows,{id:e.id}),b.variables.count-=1,b.variables.rows.length||b.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chanSpies=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chanSpies",b.listOrder="",b.listOrderAsc=null,b.selectedChanSpies=[],b.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},b.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:b.chanSpies.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getChanSpies=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceChanSpy.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChanSpies",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditchanSpy=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:t,chanSpies:b.chanSpies.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletechanSpy=S,b.exportSelectedChanSpies=function(){var e=angular.copy(b.selectedChanSpies);return b.selectedChanSpies=[],e},b.deleteSelectedChanSpies=function(e){var t=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+b.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChanSpies.forEach(function(e){S(e)}),b.selectedChanSpies=[]})},b.deselectChanSpies=function(){b.selectedChanSpies=[]},b.selectAllChanSpies=function(){b.selectedChanSpies=b.chanSpies.rows};var E=!0,A=1;function y(e){b.chanSpies=e||{count:0,rows:[]}}function S(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(b.chanSpies.rows,{id:e.id}),b.chanSpies.count-=1,b.chanSpies.rows.length||b.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var t=_.find(g.chanSpies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.contexts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="contexts",b.listOrder="",b.listOrderAsc=null,b.selectedContexts=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{context:e,contexts:b.contexts.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getContexts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceContext.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Contexts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditContext=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:t,contexts:b.contexts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteContext=S,b.exportSelectedContexts=function(){var e=angular.copy(b.selectedContexts);return b.selectedContexts=[],e},b.deleteSelectedContexts=function(e){var t=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+b.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedContexts.forEach(function(e){S(e)}),b.selectedContexts=[]})},b.deselectContexts=function(){b.selectedContexts=[]},b.selectAllContexts=function(){b.selectedContexts=b.contexts.rows};var E=!0,A=1;function y(e){b.contexts=e||{count:0,rows:[]}}function S(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(b.contexts.rows,{id:e.id}),b.contexts.count-=1,b.contexts.rows.length||b.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var t=_.find(g.contexts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_INBOUNDROUTE",g.inboundroute=angular.copy(l),g.inboundroutes=r,g.newInboundRoute=!1,g.inboundroute||(g.inboundroute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},g.title="VOICE.NEW_INBOUNDROUTE",g.newInboundRoute=!0),g.addNewInboundRoute=function(){g.errors=[],d.voiceExtension.save(g.inboundroute).$promise.then(function(e){g.inboundroutes.unshift(e.toJSON()),o.success({title:"InboundRoute properly created",msg:g.inboundroute.name?g.inboundroute.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInboundRoute=function(){g.errors=[],d.voiceExtension.update({id:g.inboundroute.id},g.inboundroute).$promise.then(function(e){var t=_.find(g.inboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"InboundRoute properly saved!",msg:g.inboundroute.name?g.inboundroute.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInboundRoute=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The inboundroute will be deleted.").ariaLabel("Delete InboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceExtension.delete({id:g.inboundroute.id}).$promise.then(function(){_.remove(g.inboundroutes,{id:g.inboundroute.id}),o.success({title:"InboundRoute properly deleted!",msg:(g.inboundroute.name||"inboundroute")+" has been deleted!"}),v(g.inboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.contexts,{id:e.resourceId})}),n=null;if(g.inboundroute&&(n=_.find(g.contexts,{name:g.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(g.contexts,{id:n.id});a.canSelect=!1,t.push(a)}g.contexts=t}):d.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){g.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","inboundroutes","inboundroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,s,e){var u=this;function t(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundrouteApp:n,inboundroute:u.inboundroute,crudPermissions:u.crudPermissions}}).then(function(e){e&&(e.id?u.inboundrouteApps.rows[t]=e:u.inboundrouteApps.rows.splice(t,0,e),o())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function o(){var e=["queue","playback"],t=2,n=[];n.push({type:"inbound",app:"Set",appdata:"CDR(type)=inbound",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id});for(var a=0,i=0;a<u.inboundrouteApps.rows.length;a++,i=0){var s=u.inboundrouteApps.rows[a],o=[],r=[];s.intervals="*,*,*,*"!==s.interval?[s.interval]:s.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:s.IntervalId}),"interval"):[],s.context=u.inboundroute.context,s.exten=u.inboundroute.exten,s.type&&(s.type=s.type.toLowerCase()),s.hasOwnProperty("answer")&&e.includes(s.app.toLowerCase())&&"custom"!==s.appType&&(s.answer?(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})):(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})));for(var l=0;l<s.intervals.length;l++){var d=t+s.intervals.length,c=l===s.intervals.length-1?t+o.length+r.length+2:t+l+1;o.splice(l,0,{type:"inbound",app:"GotoIfTime",appdata:s.intervals[l]+"?"+u.inboundroute.context+",${EXTEN},"+d+":"+u.inboundroute.context+",${EXTEN},"+c,exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t+l,VoiceExtensionId:u.inboundroute.id})}s.priority=o.length?_.last(o).priority+1:t,t=(r.length?_.last(r).priority:s.priority)+1,n=_.concat(n,o,[s],r)}n.push({type:"inbound",app:"Hangup",exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t,VoiceExtensionId:u.inboundroute.id}),m.voiceExtension.addApplications({id:u.inboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.inboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.inboundrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.inboundroute={},u.inboundrouteApps={count:0,rows:[]},u.selectedInboundRouteApps=[],u.crudPermissions,u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-voip-provider",type:"Inbound",appdata:",xX,,,300,,,,,",icon:"icon-apps",options:"xX",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}},{name:"queues",field:{name:"queue",key:"name"},route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:401}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"user",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",required:!0,type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"multipleUsers",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",field:{name:"project",key:"name",prefix:"agi://127.0.0.1/square,"},route:"squareProject",filters:{fields:"id,name",sort:"name"},permissions:{section:1103}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",field:{name:"context",key:"name"},route:"voiceContext",filters:{fields:"id,name",sort:"name"},permissions:{section:405}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-voip-provider",type:"Inbound",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",field:{name:"name",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name"},permissions:{section:1012}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-voip-provider",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",field:{name:"voiceMail",key:"mailbox",suffix:"@from-voicemail"},route:"voiceMail",filters:{fields:"id,mailbox",sort:"mailbox"},permissions:{section:406}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){o()}},u.init=function(e,t){u.inboundroute=e,u.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},u.applications.disabled=!u.crudPermissions.canEdit,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInboundRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.inboundrouteApps.rows.splice(t,1),o()},function(){console.log("CANCEL")})},u.getInboundRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInboundRouteApp=t,u.editInterval=function(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:u.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,o())})}},u.deleteInboundRouteApp=function(e){_.remove(u.inboundrouteApps.rows,{id:e.id}),o(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInboundRouteApps.forEach(function(e){_.remove(u.inboundrouteApps.rows,{id:e.id})}),u.selectedInboundRouteApps=[],o()})},u.rewriteRouting=o,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.agi=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agi.appdata)switch(l.agi.appType?l.agi.appType.toLowerCase():l.agi.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agi.appdata.split(",");l.agi.key=d[0],l.agi.language=d[1],l.agi.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agi.appdata.split(",");l.agi.accesskeyid=d[0],l.agi.secretaccesskey=d[1],l.agi.lexregion=d[2],l.agi.botname=d[3],l.agi.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agi.appdata.split(",");l.agi.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agi.text=d.slice(1,d.length).join(",");break;case"message":l.agi.text=l.agi.appdata;break;case"set":l.agi.name=l.agi.appdata.split("=")[0],l.agi.value=l.agi.appdata.split("=")[1];break;case"agi":l.agi.project=l.agi.appdata;break;default:var c=l.agi.appdata.split(",");l.agi.project=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outbounddial"===l.agi.appType.toLowerCase()&&(l.agi.prefix=l.agi.phone?l.agi.phone.split("$")[0]:void 0,l.agi.callerId=l.agi.callerID?"CALLERID(all)="+l.agi.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outboundDial"===l.agi.appType&&(l.agi.phone=i.cutdigits?(l.agi.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agi.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agi.options+="U(xcally-mixmonitor-context)"):l.agi.options=l.agi.options.replace("U(xcally-mixmonitor-context)",""));if(l.agi.appType&&"custom"===l.agi.appType);else switch((l.agi.app||l.agi.appType).toLowerCase()){case"set":l.agi.appdata=l.agi.name+"="+l.agi.value;break;case"custom":break;default:e[0]=l.agi.project,l.agi.appdata=e.join(",")}m(l.agi)},l.closeDialog=m,o.hasRole("admin")?s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),n=null;if(l.agi&&(n=_.find(l.projects,{name:l.agi.project})),n&&!_.some(t,["id",n.id])){var a=_.find(l.projects,{id:n.id});a.canSelect=!1,t.push(a)}l.projects=t})}else{var n=[],a=null;l.agi&&(a=_.find(l.projects,{name:l.agi.project}));for(var i=0;i<l.projects.length;i++)a&&l.projects[i].id===a.id&&(l.projects[i].canSelect=!1,n.push(l.projects[i]));l.projects=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.dial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dial.appdata)switch(l.dial.appType?l.dial.appType.toLowerCase():l.dial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dial.appdata.split(",");l.dial.key=d[0],l.dial.language=d[1],l.dial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dial.appdata.split(",");l.dial.accesskeyid=d[0],l.dial.secretaccesskey=d[1],l.dial.lexregion=d[2],l.dial.botname=d[3],l.dial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dial.appdata.split(",");l.dial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dial.text=d.slice(1,d.length).join(",");break;case"message":l.dial.text=l.dial.appdata;break;case"set":l.dial.name=l.dial.appdata.split("=")[0],l.dial.value=l.dial.appdata.split("=")[1];break;case"agi":l.dial.project=l.dial.appdata;break;default:var c=l.dial.appdata.split(",");l.dial.tech=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outbounddial"===l.dial.appType.toLowerCase()&&(l.dial.prefix=l.dial.phone?l.dial.phone.split("$")[0]:void 0,l.dial.callerId=l.dial.callerID?"CALLERID(all)="+l.dial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outboundDial"===l.dial.appType&&(l.dial.phone=i.cutdigits?(l.dial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dial.options+="U(xcally-mixmonitor-context)"):l.dial.options=l.dial.options.replace("U(xcally-mixmonitor-context)",""));if(l.dial.appType&&"custom"===l.dial.appType);else switch((l.dial.app||l.dial.appType).toLowerCase()){case"set":l.dial.appdata=l.dial.name+"="+l.dial.value;break;case"custom":break;default:e[0]=l.dial.tech,e[1]=l.dial.timeout,e[2]=l.dial.options,e[3]=l.dial.url,l.dial.appdata=e.join(",")}m(l.dial)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppdialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.externaldial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.externaldial.appdata)switch(l.externaldial.appType?l.externaldial.appType.toLowerCase():l.externaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.externaldial.appdata.split(",");l.externaldial.key=d[0],l.externaldial.language=d[1],l.externaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.externaldial.appdata.split(",");l.externaldial.accesskeyid=d[0],l.externaldial.secretaccesskey=d[1],l.externaldial.lexregion=d[2],l.externaldial.botname=d[3],l.externaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.externaldial.appdata.split(",");l.externaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.externaldial.text=d.slice(1,d.length).join(",");break;case"message":l.externaldial.text=l.externaldial.appdata;break;case"set":l.externaldial.name=l.externaldial.appdata.split("=")[0],l.externaldial.value=l.externaldial.appdata.split("=")[1];break;case"agi":l.externaldial.project=l.externaldial.appdata;break;default:var c=l.externaldial.appdata.split(",");l.externaldial.trunk=c[0].split("/")[1],l.externaldial.phone=c[0].split("/")[2],l.externaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.externaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.externaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outbounddial"===l.externaldial.appType.toLowerCase()&&(l.externaldial.prefix=l.externaldial.phone?l.externaldial.phone.split("$")[0]:void 0,l.externaldial.callerId=l.externaldial.callerID?"CALLERID(all)="+l.externaldial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outboundDial"===l.externaldial.appType&&(l.externaldial.phone=i.cutdigits?(l.externaldial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.externaldial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.externaldial.options+="U(xcally-mixmonitor-context)"):l.externaldial.options=l.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.externaldial.appType&&"custom"===l.externaldial.appType);else switch((l.externaldial.app||l.externaldial.appType).toLowerCase()){case"set":l.externaldial.appdata=l.externaldial.name+"="+l.externaldial.value;break;case"custom":break;default:e[0]=["SIP",l.externaldial.trunk,l.externaldial.phone].join("/"),e[1]=l.externaldial.timeout,e[2]=l.externaldial.options,e[3]=l.externaldial.url,l.externaldial.appdata=e.join(",")}m(l.externaldial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.externaldial&&(n=_.find(l.trunks,{name:l.externaldial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.externaldial&&(a=_.find(l.trunks,{name:l.externaldial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.goto=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.goto.appdata)switch(l.goto.appType?l.goto.appType.toLowerCase():l.goto.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.goto.appdata.split(",");l.goto.key=d[0],l.goto.language=d[1],l.goto.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.goto.appdata.split(",");l.goto.accesskeyid=d[0],l.goto.secretaccesskey=d[1],l.goto.lexregion=d[2],l.goto.botname=d[3],l.goto.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.goto.appdata.split(",");l.goto.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.goto.text=d.slice(1,d.length).join(",");break;case"message":l.goto.text=l.goto.appdata;break;case"set":l.goto.name=l.goto.appdata.split("=")[0],l.goto.value=l.goto.appdata.split("=")[1];break;case"agi":l.goto.project=l.goto.appdata;break;default:var c=l.goto.appdata.split(",");l.goto.context=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.goto.extension=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.goto.priority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outbounddial"===l.goto.appType.toLowerCase()&&(l.goto.prefix=l.goto.phone?l.goto.phone.split("$")[0]:void 0,l.goto.callerId=l.goto.callerID?"CALLERID(all)="+l.goto.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outboundDial"===l.goto.appType&&(l.goto.phone=i.cutdigits?(l.goto.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.goto.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.goto.options+="U(xcally-mixmonitor-context)"):l.goto.options=l.goto.options.replace("U(xcally-mixmonitor-context)",""));if(l.goto.appType&&"custom"===l.goto.appType);else switch((l.goto.app||l.goto.appType).toLowerCase()){case"set":l.goto.appdata=l.goto.name+"="+l.goto.value;break;case"custom":break;default:e[0]=l.goto.context,e[1]=l.goto.extension,e[2]=l.goto.priority,l.goto.appdata=e.join(",")}m(l.goto)},l.closeDialog=m,o.hasRole("admin")?s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.contexts,{id:e.resourceId})}),n=null;if(l.goto&&(n=_.find(l.contexts,{name:l.goto.context})),n&&!_.some(t,["id",n.id])){var a=_.find(l.contexts,{id:n.id});a.canSelect=!1,t.push(a)}l.contexts=t}):s.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){l.contexts=e.rows||[]})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.hangup=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.hangup.appdata)switch(l.hangup.appType?l.hangup.appType.toLowerCase():l.hangup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.hangup.appdata.split(",");l.hangup.key=d[0],l.hangup.language=d[1],l.hangup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.hangup.appdata.split(",");l.hangup.accesskeyid=d[0],l.hangup.secretaccesskey=d[1],l.hangup.lexregion=d[2],l.hangup.botname=d[3],l.hangup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.hangup.appdata.split(",");l.hangup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.hangup.text=d.slice(1,d.length).join(",");break;case"message":l.hangup.text=l.hangup.appdata;break;case"set":l.hangup.name=l.hangup.appdata.split("=")[0],l.hangup.value=l.hangup.appdata.split("=")[1];break;case"agi":l.hangup.project=l.hangup.appdata;break;default:var c=l.hangup.appdata.split(",");l.hangup.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outbounddial"===l.hangup.appType.toLowerCase()&&(l.hangup.prefix=l.hangup.phone?l.hangup.phone.split("$")[0]:void 0,l.hangup.callerId=l.hangup.callerID?"CALLERID(all)="+l.hangup.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outboundDial"===l.hangup.appType&&(l.hangup.phone=i.cutdigits?(l.hangup.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.hangup.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.hangup.options+="U(xcally-mixmonitor-context)"):l.hangup.options=l.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(l.hangup.appType&&"custom"===l.hangup.appType);else switch((l.hangup.app||l.hangup.appType).toLowerCase()){case"set":l.hangup.appdata=l.hangup.name+"="+l.hangup.value;break;case"custom":break;default:e[0]=l.hangup.appdata,l.hangup.appdata=e.join(",")}m(l.hangup)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundApphangupDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.internaldial=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.internaldial.appdata)switch(l.internaldial.appType?l.internaldial.appType.toLowerCase():l.internaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.internaldial.appdata.split(",");l.internaldial.key=d[0],l.internaldial.language=d[1],l.internaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.internaldial.appdata.split(",");l.internaldial.accesskeyid=d[0],l.internaldial.secretaccesskey=d[1],l.internaldial.lexregion=d[2],l.internaldial.botname=d[3],l.internaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.internaldial.appdata.split(",");l.internaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.internaldial.text=d.slice(1,d.length).join(",");break;case"message":l.internaldial.text=l.internaldial.appdata;break;case"set":l.internaldial.name=l.internaldial.appdata.split("=")[0],l.internaldial.value=l.internaldial.appdata.split("=")[1];break;case"agi":l.internaldial.project=l.internaldial.appdata;break;default:var c=l.internaldial.appdata.split(",");l.internaldial.user=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.internaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.internaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.internaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outbounddial"===l.internaldial.appType.toLowerCase()&&(l.internaldial.prefix=l.internaldial.phone?l.internaldial.phone.split("$")[0]:void 0,l.internaldial.callerId=l.internaldial.callerID?"CALLERID(all)="+l.internaldial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outboundDial"===l.internaldial.appType&&(l.internaldial.phone=a.cutdigits?(l.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.internaldial.options+="U(xcally-mixmonitor-context)"):l.internaldial.options=l.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.internaldial.appType&&"custom"===l.internaldial.appType);else switch((l.internaldial.app||l.internaldial.appType).toLowerCase()){case"set":l.internaldial.appdata=l.internaldial.name+"="+l.internaldial.value;break;case"custom":break;default:e[0]=l.internaldial.user,e[1]=l.internaldial.timeout,e[2]=l.internaldial.options,e[3]=l.internaldial.url,l.internaldial.appdata=e.join(",")}p(l.internaldial)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.internaldial&&(n=_.find(u,{name:l.internaldial.user}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.playback=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.playback.appdata)switch(l.playback.appType?l.playback.appType.toLowerCase():l.playback.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.playback.appdata.split(",");l.playback.key=d[0],l.playback.language=d[1],l.playback.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.playback.appdata.split(",");l.playback.accesskeyid=d[0],l.playback.secretaccesskey=d[1],l.playback.lexregion=d[2],l.playback.botname=d[3],l.playback.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.playback.appdata.split(",");l.playback.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.playback.text=d.slice(1,d.length).join(",");break;case"message":l.playback.text=l.playback.appdata;break;case"set":l.playback.name=l.playback.appdata.split("=")[0],l.playback.value=l.playback.appdata.split("=")[1];break;case"agi":l.playback.project=l.playback.appdata;break;default:var c=l.playback.appdata.split(",");l.playback.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.playback.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outbounddial"===l.playback.appType.toLowerCase()&&(l.playback.prefix=l.playback.phone?l.playback.phone.split("$")[0]:void 0,l.playback.callerId=l.playback.callerID?"CALLERID(all)="+l.playback.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outboundDial"===l.playback.appType&&(l.playback.phone=i.cutdigits?(l.playback.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.playback.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.playback.options+="U(xcally-mixmonitor-context)"):l.playback.options=l.playback.options.replace("U(xcally-mixmonitor-context)",""));if(l.playback.appType&&"custom"===l.playback.appType);else switch((l.playback.app||l.playback.appType).toLowerCase()){case"set":l.playback.appdata=l.playback.name+"="+l.playback.value;break;case"custom":break;default:e[0]=l.playback.appdata,e[1]=l.playback.options,l.playback.appdata=e.join(",")}m(l.playback)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.playback&&(n=_.find(l.sounds,{save_name:l.playback.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.playback&&(a=_.find(l.sounds,{save_name:l.playback.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppplaybackDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.queue.URL=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.queue.sound=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.queue.timeout=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.queue.agi=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.queue.macro=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.queue.gosub=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.queue.rule=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.queue.position=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10)}function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.options,e[2]=l.queue.URL,e[3]=l.queue.sound,e[4]=l.queue.timeout,e[5]=l.queue.agi,e[6]=l.queue.macro,e[7]=l.queue.gosub,e[8]=l.queue.rule,e[9]=l.queue.position,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.sounds,{save_name:l.queue.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.sounds,{save_name:l.queue.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:401}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppqueueDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.ringgroup=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.ringgroup.appdata)switch(l.ringgroup.appType?l.ringgroup.appType.toLowerCase():l.ringgroup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.ringgroup.appdata.split(",");l.ringgroup.key=d[0],l.ringgroup.language=d[1],l.ringgroup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.ringgroup.appdata.split(",");l.ringgroup.accesskeyid=d[0],l.ringgroup.secretaccesskey=d[1],l.ringgroup.lexregion=d[2],l.ringgroup.botname=d[3],l.ringgroup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.ringgroup.appdata.split(",");l.ringgroup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.ringgroup.text=d.slice(1,d.length).join(",");break;case"message":l.ringgroup.text=l.ringgroup.appdata;break;case"set":l.ringgroup.name=l.ringgroup.appdata.split("=")[0],l.ringgroup.value=l.ringgroup.appdata.split("=")[1];break;case"agi":l.ringgroup.project=l.ringgroup.appdata;break;default:var c=l.ringgroup.appdata.split(",");l.ringgroup.multipleUsers=c[0].split("&"),l.ringgroup.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.ringgroup.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.ringgroup.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outbounddial"===l.ringgroup.appType.toLowerCase()&&(l.ringgroup.prefix=l.ringgroup.phone?l.ringgroup.phone.split("$")[0]:void 0,l.ringgroup.callerId=l.ringgroup.callerID?"CALLERID(all)="+l.ringgroup.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outboundDial"===l.ringgroup.appType&&(l.ringgroup.phone=a.cutdigits?(l.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.ringgroup.options+="U(xcally-mixmonitor-context)"):l.ringgroup.options=l.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(l.ringgroup.appType&&"custom"===l.ringgroup.appType);else switch((l.ringgroup.app||l.ringgroup.appType).toLowerCase()){case"set":l.ringgroup.appdata=l.ringgroup.name+"="+l.ringgroup.value;break;case"custom":break;default:e[0]=l.ringgroup.multipleUsers.join("&"),e[1]=l.ringgroup.timeout,e[2]=l.ringgroup.options,e[3]=l.ringgroup.url,l.ringgroup.appdata=e.join(",")}p(l.ringgroup)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.ringgroup&&(n=_.find(u,{name:l.ringgroup.multipleUsers}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppringgroupDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.set=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.set.appdata)switch(l.set.appType?l.set.appType.toLowerCase():l.set.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.set.appdata.split(",");l.set.key=d[0],l.set.language=d[1],l.set.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.set.appdata.split(",");l.set.accesskeyid=d[0],l.set.secretaccesskey=d[1],l.set.lexregion=d[2],l.set.botname=d[3],l.set.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.set.appdata.split(",");l.set.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.set.text=d.slice(1,d.length).join(",");break;case"message":l.set.text=l.set.appdata;break;case"set":l.set.name=l.set.appdata.split("=")[0],l.set.value=l.set.appdata.split("=")[1];break;case"agi":l.set.project=l.set.appdata;break;default:var c=l.set.appdata.split("=");l.set.name=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.set.value=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outbounddial"===l.set.appType.toLowerCase()&&(l.set.prefix=l.set.phone?l.set.phone.split("$")[0]:void 0,l.set.callerId=l.set.callerID?"CALLERID(all)="+l.set.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outboundDial"===l.set.appType&&(l.set.phone=i.cutdigits?(l.set.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.set.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.set.options+="U(xcally-mixmonitor-context)"):l.set.options=l.set.options.replace("U(xcally-mixmonitor-context)",""));if(l.set.appType&&"custom"===l.set.appType);else switch((l.set.app||l.set.appType).toLowerCase()){case"set":l.set.appdata=l.set.name+"="+l.set.value;break;case"custom":break;default:e[0]=l.set.name,e[1]=l.set.value,l.set.appdata=e.join("=")}m(l.set)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.set&&(n=_.find(l.variables,{name:l.set.name})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.set&&(a=_.find(l.variables,{name:l.set.name}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppsetDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.voicemail=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.voicemail.appdata)switch(l.voicemail.appType?l.voicemail.appType.toLowerCase():l.voicemail.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.voicemail.appdata.split(",");l.voicemail.key=d[0],l.voicemail.language=d[1],l.voicemail.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.voicemail.appdata.split(",");l.voicemail.accesskeyid=d[0],l.voicemail.secretaccesskey=d[1],l.voicemail.lexregion=d[2],l.voicemail.botname=d[3],l.voicemail.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.voicemail.appdata.split(",");l.voicemail.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.voicemail.text=d.slice(1,d.length).join(",");break;case"message":l.voicemail.text=l.voicemail.appdata;break;case"set":l.voicemail.name=l.voicemail.appdata.split("=")[0],l.voicemail.value=l.voicemail.appdata.split("=")[1];break;case"agi":l.voicemail.project=l.voicemail.appdata;break;default:var c=l.voicemail.appdata.split(",");l.voicemail.voiceMail=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.voicemail.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outbounddial"===l.voicemail.appType.toLowerCase()&&(l.voicemail.prefix=l.voicemail.phone?l.voicemail.phone.split("$")[0]:void 0,l.voicemail.callerId=l.voicemail.callerID?"CALLERID(all)="+l.voicemail.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outboundDial"===l.voicemail.appType&&(l.voicemail.phone=i.cutdigits?(l.voicemail.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.voicemail.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.voicemail.options+="U(xcally-mixmonitor-context)"):l.voicemail.options=l.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(l.voicemail.appType&&"custom"===l.voicemail.appType);else switch((l.voicemail.app||l.voicemail.appType).toLowerCase()){case"set":l.voicemail.appdata=l.voicemail.name+"="+l.voicemail.value;break;case"custom":break;default:e[0]=l.voicemail.voiceMail,e[1]=l.voicemail.options,l.voicemail.appdata=e.join(",")}m(l.voicemail)},l.closeDialog=m,o.hasRole("admin")?s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEMAILS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:406}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.voiceMails,{id:e.resourceId})}),n=null;if(l.voicemail&&(n=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail})),n&&!_.some(t,["id",n.id])){var a=_.find(l.voiceMails,{id:n.id});a.canSelect=!1,t.push(a)}l.voiceMails=t})}else{var n=[],a=null;l.voicemail&&(a=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail}));for(var i=0;i<l.voiceMails.length;i++)a&&l.voiceMails[i].id===a.id&&(l.voiceMails[i].canSelect=!1,n.push(l.voiceMails[i]));l.voiceMails=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.inboundroute=c||e.params.inboundroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoInboundRoutes=function(){e.go("app.voice.inboundroutes")},u.saveInboundRoute=function(){r.voiceExtension.update({id:u.inboundroute.id},u.inboundroute).$promise.then(function(){l.success({title:"InboundRoute updated!",msg:u.inboundroute.name?u.inboundroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.inboundroute&&(n=_.find(u.contexts,{name:u.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","inboundroute","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.inboundroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="inboundroutes",b.listOrder="",b.listOrderAsc=null,b.selectedInboundRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.voice.inboundroutes.edit",{id:e.id,inboundroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("inboundroute")+"?").htmlContent("<b>"+(e.name||"inboundroute")+"</b> will be deleted.").ariaLabel("delete inboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getInboundRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="InboundRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInboundRoute=function(e,t){i.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundroute:t,inboundroutes:b.inboundroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInboundRoute=S,b.exportSelectedInboundRoutes=function(){var e=angular.copy(b.selectedInboundRoutes);return b.selectedInboundRoutes=[],e},b.deleteSelectedInboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected inboundroutes?").htmlContent("<b>"+b.selectedInboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedInboundRoutes.forEach(function(e){S(e)}),b.selectedInboundRoutes=[]})},b.deselectInboundRoutes=function(){b.selectedInboundRoutes=[]},b.selectAllInboundRoutes=function(){b.selectedInboundRoutes=b.inboundroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.inboundroute&&(n=_.find(b.contexts,{name:b.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.inboundroutes=e||{count:0,rows:[]}}function S(e){m.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(b.inboundroutes.rows,{id:e.id}),b.inboundroutes.count-=1,b.inboundroutes.rows.length||b.getInboundRoutes(),p.success({title:_.startCase("InboundRoute")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getInboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","inboundroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_INTERNALROUTE",g.internalroute=angular.copy(l),g.internalroutes=r,g.newInternalRoute=!1,g.internalroute||(g.internalroute={appdata:"Internal Call",type:"internal",context:"from-sip"},g.title="VOICE.NEW_INTERNALROUTE",g.newInternalRoute=!0),g.addNewInternalRoute=function(){g.errors=[],d.voiceExtension.save(g.internalroute).$promise.then(function(e){g.internalroutes.unshift(e.toJSON()),o.success({title:"InternalRoute properly created",msg:g.internalroute.name?g.internalroute.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInternalRoute=function(){g.errors=[],d.voiceExtension.update({id:g.internalroute.id},g.internalroute).$promise.then(function(e){var t=_.find(g.internalroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"InternalRoute properly saved!",msg:g.internalroute.name?g.internalroute.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInternalRoute=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The internalroute will be deleted.").ariaLabel("Delete InternalRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceExtension.delete({id:g.internalroute.id}).$promise.then(function(){_.remove(g.internalroutes,{id:g.internalroute.id}),o.success({title:"InternalRoute properly deleted!",msg:(g.internalroute.name||"internalroute")+" has been deleted!"}),v(g.internalroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.contexts,{id:e.resourceId})}),n=null;if(g.internalroute&&(n=_.find(g.contexts,{name:g.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(g.contexts,{id:n.id});a.canSelect=!1,t.push(a)}g.contexts=t}):d.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){g.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","internalroutes","internalroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,s,e){var u=this;function t(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalrouteApp:n,internalroute:u.internalroute,crudPermissions:u.crudPermissions}}).then(function(e){e&&(e.id?u.internalrouteApps.rows[t]=e:u.internalrouteApps.rows.splice(t,0,e),o())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function o(){var e=["queue","playback"],t=2,n=[];n.push({type:"internal",app:"Set",appdata:"CDR(type)=internal",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id});for(var a=0,i=0;a<u.internalrouteApps.rows.length;a++,i=0){var s=u.internalrouteApps.rows[a],o=[],r=[];s.intervals="*,*,*,*"!==s.interval?[s.interval]:s.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:s.IntervalId}),"interval"):[],s.context=u.internalroute.context,s.exten=u.internalroute.exten,s.type&&(s.type=s.type.toLowerCase()),s.hasOwnProperty("answer")&&e.includes(s.app.toLowerCase())&&"custom"!==s.appType&&(s.answer?(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})):(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})));for(var l=0;l<s.intervals.length;l++){var d=t+s.intervals.length,c=l===s.intervals.length-1?t+o.length+r.length+2:t+l+1;o.splice(l,0,{type:"internal",app:"GotoIfTime",appdata:s.intervals[l]+"?"+u.internalroute.context+",${EXTEN},"+d+":"+u.internalroute.context+",${EXTEN},"+c,exten:u.internalroute.exten,context:u.internalroute.context,priority:t+l,VoiceExtensionId:u.internalroute.id})}s.priority=o.length?_.last(o).priority+1:t,t=(r.length?_.last(r).priority:s.priority)+1,n=_.concat(n,o,[s],r)}n.push({type:"internal",app:"Hangup",exten:u.internalroute.exten,context:u.internalroute.context,priority:t,VoiceExtensionId:u.internalroute.id}),m.voiceExtension.addApplications({id:u.internalroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.internalrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.internalrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.internalroute={},u.internalrouteApps={count:0,rows:[]},u.selectedInternalRouteApps=[],u.crudPermissions,u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Internal",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}},{name:"queues",field:{name:"queue",key:"name"},route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:401}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"appdata",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"users",field:{name:"user",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"multipleUsers",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",field:{name:"project",key:"name",prefix:"agi://127.0.0.1/square,"},route:"squareProject",filters:{fields:"id,name",sort:"name"},permissions:{section:1103}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",field:{name:"context",key:"name"},route:"voiceContext",filters:{fields:"id,name",sort:"name"},permissions:{section:405}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",field:{name:"name",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name"},permissions:{section:1012}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-sip",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",field:{name:"voiceMail",key:"mailbox",suffix:"@from-voicemail"},route:"voiceMail",filters:{fields:"id,mailbox",sort:"mailbox"},permissions:{section:406}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){o()}},u.init=function(e,t){u.internalroute=e,u.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},u.applications.disabled=!u.crudPermissions.canEdit,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInternalRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.internalrouteApps.rows.splice(t,1),o()},function(){console.log("CANCEL")})},u.getInternalRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInternalRouteApp=t,u.editInterval=function(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:u.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,o())})}},u.deleteInternalRouteApp=function(e){_.remove(u.internalrouteApps.rows,{id:e.id}),o(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInternalRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInternalRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInternalRouteApps.forEach(function(e){_.remove(u.internalrouteApps.rows,{id:e.id})}),u.selectedInternalRouteApps=[],o()})},u.rewriteRouting=o,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InternalRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.agi=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agi.appdata)switch(l.agi.appType?l.agi.appType.toLowerCase():l.agi.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agi.appdata.split(",");l.agi.key=d[0],l.agi.language=d[1],l.agi.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agi.appdata.split(",");l.agi.accesskeyid=d[0],l.agi.secretaccesskey=d[1],l.agi.lexregion=d[2],l.agi.botname=d[3],l.agi.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agi.appdata.split(",");l.agi.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agi.text=d.slice(1,d.length).join(",");break;case"message":l.agi.text=l.agi.appdata;break;case"set":l.agi.name=l.agi.appdata.split("=")[0],l.agi.value=l.agi.appdata.split("=")[1];break;case"agi":l.agi.project=l.agi.appdata;break;default:var c=l.agi.appdata.split(",");l.agi.project=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outbounddial"===l.agi.appType.toLowerCase()&&(l.agi.prefix=l.agi.phone?l.agi.phone.split("$")[0]:void 0,l.agi.callerId=l.agi.callerID?"CALLERID(all)="+l.agi.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outboundDial"===l.agi.appType&&(l.agi.phone=i.cutdigits?(l.agi.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agi.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agi.options+="U(xcally-mixmonitor-context)"):l.agi.options=l.agi.options.replace("U(xcally-mixmonitor-context)",""));if(l.agi.appType&&"custom"===l.agi.appType);else switch((l.agi.app||l.agi.appType).toLowerCase()){case"set":l.agi.appdata=l.agi.name+"="+l.agi.value;break;case"custom":break;default:e[0]=l.agi.project,l.agi.appdata=e.join(",")}m(l.agi)},l.closeDialog=m,o.hasRole("admin")?s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),n=null;if(l.agi&&(n=_.find(l.projects,{name:l.agi.project})),n&&!_.some(t,["id",n.id])){var a=_.find(l.projects,{id:n.id});a.canSelect=!1,t.push(a)}l.projects=t})}else{var n=[],a=null;l.agi&&(a=_.find(l.projects,{name:l.agi.project}));for(var i=0;i<l.projects.length;i++)a&&l.projects[i].id===a.id&&(l.projects[i].canSelect=!1,n.push(l.projects[i]));l.projects=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.dial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dial.appdata)switch(l.dial.appType?l.dial.appType.toLowerCase():l.dial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dial.appdata.split(",");l.dial.key=d[0],l.dial.language=d[1],l.dial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dial.appdata.split(",");l.dial.accesskeyid=d[0],l.dial.secretaccesskey=d[1],l.dial.lexregion=d[2],l.dial.botname=d[3],l.dial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dial.appdata.split(",");l.dial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dial.text=d.slice(1,d.length).join(",");break;case"message":l.dial.text=l.dial.appdata;break;case"set":l.dial.name=l.dial.appdata.split("=")[0],l.dial.value=l.dial.appdata.split("=")[1];break;case"agi":l.dial.project=l.dial.appdata;break;default:var c=l.dial.appdata.split(",");l.dial.tech=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outbounddial"===l.dial.appType.toLowerCase()&&(l.dial.prefix=l.dial.phone?l.dial.phone.split("$")[0]:void 0,l.dial.callerId=l.dial.callerID?"CALLERID(all)="+l.dial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outboundDial"===l.dial.appType&&(l.dial.phone=i.cutdigits?(l.dial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dial.options+="U(xcally-mixmonitor-context)"):l.dial.options=l.dial.options.replace("U(xcally-mixmonitor-context)",""));if(l.dial.appType&&"custom"===l.dial.appType);else switch((l.dial.app||l.dial.appType).toLowerCase()){case"set":l.dial.appdata=l.dial.name+"="+l.dial.value;break;case"custom":break;default:e[0]=l.dial.tech,e[1]=l.dial.timeout,e[2]=l.dial.options,e[3]=l.dial.url,l.dial.appdata=e.join(",")}m(l.dial)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppdialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.externaldial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.externaldial.appdata)switch(l.externaldial.appType?l.externaldial.appType.toLowerCase():l.externaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.externaldial.appdata.split(",");l.externaldial.key=d[0],l.externaldial.language=d[1],l.externaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.externaldial.appdata.split(",");l.externaldial.accesskeyid=d[0],l.externaldial.secretaccesskey=d[1],l.externaldial.lexregion=d[2],l.externaldial.botname=d[3],l.externaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.externaldial.appdata.split(",");l.externaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.externaldial.text=d.slice(1,d.length).join(",");break;case"message":l.externaldial.text=l.externaldial.appdata;break;case"set":l.externaldial.name=l.externaldial.appdata.split("=")[0],l.externaldial.value=l.externaldial.appdata.split("=")[1];break;case"agi":l.externaldial.project=l.externaldial.appdata;break;default:var c=l.externaldial.appdata.split(",");l.externaldial.trunk=c[0].split("/")[1],l.externaldial.phone=c[0].split("/")[2],l.externaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.externaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.externaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outbounddial"===l.externaldial.appType.toLowerCase()&&(l.externaldial.prefix=l.externaldial.phone?l.externaldial.phone.split("$")[0]:void 0,l.externaldial.callerId=l.externaldial.callerID?"CALLERID(all)="+l.externaldial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outboundDial"===l.externaldial.appType&&(l.externaldial.phone=i.cutdigits?(l.externaldial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.externaldial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.externaldial.options+="U(xcally-mixmonitor-context)"):l.externaldial.options=l.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.externaldial.appType&&"custom"===l.externaldial.appType);else switch((l.externaldial.app||l.externaldial.appType).toLowerCase()){case"set":l.externaldial.appdata=l.externaldial.name+"="+l.externaldial.value;break;case"custom":break;default:e[0]=["SIP",l.externaldial.trunk,l.externaldial.phone].join("/"),e[1]=l.externaldial.timeout,e[2]=l.externaldial.options,e[3]=l.externaldial.url,l.externaldial.appdata=e.join(",")}m(l.externaldial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.externaldial&&(n=_.find(l.trunks,{name:l.externaldial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.externaldial&&(a=_.find(l.trunks,{name:l.externaldial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.goto=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.goto.appdata)switch(l.goto.appType?l.goto.appType.toLowerCase():l.goto.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.goto.appdata.split(",");l.goto.key=d[0],l.goto.language=d[1],l.goto.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.goto.appdata.split(",");l.goto.accesskeyid=d[0],l.goto.secretaccesskey=d[1],l.goto.lexregion=d[2],l.goto.botname=d[3],l.goto.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.goto.appdata.split(",");l.goto.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.goto.text=d.slice(1,d.length).join(",");break;case"message":l.goto.text=l.goto.appdata;break;case"set":l.goto.name=l.goto.appdata.split("=")[0],l.goto.value=l.goto.appdata.split("=")[1];break;case"agi":l.goto.project=l.goto.appdata;break;default:var c=l.goto.appdata.split(",");l.goto.context=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.goto.extension=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.goto.priority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outbounddial"===l.goto.appType.toLowerCase()&&(l.goto.prefix=l.goto.phone?l.goto.phone.split("$")[0]:void 0,l.goto.callerId=l.goto.callerID?"CALLERID(all)="+l.goto.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outboundDial"===l.goto.appType&&(l.goto.phone=i.cutdigits?(l.goto.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.goto.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.goto.options+="U(xcally-mixmonitor-context)"):l.goto.options=l.goto.options.replace("U(xcally-mixmonitor-context)",""));if(l.goto.appType&&"custom"===l.goto.appType);else switch((l.goto.app||l.goto.appType).toLowerCase()){case"set":l.goto.appdata=l.goto.name+"="+l.goto.value;break;case"custom":break;default:e[0]=l.goto.context,e[1]=l.goto.extension,e[2]=l.goto.priority,l.goto.appdata=e.join(",")}m(l.goto)},l.closeDialog=m,o.hasRole("admin")?s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.contexts,{id:e.resourceId})}),n=null;if(l.goto&&(n=_.find(l.contexts,{name:l.goto.context})),n&&!_.some(t,["id",n.id])){var a=_.find(l.contexts,{id:n.id});a.canSelect=!1,t.push(a)}l.contexts=t}):s.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){l.contexts=e.rows||[]})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.hangup=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.hangup.appdata)switch(l.hangup.appType?l.hangup.appType.toLowerCase():l.hangup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.hangup.appdata.split(",");l.hangup.key=d[0],l.hangup.language=d[1],l.hangup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.hangup.appdata.split(",");l.hangup.accesskeyid=d[0],l.hangup.secretaccesskey=d[1],l.hangup.lexregion=d[2],l.hangup.botname=d[3],l.hangup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.hangup.appdata.split(",");l.hangup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.hangup.text=d.slice(1,d.length).join(",");break;case"message":l.hangup.text=l.hangup.appdata;break;case"set":l.hangup.name=l.hangup.appdata.split("=")[0],l.hangup.value=l.hangup.appdata.split("=")[1];break;case"agi":l.hangup.project=l.hangup.appdata;break;default:var c=l.hangup.appdata.split(",");l.hangup.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outbounddial"===l.hangup.appType.toLowerCase()&&(l.hangup.prefix=l.hangup.phone?l.hangup.phone.split("$")[0]:void 0,l.hangup.callerId=l.hangup.callerID?"CALLERID(all)="+l.hangup.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outboundDial"===l.hangup.appType&&(l.hangup.phone=i.cutdigits?(l.hangup.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.hangup.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.hangup.options+="U(xcally-mixmonitor-context)"):l.hangup.options=l.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(l.hangup.appType&&"custom"===l.hangup.appType);else switch((l.hangup.app||l.hangup.appType).toLowerCase()){case"set":l.hangup.appdata=l.hangup.name+"="+l.hangup.value;break;case"custom":break;default:e[0]=l.hangup.appdata,l.hangup.appdata=e.join(",")}m(l.hangup)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalApphangupDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.internaldial=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.internaldial.appdata)switch(l.internaldial.appType?l.internaldial.appType.toLowerCase():l.internaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.internaldial.appdata.split(",");l.internaldial.key=d[0],l.internaldial.language=d[1],l.internaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.internaldial.appdata.split(",");l.internaldial.accesskeyid=d[0],l.internaldial.secretaccesskey=d[1],l.internaldial.lexregion=d[2],l.internaldial.botname=d[3],l.internaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.internaldial.appdata.split(",");l.internaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.internaldial.text=d.slice(1,d.length).join(",");break;case"message":l.internaldial.text=l.internaldial.appdata;break;case"set":l.internaldial.name=l.internaldial.appdata.split("=")[0],l.internaldial.value=l.internaldial.appdata.split("=")[1];break;case"agi":l.internaldial.project=l.internaldial.appdata;break;default:var c=l.internaldial.appdata.split(",");l.internaldial.user=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.internaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.internaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.internaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outbounddial"===l.internaldial.appType.toLowerCase()&&(l.internaldial.prefix=l.internaldial.phone?l.internaldial.phone.split("$")[0]:void 0,l.internaldial.callerId=l.internaldial.callerID?"CALLERID(all)="+l.internaldial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outboundDial"===l.internaldial.appType&&(l.internaldial.phone=a.cutdigits?(l.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.internaldial.options+="U(xcally-mixmonitor-context)"):l.internaldial.options=l.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.internaldial.appType&&"custom"===l.internaldial.appType);else switch((l.internaldial.app||l.internaldial.appType).toLowerCase()){case"set":l.internaldial.appdata=l.internaldial.name+"="+l.internaldial.value;break;case"custom":break;default:e[0]=l.internaldial.user,e[1]=l.internaldial.timeout,e[2]=l.internaldial.options,e[3]=l.internaldial.url,l.internaldial.appdata=e.join(",")}p(l.internaldial)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.internaldial&&(n=_.find(u,{name:l.internaldial.user}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.playback=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.playback.appdata)switch(l.playback.appType?l.playback.appType.toLowerCase():l.playback.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.playback.appdata.split(",");l.playback.key=d[0],l.playback.language=d[1],l.playback.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.playback.appdata.split(",");l.playback.accesskeyid=d[0],l.playback.secretaccesskey=d[1],l.playback.lexregion=d[2],l.playback.botname=d[3],l.playback.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.playback.appdata.split(",");l.playback.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.playback.text=d.slice(1,d.length).join(",");break;case"message":l.playback.text=l.playback.appdata;break;case"set":l.playback.name=l.playback.appdata.split("=")[0],l.playback.value=l.playback.appdata.split("=")[1];break;case"agi":l.playback.project=l.playback.appdata;break;default:var c=l.playback.appdata.split(",");l.playback.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.playback.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outbounddial"===l.playback.appType.toLowerCase()&&(l.playback.prefix=l.playback.phone?l.playback.phone.split("$")[0]:void 0,l.playback.callerId=l.playback.callerID?"CALLERID(all)="+l.playback.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outboundDial"===l.playback.appType&&(l.playback.phone=i.cutdigits?(l.playback.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.playback.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.playback.options+="U(xcally-mixmonitor-context)"):l.playback.options=l.playback.options.replace("U(xcally-mixmonitor-context)",""));if(l.playback.appType&&"custom"===l.playback.appType);else switch((l.playback.app||l.playback.appType).toLowerCase()){case"set":l.playback.appdata=l.playback.name+"="+l.playback.value;break;case"custom":break;default:e[0]=l.playback.appdata,e[1]=l.playback.options,l.playback.appdata=e.join(",")}m(l.playback)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.playback&&(n=_.find(l.sounds,{save_name:l.playback.appdata})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.playback&&(a=_.find(l.sounds,{save_name:l.playback.appdata}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppplaybackDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.queue.URL=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.queue.sound=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.queue.timeout=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.queue.agi=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.queue.macro=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.queue.gosub=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.queue.rule=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.queue.position=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10)}function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.options,e[2]=l.queue.URL,e[3]=l.queue.sound,e[4]=l.queue.timeout,e[5]=l.queue.agi,e[6]=l.queue.macro,e[7]=l.queue.gosub,e[8]=l.queue.rule,e[9]=l.queue.position,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.sounds,{save_name:l.queue.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.sounds,{save_name:l.queue.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:401}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppqueueDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.ringgroup=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.ringgroup.appdata)switch(l.ringgroup.appType?l.ringgroup.appType.toLowerCase():l.ringgroup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.ringgroup.appdata.split(",");l.ringgroup.key=d[0],l.ringgroup.language=d[1],l.ringgroup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.ringgroup.appdata.split(",");l.ringgroup.accesskeyid=d[0],l.ringgroup.secretaccesskey=d[1],l.ringgroup.lexregion=d[2],l.ringgroup.botname=d[3],l.ringgroup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.ringgroup.appdata.split(",");l.ringgroup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.ringgroup.text=d.slice(1,d.length).join(",");break;case"message":l.ringgroup.text=l.ringgroup.appdata;break;case"set":l.ringgroup.name=l.ringgroup.appdata.split("=")[0],l.ringgroup.value=l.ringgroup.appdata.split("=")[1];break;case"agi":l.ringgroup.project=l.ringgroup.appdata;break;default:var c=l.ringgroup.appdata.split(",");l.ringgroup.multipleUsers=c[0].split("&"),l.ringgroup.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.ringgroup.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.ringgroup.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outbounddial"===l.ringgroup.appType.toLowerCase()&&(l.ringgroup.prefix=l.ringgroup.phone?l.ringgroup.phone.split("$")[0]:void 0,l.ringgroup.callerId=l.ringgroup.callerID?"CALLERID(all)="+l.ringgroup.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outboundDial"===l.ringgroup.appType&&(l.ringgroup.phone=a.cutdigits?(l.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.ringgroup.options+="U(xcally-mixmonitor-context)"):l.ringgroup.options=l.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(l.ringgroup.appType&&"custom"===l.ringgroup.appType);else switch((l.ringgroup.app||l.ringgroup.appType).toLowerCase()){case"set":l.ringgroup.appdata=l.ringgroup.name+"="+l.ringgroup.value;break;case"custom":break;default:e[0]=l.ringgroup.multipleUsers.join("&"),e[1]=l.ringgroup.timeout,e[2]=l.ringgroup.options,e[3]=l.ringgroup.url,l.ringgroup.appdata=e.join(",")}p(l.ringgroup)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.ringgroup&&(n=_.find(u,{name:l.ringgroup.multipleUsers}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppringgroupDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.set=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.set.appdata)switch(l.set.appType?l.set.appType.toLowerCase():l.set.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.set.appdata.split(",");l.set.key=d[0],l.set.language=d[1],l.set.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.set.appdata.split(",");l.set.accesskeyid=d[0],l.set.secretaccesskey=d[1],l.set.lexregion=d[2],l.set.botname=d[3],l.set.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.set.appdata.split(",");l.set.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.set.text=d.slice(1,d.length).join(",");break;case"message":l.set.text=l.set.appdata;break;case"set":l.set.name=l.set.appdata.split("=")[0],l.set.value=l.set.appdata.split("=")[1];break;case"agi":l.set.project=l.set.appdata;break;default:var c=l.set.appdata.split("=");l.set.name=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.set.value=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outbounddial"===l.set.appType.toLowerCase()&&(l.set.prefix=l.set.phone?l.set.phone.split("$")[0]:void 0,l.set.callerId=l.set.callerID?"CALLERID(all)="+l.set.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outboundDial"===l.set.appType&&(l.set.phone=i.cutdigits?(l.set.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.set.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.set.options+="U(xcally-mixmonitor-context)"):l.set.options=l.set.options.replace("U(xcally-mixmonitor-context)",""));if(l.set.appType&&"custom"===l.set.appType);else switch((l.set.app||l.set.appType).toLowerCase()){case"set":l.set.appdata=l.set.name+"="+l.set.value;break;case"custom":break;default:e[0]=l.set.name,e[1]=l.set.value,l.set.appdata=e.join("=")}m(l.set)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.set&&(n=_.find(l.variables,{name:l.set.name})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.set&&(a=_.find(l.variables,{name:l.set.name}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppsetDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.voicemail=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.voicemail.appdata)switch(l.voicemail.appType?l.voicemail.appType.toLowerCase():l.voicemail.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.voicemail.appdata.split(",");l.voicemail.key=d[0],l.voicemail.language=d[1],l.voicemail.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.voicemail.appdata.split(",");l.voicemail.accesskeyid=d[0],l.voicemail.secretaccesskey=d[1],l.voicemail.lexregion=d[2],l.voicemail.botname=d[3],l.voicemail.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.voicemail.appdata.split(",");l.voicemail.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.voicemail.text=d.slice(1,d.length).join(",");break;case"message":l.voicemail.text=l.voicemail.appdata;break;case"set":l.voicemail.name=l.voicemail.appdata.split("=")[0],l.voicemail.value=l.voicemail.appdata.split("=")[1];break;case"agi":l.voicemail.project=l.voicemail.appdata;break;default:var c=l.voicemail.appdata.split(",");l.voicemail.voiceMail=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.voicemail.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outbounddial"===l.voicemail.appType.toLowerCase()&&(l.voicemail.prefix=l.voicemail.phone?l.voicemail.phone.split("$")[0]:void 0,l.voicemail.callerId=l.voicemail.callerID?"CALLERID(all)="+l.voicemail.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outboundDial"===l.voicemail.appType&&(l.voicemail.phone=i.cutdigits?(l.voicemail.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.voicemail.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.voicemail.options+="U(xcally-mixmonitor-context)"):l.voicemail.options=l.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(l.voicemail.appType&&"custom"===l.voicemail.appType);else switch((l.voicemail.app||l.voicemail.appType).toLowerCase()){case"set":l.voicemail.appdata=l.voicemail.name+"="+l.voicemail.value;break;case"custom":break;default:e[0]=l.voicemail.voiceMail,e[1]=l.voicemail.options,l.voicemail.appdata=e.join(",")}m(l.voicemail)},l.closeDialog=m,o.hasRole("admin")?s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEMAILS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:406}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.voiceMails,{id:e.resourceId})}),n=null;if(l.voicemail&&(n=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail})),n&&!_.some(t,["id",n.id])){var a=_.find(l.voiceMails,{id:n.id});a.canSelect=!1,t.push(a)}l.voiceMails=t})}else{var n=[],a=null;l.voicemail&&(a=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail}));for(var i=0;i<l.voiceMails.length;i++)a&&l.voiceMails[i].id===a.id&&(l.voiceMails[i].canSelect=!1,n.push(l.voiceMails[i]));l.voiceMails=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.internalroute=c||e.params.internalroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoInternalRoutes=function(){e.go("app.voice.internalroutes")},u.saveInternalRoute=function(){r.voiceExtension.update({id:u.internalroute.id},u.internalroute).$promise.then(function(){l.success({title:"InternalRoute updated!",msg:u.internalroute.name?u.internalroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.internalroute&&(n=_.find(u.contexts,{name:u.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","internalroute","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.internalroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="internalroutes",b.listOrder="",b.listOrderAsc=null,b.selectedInternalRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.voice.internalroutes.edit",{id:e.id,internalroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("internalroute")+"?").htmlContent("<b>"+(e.name||"internalroute")+"</b> will be deleted.").ariaLabel("delete internalroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getInternalRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="InternalRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInternalRoute=function(e,t){i.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalroute:t,internalroutes:b.internalroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInternalRoute=S,b.exportSelectedInternalRoutes=function(){var e=angular.copy(b.selectedInternalRoutes);return b.selectedInternalRoutes=[],e},b.deleteSelectedInternalRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected internalroutes?").htmlContent("<b>"+b.selectedInternalRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InternalRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedInternalRoutes.forEach(function(e){S(e)}),b.selectedInternalRoutes=[]})},b.deselectInternalRoutes=function(){b.selectedInternalRoutes=[]},b.selectAllInternalRoutes=function(){b.selectedInternalRoutes=b.internalroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.internalroute&&(n=_.find(b.contexts,{name:b.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.internalroutes=e||{count:0,rows:[]}}function S(e){m.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(b.internalroutes.rows,{id:e.id}),b.internalroutes.count-=1,b.internalroutes.rows.length||b.getInternalRoutes(),p.success({title:_.startCase("InternalRoute")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getInternalRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","internalroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var t=_.find(g.musiconholds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.musiconhold={},c.musiconholdMohSounds={count:0,rows:[]},c.selectedMusicOnHoldMohSounds=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},c.init=function(e,t){c.musiconhold=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.musiconhold.id,c.query.VoiceMusicOnHoldId=c.musiconhold.id,c.getMusicOnHoldMohSounds()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMusicOnHoldDownload=function(s,e,t){return l.sound.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="mohSound"+s.id,a=new Blob(t,{type:e.type});n=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMusicOnHoldMohSounds=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMusicOnHold.getSounds(c.query,p).$promise},c.createOrEditMusicOnHoldMohSound=function(e,t){s.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:c.musiconhold,mohSound:t,mohSounds:c.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(c.selectedMusicOnHoldMohSounds);return c.selectedMusicOnHoldMohSounds=[],e},c.deleteMusicOnHoldMohSound=g,c.deleteSelectedMusicOnHoldMohSounds=function(e){var t=s.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+c.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),c.selectedMusicOnHoldMohSounds=[]})},d.hasRole("admin")?l.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.sounds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.sounds=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.sounds,{id:e.resourceId})}),n=null;if(c.musiconhold&&(n=_.find(c.sounds,{id:Number(c.musiconhold.id)})),n&&!_.some(t,["id",n.id])){var a=_.find(c.sounds,{id:n.id});a.canSelect=!1,t.push(a)}c.sounds=t})}else{var n=[],a=null;c.musiconhold&&(a=_.find(c.sounds,{id:Number(c.musiconhold.id)}));for(var i=0;i<c.sounds.length;i++)a&&c.sounds[i].id===a.id&&(c.sounds[i].canSelect=!1,n.push(c.sounds[i]));c.sounds=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.musiconholdMohSounds=e||{count:0,rows:[]}}function g(e){l.voiceMusicOnHold.removeSound({id:n.params.id,id2:e.id}).$promise.then(function(){_.remove(c.musiconholdMohSounds.rows,{id:e.id}),c.musiconholdMohSounds.count-=1,c.musiconholdMohSounds.rows.length||c.getMusicOnHoldMohSounds(),r.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMusicOnHoldMohSounds())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),t.params.id&&(g.mohSound.VoiceMusicOnHoldId=t.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:t.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var t=_.find(g.mohSounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),n=null;if(g.mohSound&&(n=_.find(g.sounds,{id:Number(g.mohSound.id)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.sounds,{id:n.id});a.canSelect=!1,t.push(a)}g.sounds=t})}else{var n=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,n.push(g.sounds[i]));g.sounds=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds")},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.musiconholds=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="musiconholds",b.listOrder="",b.listOrderAsc=null,b.selectedMusicOnHolds=[],b.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},b.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMusicOnHolds=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceMusicOnHold.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MusicOnHolds",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMusicOnHold=function(e,t){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:t,musiconholds:b.musiconholds.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMusicOnHold=S,b.exportSelectedMusicOnHolds=function(){var e=angular.copy(b.selectedMusicOnHolds);return b.selectedMusicOnHolds=[],e},b.deleteSelectedMusicOnHolds=function(e){var t=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+b.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMusicOnHolds.forEach(function(e){S(e)}),b.selectedMusicOnHolds=[]})},b.deselectMusicOnHolds=function(){b.selectedMusicOnHolds=[]},b.selectAllMusicOnHolds=function(){b.selectedMusicOnHolds=b.musiconholds.rows};var E=!0,A=1;function y(e){b.musiconholds=e||{count:0,rows:[]}}function S(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(b.musiconholds.rows,{id:e.id}),b.musiconholds.count-=1,b.musiconholds.rows.length||b.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,h,d,c,m,u){var f=this;function p(){var e=2,t=[];t.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"CDR(destination)="+(f.outboundroute.cutdigits?"${EXTEN:"+f.outboundroute.cutdigits+"}":"${EXTEN}"),context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+f.outboundroute.id,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),f.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==f.outboundroute.recordingFormat&&(t.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+f.outboundroute.recordingFormat||"wav",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}));for(var n=0,a=0;n<f.outboundrouteApps.rows.length;n++,a=0){var i=f.outboundrouteApps.rows[n],s=[],o=[];i.intervals="*,*,*,*"!==i.interval?[i.interval]:i.IntervalId?_.map(_.filter(f.intervals.rows,{IntervalId:i.IntervalId}),"interval"):[],i.context=f.outboundroute.context,i.exten=f.outboundroute.exten,i.type&&(i.type=i.type.toLowerCase()),i.hasOwnProperty("tag")&&i.tag&&"--"!==i.tag&&s.push({type:i.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+i.tag,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id}),i.callerID?s.push({type:i.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)="+i.callerID+")",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id}):s.push({type:i.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No number available)",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id});for(var r=0;r<i.intervals.length;r++){var l=e+i.intervals.length,d=r===i.intervals.length-1?e+s.length+o.length+2:e+r+1;s.splice(r,0,{type:"outbound",app:"GotoIfTime",appdata:i.intervals[r]+"?"+f.outboundroute.context+",${EXTEN},"+l+":"+f.outboundroute.context+",${EXTEN},"+d,exten:f.outboundroute.exten,context:f.outboundroute.context,priority:e+r,VoiceExtensionId:f.outboundroute.id})}if("outboundDial"===i.appType){var c=_.find(f.apps,{appType:"outboundDial"});if(c&&c.fields){for(var m={},u=i.appdata.split(","),p=[],g=0,v=c.fields.length;g<v;g++)if(c.fields[g].hasOwnProperty("param"))switch(c.fields[g].name){case"trunk":m.trunk=u[c.fields[g].param].split("/")[1],m.phone=u[c.fields[g].param].split("/")[2],m.prefix=m.phone?m.phone.split("$")[0]:void 0,m.phone=f.outboundroute.cutdigits?(m.prefix||"")+"${EXTEN:"+f.outboundroute.cutdigits+"}":(m.prefix||"")+"${EXTEN}",p[c.fields[g].param]=["SIP",m.trunk,m.phone].join("/");break;case"options":m.options=u[c.fields[g].param],"none"!==f.outboundroute.recordingFormat?m.options.indexOf("U(xcally-mixmonitor-context)")<0&&(m.options+="U(xcally-mixmonitor-context)"):m.options=m.options.replace("U(xcally-mixmonitor-context)",""),p[c.fields[g].param]=m.options;break;default:p[c.fields[g].param]=u[c.fields[g].param]}i.appdata=p.join(",")}}i.priority=s.length?_.last(s).priority+1:e,e=(o.length?_.last(o).priority:i.priority)+1,t=_.concat(t,s,[i],o)}t.push({type:"outbound",app:"Hangup",exten:f.outboundroute.exten,context:f.outboundroute.context,priority:e,VoiceExtensionId:f.outboundroute.id}),h.voiceExtension.addApplications({id:f.outboundroute.id},_.sortBy(t,"priority")).$promise.then(function(e){f.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function g(e){a.hide(e)}f.currentUser=d.getCurrentUser(),f.errors=[],f.setting=m,f.license=c,f.crudPermissions=u,f.hasModulePermissions={},f.passwordPattern=f.setting&&f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.title="VOICE.EDIT_OUTBOUNDROUTE",f.outboundroute=angular.copy(l),f.outboundroutes=r,f.newOutboundRoute=!1,f.outboundrouteApps={count:0,rows:[]},f.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}},{name:"tags",route:"tag",filters:{fields:"name",sort:"name",nolimit:!0}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text",ngPattern:"/"(.*)"\\s<(.*?)>$/",help:!0},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),f.outboundroute||(f.outboundroute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},f.title="VOICE.NEW_OUTBOUNDROUTE",f.newOutboundRoute=!0),f.addNewOutboundRoute=function(){f.errors=[],h.voiceExtension.save(f.outboundroute).$promise.then(function(e){f.outboundroutes.unshift(e.toJSON()),o.success({title:"OutboundRoute properly created",msg:f.outboundroute.name?f.outboundroute.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.saveOutboundRoute=function(){f.errors=[],h.voiceExtension.update({id:f.outboundroute.id},f.outboundroute).$promise.then(function(e){var t=_.find(f.outboundroutes,{id:e.id});t&&(_.merge(t,_.pick(e.toJSON(),_.keys(t))),h.voiceExtension.get({sort:"priority",VoiceExtensionId:t.id,isApp:!0,nolimit:!0}).$promise.then(function(e){f.outboundrouteApps=e,p()})),o.success({title:"OutboundRoute properly saved!",msg:f.outboundroute.name?f.outboundroute.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteOutboundRoute=function(n){h.voicePrefix.get({VoiceExtensionId:l.id}).$promise.then(function(e){if(e&&e.rows&&0<e.rows.length)return o.error({title:"Outbound route not deleted!",msg:"You can't remove an outbound route associated to an out prefix"});f.errors=[];var t=a.confirm().title("Are you sure?").content("The outboundroute will be deleted.").ariaLabel("Delete OutboundRoute").ok("Delete").cancel("Cancel").targetEvent(n);a.show(t).then(function(){h.voiceExtension.delete({id:f.outboundroute.id}).$promise.then(function(){_.remove(f.outboundroutes,{id:f.outboundroute.id}),o.success({title:"OutboundRoute properly deleted!",msg:(f.outboundroute.name||"outboundroute")+" has been deleted!"}),g(f.outboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})})},f.getDateFromString=function(e){return null===e?void 0:new Date(e)},f.rewriteRouting=p,f.closeDialog=g,d.hasRole("admin")?h.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):h.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.contexts=e.rows||[]}).then(function(){return h.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:h.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.contexts,{id:e.resourceId})}),n=null;if(f.outboundroute&&(n=_.find(f.contexts,{name:f.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(f.contexts,{id:n.id});a.canSelect=!1,t.push(a)}f.contexts=t}):h.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){f.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","outboundroutes","outboundroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(b,i,a,s,n,e,t){var E=this;function o(e,t){if(E.outboundrouteApps.rows.length){var n=E.outboundrouteApps.rows[t]?E.outboundrouteApps.rows[t]:E.outboundrouteApps.rows[0];i.show({controller:"EditoutboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundrouteApp:n,outboundroute:E.outboundroute,crudPermissions:E.crudPermissions}}).then(function(e){e&&(e.id?E.outboundrouteApps.rows[t]=e:E.outboundrouteApps.rows.splice(t,0,e),r())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function r(e){var t=2,n=[];n.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"CDR(destination)="+(E.outboundroute.cutdigits?"${EXTEN:"+E.outboundroute.cutdigits+"}":"${EXTEN}"),context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"CDR(routeid)="+E.outboundroute.id,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id});var a=t++;n.push({type:"outbound",app:"ExecIf",appdata:"$[${LEN(${CDR(prefix)})} > 0]?Goto("+(a+2)+"):Goto("+(a+1)+")",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:a,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:E.outboundroute.cutdigits?"CDR(prefix)=${EXTEN:0:"+E.outboundroute.cutdigits+"}":"CDR(prefix)=noprefix",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+E.outboundroute.id,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),E.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==E.outboundroute.recordingFormat&&(n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+E.outboundroute.recordingFormat||"wav",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}));for(var i=0,s=0;i<E.outboundrouteApps.rows.length;i++,s=0){var o=E.outboundrouteApps.rows[i],r=[],l=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(E.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=E.outboundroute.context,o.exten=E.outboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("tag")&&o.tag&&"--"!==o.tag&&r.push({type:o.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+o.tag,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id}),o.callerID?r.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)="+o.callerID+")",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id}):r.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No number available)",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id});for(var d=0;d<o.intervals.length;d++){var c=t+o.intervals.length,m=d===o.intervals.length-1?t+r.length+l.length+2:t+d+1;r.splice(d,0,{type:"outbound",app:"GotoIfTime",appdata:o.intervals[d]+"?"+E.outboundroute.context+",${EXTEN},"+c+":"+E.outboundroute.context+",${EXTEN},"+m,exten:E.outboundroute.exten,context:E.outboundroute.context,priority:t+d,VoiceExtensionId:E.outboundroute.id})}if(e&&"outboundDial"===o.appType){var u=_.find(E.apps,{appType:"outboundDial"});if(u&&u.fields){for(var p={},g=o.appdata.split(","),v=[],h=0,f=u.fields.length;h<f;h++)if(u.fields[h].hasOwnProperty("param"))switch(u.fields[h].name){case"trunk":p.trunk=g[u.fields[h].param].split("/")[1],p.phone=g[u.fields[h].param].split("/")[2],p.prefix=p.phone?p.phone.split("$")[0]:void 0,p.phone=E.outboundroute.cutdigits?(p.prefix||"")+"${EXTEN:"+E.outboundroute.cutdigits+"}":(p.prefix||"")+"${EXTEN}",v[u.fields[h].param]=["SIP",p.trunk,p.phone].join("/");break;case"options":p.options=g[u.fields[h].param],"none"!==E.outboundroute.recordingFormat?p.options.indexOf("U(xcally-mixmonitor-context)")<0&&(p.options+="U(xcally-mixmonitor-context)"):p.options=p.options.replace("U(xcally-mixmonitor-context)",""),v[u.fields[h].param]=p.options;break;default:v[u.fields[h].param]=g[u.fields[h].param]}o.appdata=v.join(",")}}o.priority=r.length?_.last(r).priority+1:t,t=(l.length?_.last(l).priority:o.priority)+1,n=_.concat(n,r,[o],l)}n.push({type:"outbound",app:"Hangup",exten:E.outboundroute.exten,context:E.outboundroute.context,priority:t,VoiceExtensionId:E.outboundroute.id}),b.voiceExtension.addApplications({id:E.outboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){E.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function l(e){E.outboundrouteApps=e||{count:0,rows:[]}}E.currentUser=t.getCurrentUser(),E.outboundroute={},E.outboundrouteApps={count:0,rows:[]},E.selectedOutboundRouteApps=[],E.crudPermissions,E.query={sort:"priority"},E.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}},{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text",help:!0},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),E.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},E.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){o(e,e.newIndex)},onSort:function(e){r()}},E.init=function(e,t){E.outboundroute=e,E.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},E.applications.disabled=!E.crudPermissions.canEdit,n.on("voiceExtension:update",E.onVoiceExtensionUpdate),E.query.VoiceExtensionId=e.id,E.query.isApp=!0,E.query.nolimit=!0,E.getOutboundRouteApps(),E.getIntervals()},E.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){E.outboundrouteApps.rows.splice(t,1),r()},function(){console.log("CANCEL")})},E.getOutboundRouteApps=function(){E.promise=b.voiceExtension.get(E.query,l).$promise},E.editOutboundRouteApp=o,E.editInterval=function(e,t){if(E.outboundrouteApps.rows.length){var n=E.outboundrouteApps.rows[t]?E.outboundrouteApps.rows[t]:E.outboundrouteApps.rows[0];i.show({controller:"EditoutboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:E.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,r())})}},E.deleteOutboundRouteApp=function(e){_.remove(E.outboundrouteApps.rows,{id:e.id}),r(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},E.deleteSelectedOutboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+E.selectedOutboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){E.selectedOutboundRouteApps.forEach(function(e){_.remove(E.outboundrouteApps.rows,{id:e.id})}),E.selectedOutboundRouteApps=[],r()})},E.rewriteRouting=r,E.getIntervals=function(){return b.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){E.intervals=e}).catch(function(e){console.error(e)})},E.onVoiceExtensionUpdate=function(e){e.VoiceExtensionId===E.outboundroute.id&&r(!0)},e.$on("$destroy",function(){n.removeAllListeners("voiceExtension:update")})}e.$inject=["api","$mdDialog","$document","toasty","socket","$scope","Auth"],angular.module("app.voice").controller("OutboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveOutboundRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","outboundrouteApp","outboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppcustomDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.outbounddial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.outbounddial.appdata)switch(l.outbounddial.appType?l.outbounddial.appType.toLowerCase():l.outbounddial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.outbounddial.appdata.split(",");l.outbounddial.key=d[0],l.outbounddial.language=d[1],l.outbounddial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.outbounddial.appdata.split(",");l.outbounddial.accesskeyid=d[0],l.outbounddial.secretaccesskey=d[1],l.outbounddial.lexregion=d[2],l.outbounddial.botname=d[3],l.outbounddial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.outbounddial.appdata.split(",");l.outbounddial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.outbounddial.text=d.slice(1,d.length).join(",");break;case"message":l.outbounddial.text=l.outbounddial.appdata;break;case"set":l.outbounddial.name=l.outbounddial.appdata.split("=")[0],l.outbounddial.value=l.outbounddial.appdata.split("=")[1];break;case"agi":l.outbounddial.project=l.outbounddial.appdata;break;default:var c=l.outbounddial.appdata.split(",");l.outbounddial.trunk=c[0].split("/")[1],l.outbounddial.phone=c[0].split("/")[2],l.outbounddial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.outbounddial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.outbounddial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.outbounddial.type&&"outbound"===l.outbounddial.type.toLowerCase()&&"outbounddial"===l.outbounddial.appType.toLowerCase()&&(l.outbounddial.prefix=l.outbounddial.phone?l.outbounddial.phone.split("$")[0]:void 0,l.outbounddial.callerId=l.outbounddial.callerID?"CALLERID(all)="+l.outbounddial.callerID:void 0),l.saveOutboundRouteApp=function(){l.errors=[];var e=[];l.outbounddial.type&&"outbound"===l.outbounddial.type.toLowerCase()&&"outboundDial"===l.outbounddial.appType&&(l.outbounddial.phone=i.cutdigits?(l.outbounddial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.outbounddial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.outbounddial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.outbounddial.options+="U(xcally-mixmonitor-context)"):l.outbounddial.options=l.outbounddial.options.replace("U(xcally-mixmonitor-context)",""));if(l.outbounddial.appType&&"custom"===l.outbounddial.appType);else switch((l.outbounddial.app||l.outbounddial.appType).toLowerCase()){case"set":l.outbounddial.appdata=l.outbounddial.name+"="+l.outbounddial.value;break;case"custom":break;default:e[0]=["SIP",l.outbounddial.trunk,l.outbounddial.phone].join("/"),e[1]=l.outbounddial.timeout,e[2]=l.outbounddial.options,e[3]=l.outbounddial.url,l.outbounddial.appdata=e.join(",")}m(l.outbounddial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.outbounddial&&(n=_.find(l.trunks,{name:l.outbounddial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.outbounddial&&(a=_.find(l.trunks,{name:l.outbounddial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.outbounddial&&(n=_.find(l.tags,{name:l.outbounddial.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.outbounddial&&(a=_.find(l.tags,{name:l.outbounddial.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","outboundrouteApp","outboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppoutbounddialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.outboundroute=c||e.params.outboundroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoOutboundRoutes=function(){e.go("app.voice.outboundroutes")},u.saveOutboundRoute=function(){r.voiceExtension.update({id:u.outboundroute.id},u.outboundroute).$promise.then(function(){l.success({title:"OutboundRoute updated!",msg:u.outboundroute.name?u.outboundroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.outboundroute&&(n=_.find(u.contexts,{name:u.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","outboundroute","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.outboundroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="outboundroutes",b.listOrder="",b.listOrderAsc=null,b.selectedOutboundRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.arrayrecordingFormat=_.keyBy([{option:"none",value:"'none'"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.outboundroutes.edit",{id:e.id,outboundroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("outboundroute")+"?").htmlContent("<b>"+(e.name||"outboundroute")+"</b> will be deleted.").ariaLabel("delete outboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getOutboundRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OutboundRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOutboundRoute=function(e,t){i.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundroute:t,outboundroutes:b.outboundroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOutboundRoute=S,b.exportSelectedOutboundRoutes=function(){var e=angular.copy(b.selectedOutboundRoutes);return b.selectedOutboundRoutes=[],e},b.deleteSelectedOutboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected outboundroutes?").htmlContent("<b>"+b.selectedOutboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete OutboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOutboundRoutes.forEach(function(e){S(e)}),b.selectedOutboundRoutes=[]})},b.deselectOutboundRoutes=function(){b.selectedOutboundRoutes=[]},b.selectAllOutboundRoutes=function(){b.selectedOutboundRoutes=b.outboundroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.outboundroute&&(n=_.find(b.contexts,{name:b.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.outboundroutes=e||{count:0,rows:[]}}function S(t){m.voicePrefix.get({VoiceExtensionId:t.id}).$promise.then(function(e){if(e&&e.rows&&0<e.rows.length)return p.error({title:"Outbound route not deleted!",msg:"You can't remove an outbound route associated to an out prefix"});m.voiceExtension.delete({id:t.id}).$promise.then(function(){_.remove(b.outboundroutes.rows,{id:t.id}),b.outboundroutes.count-=1,b.outboundroutes.rows.length||b.getOutboundRoutes(),p.success({title:_.startCase("OutboundRoute")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOutboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","outboundroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this,h=!0;function f(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.contacts:"+v.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(v.query=_.merge(e.query,_.omit(v.query,["sort","limit","page"])),v.query=_.omit(v.query,"filter")),d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()}):o.userProfile.getResources({id:v.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()})}function b(e){v.contacts=e||{count:0,rows:[]},h=!1,v.refresh=!0}v.showTooltip=!1,v.refresh=!0,v.disable=[],v.agents=p||[],v.currentUser=d.getCurrentUser(),v.localizationMap=u,v.pickerModel={dateStart:null,dateEnd:null},v.queues={},v.contacts={count:0,rows:[]},v.dispositions=g,v.userProfile=r,v.userProfileSection=l&&1==l.count?l.rows[0]:null,v.crudPermissions=d.parseCrudPermissions(v.userProfileSection?v.userProfileSection.crudPermissions:null),v.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},v.clearAll=function(){v.query.createdAt=void 0,v.pickerModel={dateStart:null,dateEnd:null},v.getContacts()},v.getContacts=function(){if(v.refresh=!1,v.pickerModel.dateStart&&!h){var e=moment(v.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();v.query.createdAt={$gte:v.pickerModel.dateStart,$lte:e}}else v.query.createdAt=void 0;v.query.queue=v.query.queue,v.query.offset=(v.query.page-1)*v.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.contacts:"+v.currentUser.id,JSON.stringify({query:_.omit(v.query,"queue")})),v.promise=o.voiceQueueReport.getVoiceQueuesReport(v.query,b).$promise},v.refreshContacts=function(){v.showTooltip=!1,v.getContacts()},v.onInit=f,v.assignedA=function(e,t){e&&(v.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){v.disable[e.id]=!1}))},v.disposed=function(e,t){e&&o.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},v.onSavevoiceQueueReport=function(e){e&&v.queuesMap&&"inbound"===e.type&&v.queuesMap[e.queue]&&(v.showTooltip=!0)},v.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(v.contacts.rows,["id",e.id]);0<=t&&_.merge(v.contacts.rows[t],e)}},c.onWithoutApply("voiceQueueReport:save",v.onSavevoiceQueueReport),c.on("voiceQueueReport:update",v.onUpdatevoiceQueueReport),f();var E=!0,A=1;e.$watch("vm.query.filter",function(e,t){E?n(function(){E=!1}):(t||(A=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=A),v.getContacts())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","dateFilterLocalizationFactory","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.channelStatusOut,o.onSave=function(e){var t=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",t?_.merge(t,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var t=_.findIndex(o.calls.rows,{channel:e.channel});0<=t&&(o.calls.rows[t].status="hangup");n(function(){o.calls.rows.splice(t,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.agents=n||{count:0,rows:[]},p.queues=i?_.keyBy(i.rows?i.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=s?_.keyBy(s.rows?_.filter(s.rows,{type:"inbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,t){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[t]=e)})},p.onSave=function(e){"inbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){d.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(t,e,n){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e,context:n}).$promise.then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){_.forIn(c.queues,function(e,t){c.rpcQueues[t]&&_.merge(e,_.pick(c.rpcQueues[t],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].VoiceQueueId].paused++,g.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,g.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.voiceQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="VoiceQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditVoiceQueue=function(e,t){a.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:g.queues?g.queues.rows:[],realtime:!0,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.VoiceQueueId]&&(g.queues[e.VoiceQueueId].loggedInDb+=1,g.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.VoiceQueueId]&&0<g.queues[e.VoiceQueueId].loggedInDb&&(g.queues[e.VoiceQueueId].loggedInDb-=1,delete g.queues[e.VoiceQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.onWithoutApply("voice_queue:save",g.onSave),g.interval=s(function(){},999),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),g.interval&&s.cancel(g.interval),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){var a=this;switch(t.disconnect(),t.connect(),a.selectedTab=0,n.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,n.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.voice.realtime.agents");break;case 1:n.go("app.voice.realtime.telephones");break;case 2:n.go("app.voice.realtime.trunks");break;case 3:n.go("app.voice.realtime.queues");break;case 4:n.go("app.voice.realtime.queue_calls");break;case 5:n.go("app.voice.realtime.abandonedcalls");break;case 6:n.go("app.voice.realtime.queue_params");break;case 7:n.go("app.voice.realtime.outbound_calls");break;default:n.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,t){m.rpcTelephones[t]&&_.merge(e,_.pick(m.rpcTelephones[t],u))})}m.count=a.count,m.attributes=["fullname","internal","state","status","address"],m.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},m.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},m.statusClass=r.status,m.stateClass=r.state,m.success=h,m.$onInit=p,m.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},p()}e.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,t=0;t<u.trunks.length;t+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[t].id]))&&_.merge(u.trunks[t],_.pick(u.rpcTrunks[e],p))}function v(e,t,n){0<=t&&_.merge(e[t],_.pick(n,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},u.onSave=function(e){var t=_.findIndex(u.trunks,["id",e.id]),n=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,t,e),v(u.rpcTrunks,n,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var t=_.find(g.voicemails,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.voicemail={},c.voicemailMessages={count:0,rows:[]},c.selectedVoicemailMessages=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},c.init=function(e,t){c.voicemail=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.voicemail.id,c.getVoicemailMessages()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMailMessageDownload=function(s,e,t){return l.voiceMailMessage.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="message"+s.id,a=new Blob(t,{type:e.type});n=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getVoicemailMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMail.getMessages(c.query,p).$promise},c.createOrEditVoicemailMessage=function(e,t){s.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:c.voicemail,message:t,messages:c.voicemailMessages.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedVoicemailMessages=function(){var e=angular.copy(c.selectedVoicemailMessages);return c.selectedVoicemailMessages=[],e},c.deleteVoicemailMessage=g,c.deleteSelectedVoicemailMessages=function(e){var t=s.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+c.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedVoicemailMessages.forEach(function(e){g(e)}),c.selectedVoicemailMessages=[]})};var m=!0,u=1;function p(e){c.voicemailMessages=e||{count:0,rows:[]}}function g(e){l.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.voicemailMessages.rows,{id:e.id}),c.voicemailMessages.count-=1,c.voicemailMessages.rows.length||c.getVoicemailMessages(),r.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getVoicemailMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails")},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.voicemail&&(n=_.find(u.contexts,{name:u.voicemail.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voicemails=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voicemails",b.listOrder="",b.listOrderAsc=null,b.selectedVoicemails=[],b.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},b.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoicemails=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceMail.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Voicemails",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoicemail=function(e,t){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:t,voicemails:b.voicemails.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoicemail=S,b.exportSelectedVoicemails=function(){var e=angular.copy(b.selectedVoicemails);return b.selectedVoicemails=[],e},b.deleteSelectedVoicemails=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+b.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoicemails.forEach(function(e){S(e)}),b.selectedVoicemails=[]})},b.deselectVoicemails=function(){b.selectedVoicemails=[]},b.selectAllVoicemails=function(){b.selectedVoicemails=b.voicemails.rows};var E=!0,A=1;function y(e){b.voicemails=e||{count:0,rows:[]}}function S(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(b.voicemails.rows,{id:e.id}),b.voicemails.count-=1,b.voicemails.rows.length||b.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var t=_.find(g.voicePrefixes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),n=null;if(g.voicePrefix&&(n=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}g.outboundRoutes=t})}else{var n=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,n.push(g.outboundRoutes[i]));g.outboundRoutes=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voicePrefixes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voicePrefixes",b.listOrder="",b.listOrderAsc=null,b.selectedVoicePrefixes=[],b.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:b.voicePrefixes.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:b.voicePrefixes?b.voicePrefixes.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoicePrefixes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voicePrefix.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoicePrefixes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditvoicePrefix=function(e,t){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:t,voicePrefixes:b.voicePrefixes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletevoicePrefix=S,b.exportSelectedVoicePrefixes=function(){var e=angular.copy(b.selectedVoicePrefixes);return b.selectedVoicePrefixes=[],e},b.deleteSelectedVoicePrefixes=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+b.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoicePrefixes.forEach(function(e){S(e)}),b.selectedVoicePrefixes=[]})},b.deselectVoicePrefixes=function(){b.selectedVoicePrefixes=[]},b.selectAllVoicePrefixes=function(){b.selectedVoicePrefixes=b.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){b.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){b.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.outboundRoutes,{id:e.resourceId})}),n=null;if(b.voicePrefix&&(n=_.find(b.outboundRoutes,{id:Number(b.voicePrefix.VoiceExtensionId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}b.outboundRoutes=t})}else{var n=[],a=null;b.voicePrefix&&(a=_.find(b.outboundRoutes,{id:Number(b.voicePrefix.VoiceExtensionId)}));for(var i=0;i<b.outboundRoutes.length;i++)a&&b.outboundRoutes[i].id===a.id&&(b.outboundRoutes[i].canSelect=!1,n.push(b.outboundRoutes[i]));b.outboundRoutes=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.voicePrefixes=e||{count:0,rows:[]}}function S(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(b.voicePrefixes.rows,{id:e.id}),b.voicePrefixes.count-=1,b.voicePrefixes.rows.length||b.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEQUEUE",g.voiceQueue=angular.copy(l),g.voiceQueues=r,g.newVoiceQueue=!1,g.voiceQueue||(g.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},g.title="VOICE.NEW_VOICEQUEUE",g.newVoiceQueue=!0),g.addNewVoiceQueue=function(){g.errors=[],d.voiceQueue.save(g.voiceQueue).$promise.then(function(e){g.voiceQueues.unshift(e.toJSON()),o.success({title:"VoiceQueue properly created",msg:g.voiceQueue.name?g.voiceQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceQueue=function(){g.errors=[],d.voiceQueue.update({id:g.voiceQueue.id},g.voiceQueue).$promise.then(function(e){var t=_.find(g.voiceQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceQueue properly saved!",msg:g.voiceQueue.name?g.voiceQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceQueue.delete({id:g.voiceQueue.id}).$promise.then(function(){_.remove(g.voiceQueues,{id:g.voiceQueue.id}),o.success({title:"VoiceQueue properly deleted!",msg:(g.voiceQueue.name||"voiceQueue")+" has been deleted!"}),v(g.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceQueues","voiceQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=t,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!i,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s){var c=this;function o(){return l(function(n,t){return l(function(t,n){return d.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],i.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:i.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});i.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getTeams({id:c.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){return _.find(c.items,{id:e.id})}),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=i.getCurrentUser(),c.voiceQueue=t,c.crudPermissions=s,c.penalty=0,c.items=[],c.allowedItems=[],c.selectedItems=[],c.addedItems=[],c.removedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("VOICE.ALL_TEAMS"),labelSelected:n.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,t){t?c.removedItems=_.unionBy(e,c.removedItems,"id"):(e.forEach(function(e){e.penalty="penalty "+c.penalty}),c.addedItems=_.unionBy(e,c.addedItems,"id")),c.pendingChanges=!0}},c.onInit=function(){return i.hasRole("admin")?o().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,o()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveTeams=function(){var e=c.removedItems,t=c.addedItems;return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeTeams({id:c.voiceQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addTeams({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.addedItems=[],c.removedItems=[],a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||n.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.teamadddialog=function(e,t){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){n.go("app.voice.voiceQueues")},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),n=null;if(u.voiceQueue&&(n=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),n&&!_.some(t,["id",n.id])){var a=_.find(u.musiconholds,{id:n.id});a.canSelect=!1,t.push(a)}u.musiconholds=t}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.sounds=t})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceQueues",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceQueues=[],b.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayjoinempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknoww",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:b.voiceQueues?b.voiceQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:b.voiceQueues?b.voiceQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.queues",{})}},b.success=y,b.getVoiceQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoiceQueue=function(e,t){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:b.voiceQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceQueue=S,b.exportSelectedVoiceQueues=function(){var e=angular.copy(b.selectedVoiceQueues);return b.selectedVoiceQueues=[],e},b.deleteSelectedVoiceQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+b.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoiceQueues.forEach(function(e){S(e)}),b.selectedVoiceQueues=[]})},b.deselectVoiceQueues=function(){b.selectedVoiceQueues=[]},b.selectAllVoiceQueues=function(){b.selectedVoiceQueues=b.voiceQueues.rows};var E=!0,A=1;function y(e){b.voiceQueues=e||{count:0,rows:[]}}function S(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceQueues.rows,{id:e.id}),b.voiceQueues.count-=1,b.voiceQueues.rows.length||b.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var t=_.find(g.voiceRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,page:1},b.localizationMap=f,b.pickerModel={dateStart:null},b.downloadfile2=function(s,e){return m.voiceRecording.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoiceRecordings=function(){if(b.pickerModel.dateStart){var e=moment(b.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();b.query.createdAt={$gte:b.pickerModel.dateStart,$lte:e}}else b.query.createdAt=void 0;b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoiceRecording=function(e,t){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:t,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=S,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);return b.selectedVoiceRecordings=[],e},b.deleteSelectedVoiceRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoiceRecordings.forEach(function(e){S(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.clearDateFilter=function(){b.pickerModel={dateStart:null},b.getVoiceRecordings()};var E=!0,A=1;function y(e){b.voiceRecordings=e||{count:0,rows:[]}}function S(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(t,n,s,a,o,e,i,r){var l=this;function d(e,t){return{id:e,title:t.name||"NONAME",state:"app.dashboards.custom",stateParams:t,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(e)&&!o.hasRole("admin")}}}function c(e,t){return{id:e,title:t.name||"NONAME",state:"app.plugins.plugin",stateParams:t,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(e)&&!o.hasRole("admin")}}}function m(e,t){a.saveItem("apps.home.plugin_"+e,{id:e,title:t.name,translate:t.name,state:"plugin_"+t.id,stateParams:t,view:"plugin",icon:t.icon,weight:12,hidden:function(){return!o.hasPermission(e)}})}function u(e){return _.map(e.children,function(e){return e.id})}l.isAgent=function(){return o.getCurrentUser()&&o.hasRole("agent")},s.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return o.hasRole("agent")}}),i.version.get().$promise.then(function(e){l.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(e){l.version="UNKNOWN"}).finally(function(){s.saveItem("version",{title:"VERSION "+l.version,group:!0,weight:2,hidden:function(){return o.hasRole("agent")}})}),o.isLoggedIn()&&(i.dashboard.get().$promise.then(function(e){for(var t=0,n=0;n<e.rows.length;n+=1)t=99999+e.rows[n].id,s.saveItem("apps.dashboards.custom_"+t,d(t,e.rows[n]))}),i.plugin.get({active:!0}).$promise.then(function(e){var t=0;if(e.count){var n=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<n.length){s.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}});for(var a=0;a<n.length;a+=1)t=88888+n[a].id,s.saveItem("apps.plugins.plugin_"+t,c(t,n[a]));s.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(a=0;a<i.length;a+=1)m(t=88888+i[a].id,i[a])}})),e.custom&&!r.defaultPageTitle&&r.pageTitle&&angular.element("#pageTitle").html(r.pageTitle),s.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(101)&&!o.hasRole("admin")}}),s.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return o.hasRole("agent")||o.hasRole("user")||!o.hasPermission(201)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(202)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(203)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(204)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(205)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!e.cm||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(301)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(302)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(304)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(303)&&!o.hasRole("admin")}}),s.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!e.voice||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(401)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.inboundroutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(402)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.outboundroutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(403)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.internalroutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(404)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(405)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(406)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(407)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(408)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(409)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(410)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(411)&&!o.hasRole("admin")}}),s.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!e.chat||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(501)&&!o.hasRole("admin")}}),s.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(502)&&!o.hasRole("admin")}}),s.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(510)&&!o.hasRole("admin")}}),s.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!e.mail||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(601)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(602)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(603)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(610)&&!o.hasRole("admin")}}),s.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!e.messaging||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(701)&&!o.hasRole("admin")}}),s.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(702)&&!o.hasRole("admin")}}),s.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(710)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!e.openchannel||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(801)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(802)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(810)&&!o.hasRole("admin")}}),s.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!e.fax||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(901)&&!o.hasRole("admin")}}),s.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(902)&&!o.hasRole("admin")}}),s.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(910)&&!o.hasRole("admin")}}),s.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:13,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1001)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1002)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1003)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1004)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1005)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1006)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1007)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1008)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1009)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1010)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1011)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1012)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:11,hidden:function(){return!e.voice||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1101)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1102)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1103)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:14,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1201)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1202)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1203)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:15,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1301)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1302)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1303)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1305)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1306)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1307)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1308)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1309)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1310)&&!o.hasRole("admin")}}),s.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:18,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!e.custom||o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!e.update||o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!e.dialer||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1501)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1502)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1510)&&!o.hasRole("admin")}}),s.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:19,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1600)&&!o.hasRole("admin")}}),s.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1600)&&!o.hasRole("admin")}}),s.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:12,hidden:function(){return!e.jscripty||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1701)&&!o.hasRole("admin")}}),s.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:16,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1801)&&!o.hasRole("admin")}}),s.sort(),a.saveItem("apps",{title:"APPS",group:!0,weight:1}),a.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),a.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!o.hasPermission(101)}}),a.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:2,hidden:function(){return!e.cm||!o.hasPermission(102)}}),a.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:3,hidden:function(){return!e.cm||!o.hasPermission(103)}}),a.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:3,hidden:function(){return!e.dialer||!o.hasPermission(113)}}),a.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:4,hidden:function(){return!e.voice||!o.hasPermission(110)}}),a.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:5,hidden:function(){return!e.voice||!o.hasPermission(111)}}),a.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:6,hidden:function(){return!e.voice||!o.hasPermission(104)}}),a.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:7,hidden:function(){return!e.chat||!o.hasPermission(105)}}),a.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:8,hidden:function(){return!e.mail||!o.hasPermission(106)}}),a.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:9,hidden:function(){return!e.messaging||!o.hasPermission(107)}}),a.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-A200-fg",weight:10,hidden:function(){return!e.openchannel||!o.hasPermission(108)}}),a.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:11,hidden:function(){return!e.fax||!o.hasPermission(109)}}),t.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===t.$id&&n.$broadcast("msSplashScreen::remove")})}e.$inject=["$scope","$rootScope","msNavigationService","msNavigationAgentService","Auth","license","api","setting"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,t,n,a,o,r){var i=this;function s(e){if(e&&e.id){var t=99999+e.id;o.saveItem("apps.dashboards.custom_"+t,{id:t,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(t)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var t=88888+e.id;o.saveItem("apps.plugins.plugin_"+t,{id:t,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(t)&&!r.hasRole("admin")}}),o.sort()}}else{t=88888+e.id;n=1900,a=t,i=o.getNavigation(),(s=_.find(i[0].children,{id:n}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+t),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var n,a,i,s}function d(e){var t=o.getNavigation(),n=_.find(t[0].children,{id:e});return!!(n&&0<n.children.length)}i.bodyEl=angular.element("body"),i.msScrollOptions={suppressScrollX:!0},i.setting=n,i.$onInit=function(){i.folded="true"===t.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,t.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var t=99999+e.id;o.deleteItem("apps.dashboards.custom_"+t)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var t=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+t),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,t,n,s,o,r){var l=this;function d(n){o.isSupported()?o.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=n).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=t.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},n.on("chatInternalMessage:save",l.onMessageSave),n.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(s.chatGroup.getUnread({id:n[a].id}).$promise);return i.all(t)}).then(function(e){for(var t=0;t<e.length;t++)l.unreadTotalGroupMessages+=e[t].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){n.removeAllListeners("chatInternalMessage:save"),n.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;function p(e){var t=angular.element("#chat-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){t.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){t.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return t.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",n.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var t=0;t<u.user.messages.rows.length;t+=1)!1===u.user.messages.rows[t].read&&u.user.messages.rows[t].ToId===u.currentUser.id&&n.chatInternalMessage.update({id:u.user.messages.rows[t].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",n.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),n.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var t=_.find(u.users.rows,{id:e.FromId});t&&(t.lastMessageAt=e.createdAt,t.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var t=_.find(u.user.messages.rows,{id:e.id});t&&_.merge(t,e)}var n=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});n&&n.lastMessage&&_.merge(n.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var t=_.find(u.users.rows,{id:e.id});t&&(_.isNil(e.online)||t.online===e.online||(t.online=e.online),_.isNil(e.allowmessenger)||t.allowmessenger===e.allowmessenger||(t.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},s.on("chatInternalMessage:save",u.onMessageSave),s.on("chatInternalMessage:update",u.onMessageUpdate),s.on("user:update",u.onUserUpdate),o("quick-panel").onClose(function(){u.user=void 0}),n.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),n.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){s.removeAllListeners("chatInternalMessage:save"),s.removeAllListeners("chatInternalMessage:update"),s.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var n;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var t=_.map(d.group.members,"id");return t.unshift(d.currentUser.id),n=e,s.chatGroup.addMembers({id:n.id,ids:t}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:n.name+" has been saved!"}),c(n)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((t=e,n=angular.lowercase(t),function(e){var t=e.name.toLowerCase();return-1!=t.indexOf(n)})):[];var t,n}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,n,a,s,t,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var t=angular.element("#chat-group-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var t=0,n=[];t<e.rows.length;t++)e.rows[t].unreadGroupMessages=0,c.groups[e.rows[t].id]=e.rows[t],n.push(r.chatGroup.getUnread({id:e.rows[t].id}).$promise);return o.all(n)}).then(function(e){for(var t=0;t<e.length;t++)c.groups[e[t].id].unreadGroupMessages+=e[t].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,t){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,t){var n=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var t=[];a.messages=e.rows,a.messages.unshift(i);for(var n=0;n<a.messages.length;n++)t.push(r.user.get({id:a.messages[n].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(t)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(t){c.group={id:t.id,write:t.write,messages:{}},r.chatGroup.getMembers({id:t.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:t.id,nolimit:!0}).$promise}).then(function(e){for(var t,n=0,a=[];n<e.count;n++)e.rows[n].ToId===c.currentUser.id&&(t=e.rows[n],c.group.messages[t.id]=t,e.rows[n].ToId!=c.currentUser.id||e.rows[n].FromId===c.currentUser.id||t.read||a.push(r.chatInternalMessage.update({id:t.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var n={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(n).$promise.then(function(e){n.read=!1,n.ChatInternalMessageId=e.id;for(var t=0;t<c.group.members.length;t++)c.group.members[t].id!==c.currentUser.id&&(n.ToId=c.group.members[t].id,a.push(r.chatGroup.addMessage(angular.copy(n)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(t){if(!c.group&&t.ToId===c.currentUser.id&&t.FromId!==c.currentUser.id&&!t.read&&t.ChatGroupId){var e=c.groups[t.ChatGroupId];if(!e)return r.chatGroup.get({id:t.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&t.ChatGroupId===c.group.id&&t.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:t.id,read:!0}).$promise.then(function(){var e;e=t,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),t("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){t.success({title:n.instant("RESETPASSWORD.PASSWORD_RESET"),msg:n.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&t.error({title:n.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&t.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.user=a,o.setting=i,o.reset=s,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.user.id},{oldPassword:o.oldPassword,newPassword:o.password}).$promise.then(function(){t.show(t.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),r()}).catch(function(e){console.error(e),o.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){var l=this;function d(e){_.isNil(e)&&s.cmHopper.update({id:l.preview.id,UserId:null}),a.hide()}l.customFieldsMap=r&&r.rows?_.mapValues(_.keyBy(r.rows,function(e){return"cf_"+e.id}),"name"):{},l.errors=[],l.hopperIds=[],l.preview=o,l.originated=!1,l.disable=!1,l.disableGetContact=!1,l.hopperIds.push(l.preview.id),l.originatePreview=function(){l.originated=!0,l.disable=!0,_.isEmpty(l.preview)?(i.error({title:"Message",msg:"Contact not available"}),l.disable=!1,l.hopperIds=[],d(!0)):s.rpc.getVoiceQueuesPreview({id:l.preview.id}).$promise.then(function(e){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){l.disable=!1,l.hopperIds=[]})},l.closeDialog=d,l.nextContact=function(){return l.disableGetContact=!0,s.cmHopper.getPreview({hopperIds:l.hopperIds,direction:"next"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(l.disableGetContact=!1,l.hopperIds=[],404===e.status)l.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){a.hide();for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.previousContact=function(){if(l.disableGetContact=!0,1<l.hopperIds.length){var e=_.without(l.hopperIds,l.preview.id);return s.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(_.remove(l.hopperIds,function(e){return e==l.preview.id}),l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e)}).catch(function(e){if(404===e.status)l.hopperIds=[l.preview.id],i.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){l.hopperIds=[],a.hide();for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else l.hopperIds=[],a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},l.getFirstAvailableContact=function(){return l.disableGetContact=!0,i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),s.cmHopper.getPreview({hopperIds:[l.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){l.disableGetContact=!1})},l.isCustomField=function(e){return _.startsWith(e,"cf_")},l.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},l.isNil=function(e){return _.isNil(e)},e.$on("$destroy",function(){l.originated||s.cmHopper.update({id:l.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview","customFields"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(e,t,s,n,o,a,i,r,l,d,c,m,u,p,g,v,h,f,b,E,A){var y,S=this;function T(e){S.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function I(){S.promise=f.user.getQueues(S.query,T).$promise}function C(e){return v.logout(e).then(function(){return h.disconnect(),t.$broadcast("webrtc::logout"),n.go("app.login")}).catch(function(e){console.error(e)})}function w(e,t){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!t,locals:{user:S.user,setting:E,reset:t}})}S.voiceQueues={},S.polling=!0,t.global={search:""},S.pauses=[],S.license=b,S.currentUser=v.getCurrentUser(),S.unreadTotalMessages=0,S.unreadTotalGroupMessages=0,S.contcts=0,"agent"===S.currentUser.role&&(y=A(function(){_.some(S.voiceQueues,{dialMethod:"preview",dialActive:!0})&&S.license.dialer&&S.polling?(S.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(S.contacts=e.contacts)}).finally(function(){S.polling=!0})):S.contacts=0},14999)),S.setting=E,S.bodyEl=angular.element("body"),S.conf={realm:"asterisk",host:a.host(),protocol:a.protocol(),remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:S.license.webrtc,phoneBarExpires:S.currentUser.phoneBarExpires,phoneBarPrefixRequired:S.currentUser.phoneBarPrefixRequired},S.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},S.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],S.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}},S.toggleSidenav=function(e){i(e).toggle()},S.logout=C,S.changeLanguage=function(e){if(!S.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}S.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===n.current.name&&d.location.reload()},S.setUserStatus=function(e){S.userStatus=e},S.toggleHorizontalMobileMenu=function(){S.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},S.toggleMsNavigationFolded=function(){g.toggleFolded()},S.search=function(t){for(var e=[],n=g.getFlatNavigation(),a=s.defer(),i=0;i<n.length;i++)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},S.searchResultClick=function(e){e.uisref&&(e.stateParams?n.go(e.state,e.stateParams):n.go(e.state))},S.openSettings=function(e){t.$broadcast("webrtc::settings")},S.changePassword=w,S.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},S.onUserUpdate=function(e){if(e.id===S.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==S.user.showWebBar){var t=c.confirm().title(r.instant("TOOLBAR.WARNING")+"!").textContent(r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")).ariaLabel(r.instant("TOOLBAR.WARNING")+"!").ok(r.instant("TOOLBAR.STAY_LOGGED")).cancel("Logout");c.show(t).then(function(){v.queueLogin()}).catch(function(e){C(!0)}).finally(function(){_.merge(S.user,e),v.updateCurrentUser(S.user)})}else C(!0),_.merge(S.user,e),v.updateCurrentUser(S.user);else _.merge(S.user,e),v.updateCurrentUser(S.user)},S.onUserCalled=function(e){2===S.currentUser.showWebBar&&"agent"===S.currentUser.role&&S.currentUser.name===e.membername&&p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+e.calleridnum+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.variables&&e.variables.extravar?e.variables.extravar:"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})},S.pause=function(e){return f.user.pause({id:S.user.id,type:e||"DEFAULT PAUSE"}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.unpause=function(){return f.user.unpause({id:S.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.preview=function(t){return S.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){S.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){S.disable=!1})},S.getLogo=function(){return S.setting.defaultHeaderWhiteLabel?"xCALLY Motion":S.setting.headerWhiteLabel},S.userIsNotPhonebar=function(){return"admin"===S.currentUser.role||"user"===S.currentUser.role||"agent"===S.currentUser.role&&0!==S.currentUser.showWebBar},S.onInternalMessageSave=function(e){e.ToId!==S.currentUser.id||e.ChatGroupId||(S.unreadTotalMessages+=1);e.ToId===S.currentUser.id&&e.FromId!==S.currentUser.id&&!e.read&&e.ChatGroupId&&S.unreadTotalGroupMessages++},S.onInternalMessageUpdate=function(e){e.ToId===S.currentUser.id&&e.read&&0<S.unreadTotalMessages&&!e.ChatGroupId&&(S.unreadTotalMessages-=1);e.ToId===S.currentUser.id&&e.read&&e.ChatGroupId&&0<S.unreadTotalGroupMessages&&S.unreadTotalGroupMessages--},S.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&I()},S.onVoiceQueue=function(e){I()},h.connect(),h.on("user:update",S.onUserUpdate),h.on("user:called",S.onUserCalled),h.on("chatInternalMessage:save",S.onInternalMessageSave),h.on("chatInternalMessage:update",S.onInternalMessageUpdate),h.on("userVoiceQueue:save",S.onUserVoiceQueue),h.on("voiceQueue:save",S.onVoiceQueue),h.on("userVoiceQueue:remove",S.onUserVoiceQueue),h.on("voiceQueue:remove",S.onVoiceQueue),h.on("voiceQueue:update",S.onVoiceQueue),function(){S.user=v.getCurrentUser(),S.conf.ha1=S.user.md5secret,S.conf.id=S.user.id,S.conf.name=S.user.name,S.conf.fullname=S.user.fullname,S.conf.internal=S.user.internal,S.conf.recording=S.user.phoneBarEnableRecording,S.conf.autoAnswer=S.user.phoneBarAutoAnswer,S.conf.enableSettings=S.user.phoneBarEnableSettings,S.conf.enableDtmfTone=S.user.phoneBarEnableDtmfTone,S.conf.autoAnswerDelay=S.user.phoneBarAutoAnswerDelay,S.userStatus=S.userStatusOptions[0];var e=u.get("motion.language");e&&S.languages.hasOwnProperty(e)?S.selectedLanguage=S.languages[e]:S.selectedLanguage=S.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){S.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),S.setting.securePassword)if(S.user.passwordResetAt){var t=moment(S.user.passwordResetAt).add(S.setting.passwordExpiresDays||90,"day");moment().isAfter(t)?w(null,!0):moment().add(15,"day").isAfter(t)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(t.diff(moment(),"days",!0)),timeout:2e4})}else w(null,!0)}(),I(),f.chatInternalMessage.get({fields:"FromId",ToId:S.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){S.unreadTotalMessages=e.rows.length}),e.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),y&&(A.cancel(y),y=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval"],angular.module("app.toolbar").controller("ToolbarController",e)}();var urlParams=function(e){var t=new Object,n=e.lastIndexOf("?");if(0<n)for(var a=e.substring(n+1).split("&"),i=0;i<a.length;i++)0<(n=a[i].indexOf("="))&&(t[a[i].substring(0,n)]=a[i].substring(n+1));return t}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,t,n){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+e+'" href="'+t+'" charset="ISO-8859-1" type="text/css"/>');else{var a=n.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",t),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),n.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,t=document.createElement("table");t.setAttribute("width","100%"),t.setAttribute("height","100%");var n=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),n.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),n.appendChild(a),t.appendChild(n),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=n=0,a="number"==typeof window.innerWidth?(n=window.innerHeight,window.innerWidth):(n=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,t,Math.max(0,a-320),Math.max(0,n-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,t){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,t){var n=document.createElement("button");mxUtils.write(n,e),mxEvent.addListener(n,"click",t),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,t){if(mxLog.TRACE){var n=0!=t?" ("+((new Date).getTime()-t)+" ms)":"";mxLog.writeln("Leaving "+e+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var t=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=t+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,t){var n=mxObjectIdentity.get(e),a=this.map[n];return this.map[n]=t,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var t=this.map[e];return delete this.map[e],t},mxDictionary.prototype.getKeys=function(){var e,t=[];for(e in this.map)t.push(e);return t},mxDictionary.prototype.getValues=function(){var e,t=[];for(e in this.map)t.push(this.map[e]);return t},mxDictionary.prototype.visit=function(e){for(var t in this.map)e(t,this.map[t])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,t){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(t)?e+mxResources.extension:null},getSpecialBundle:function(e,t){if(null==mxClient.languages||!this.isLanguageSupported(t)){var n=t.indexOf("-");0<n&&(t=t.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(t)&&t!=mxClient.defaultLanguage?e+"_"+t+mxResources.extension:null},add:function(e,t){if((t=null!=t?t:mxClient.language.toLowerCase())!=mxConstants.NONE){var n=mxResources.getDefaultBundle(e,t);if(null!=n)try{var a=mxUtils.load(n);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(n=mxResources.getSpecialBundle(e,t)))try{(a=mxUtils.load(n)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var t=0;t<e.length;t++)if("#"!=e[t].charAt(0)){var n=e[t].indexOf("=");if(0<n){var a=e[t].substring(0,n),i=e[t].length;13==e[t].charCodeAt(i-1)&&i--,n=e[t].substring(n+1,i),this.resourcesEncoded?(n=n.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(n)):mxResources.resources[a]=n}}}},get:function(e,t,n){if(null==(e=mxResources.resources[e])&&(e=n),null!=e&&null!=t){n=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<t.length&&n.push(t[a]),a=null):null!=a?a+=s:n.push(s)}e=n.join("")}return e}};function mxPoint(e,t){this.x=null!=e?e:0,this.y=null!=t?t:0}function mxRectangle(e,t,n,a){mxPoint.call(this,e,t),this.width=null!=n?n:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,t,n,a){this.x=e,this.y=t,this.width=n,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=t,this.y=n,this.width=a-t,this.height=e-n}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,t=0;t<d.length;t++){var n=d[t];if(n instanceof mxGeometryChange||n instanceof mxTerminalChange||n instanceof mxValueChange||n instanceof mxChildChange||n instanceof mxStyleChange){var a=l.getView().getState(n.cell||n.child,!1);if(null!=a)if(e=!0,n.constructor!=mxGeometryChange||l.model.isEdge(n.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(n.geometry.x-n.previous.x)*i,o=(n.geometry.y-n.previous.y)*i,r=(n.geometry.width-n.previous.width)*i;i=(n.geometry.height-n.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,n.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,t,n){for(var a=e.model.getChildCount(t),i=0;i<a;i++){var s=e.model.getChildAt(t,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,n),mxEffects.cascadeOpacity(e,s,n))}if(null!=(t=e.model.getEdges(t)))for(i=0;i<t.length;i++)null!=(a=e.getView().getState(t[i]))&&mxUtils.setOpacity(a.shape.node,n)},fadeOut:function(e,t,n,a,i,s){a=a||40,i=i||30;var o=t||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var t=e.length,n=0;n<t;n+=1)mxUtils.removeCursors(e[n])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,t){return function(){return t.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,t,n){var a=e.getAttribute(t);if(null!=a&&a==n)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,t,n)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,t,n){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(t)==n)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,t,n),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,t,n){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+t+"='"+n+"']")}:function(e,t,n){return null==e?null:e.ownerDocument.evaluate("//*[@"+t+"='"+n+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var t=null;if(null!=e)if(null!=e.name)t=e.name;else{for(e=e.toString(),t=9;" "==e.charAt(t);)t++;var n=e.indexOf("(",t);t=e.substring(t,n)}return t},indexOf:function(e,t){if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t)return n;return-1},remove:function(e,t){var n=null;if("object"==typeof t)for(var a=mxUtils.indexOf(t,e);0<=a;)t.splice(a,1),n=e,a=mxUtils.indexOf(t,e);for(var i in t)t[i]==e&&(delete t[i],n=e);return n},isNode:function(e,t,n,a){return!(null==e||isNaN(e.nodeType)||null!=t&&e.nodeName.toLowerCase()!=t.toLowerCase())&&(null==n||e.getAttribute(n)==a)},getChildNodes:function(e,t){t=t||mxConstants.NODETYPE_ELEMENT;for(var n=[],a=e.firstChild;null!=a;)a.nodeType==t&&n.push(a),a=a.nextSibling;return n},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var t=mxUtils.createXmlDocument();return t.async="false",t.loadXML(e),t}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,t,n){var a=[];if(null!=e)if(t=t||" ",n=n||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(n+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,t,n+t)),i=i.nextSibling;a.push(n+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,t){for(var n=t?e.previousSibling:e.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var a=t?n.previousSibling:n.nextSibling,i=mxUtils.getTextContent(n);0==mxUtils.trim(i).length&&n.parentNode.removeChild(n),n=a}},htmlEntities:function(e,t){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==t||t)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,t){var n="";return null!=e&&(n=null==(n=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):n.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),n.replace(/\n/g,t||"
")},getTextContent:function(e){var t="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),t=e.nodeValue||""),t},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var t=[];t.push("<"+e.nodeName);var n=e.attributes;if(null!=n)for(var a=0;a<n.length;a++){var i=n[a].nodeValue;null!=i&&0<i.length&&(t.push(" "),t.push(n[a].nodeName),t.push('="'),t.push(i),t.push('"'))}return 0==e.innerHTML.length?t.push("/>"):(t.push(">"),t.push(e.innerHTML),t.push("</"+e.nodeName+">")),t.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&e.appendChild(n),n},writeln:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&(e.appendChild(n),e.appendChild(document.createElement("br"))),n},br:function(e,t){t=t||1;for(var n=null,a=0;a<t;a++)null!=e&&(n=e.ownerDocument.createElement("br"),e.appendChild(n));return n},button:function(e,t,n){return n=(n=null!=n?n:document).createElement("button"),mxUtils.write(n,e),mxEvent.addListener(n,"click",function(e){t(e)}),n},para:function(e,t){var n=document.createElement("p");return mxUtils.write(n,t),null!=e&&e.appendChild(n),n},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,t,n,a,i){return mxUtils.link(e,t,function(){n.execute(a)},i)},linkInvoke:function(e,t,n,a,i,s){return mxUtils.link(e,t,function(){n[a](i)},s)},link:function(e,t,n,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",n),mxUtils.write(i,t),null!=e&&e.appendChild(i),i},fit:function(e){var t=parseInt(e.offsetLeft),n=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<t+n&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-n)+"px"),t=parseInt(e.offsetTop),n=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<t+n&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-n)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return t.initWithPath(e),t.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(t,1,4,null),(t=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),t.read(t.available())):(mxUtils.alert("File not found."),"")}return e=(t=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),t.close(),e},save:function(e,t){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);n.initWithPath(e),n.exists()||n.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(n,34,4,null),a.write(t,t.length),a.flush(),a.close()}else(n=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(t),n.Close()},saveAs:function(e){var t=document.createElement("iframe");t.setAttribute("src",""),t.style.visibility="hidden",document.body.appendChild(t);try{if(mxClient.IS_NS){var n=t.contentDocument;n.open(),n.write(e),n.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),t.focus(),saveDocument(n)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(n=t.contentWindow.document).write(e),n.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(t)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var t=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(t){var n=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(n){n.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,n.setTransferData("text/unicode",a,2*e.length),t.setData(n,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,t,n){return new mxXmlRequest(e,null,"GET").send(t,n)},post:function(e,t,n,a){return new mxXmlRequest(e,t).send(n,a)},submit:function(e,t,n,a){return new mxXmlRequest(e,t).simulate(n,a)},loadInto:function(e,t,n){mxClient.IS_IE?t.onreadystatechange=function(){4==t.readyState&&n()}:t.addEventListener("load",n,!1),t.load(e)},getValue:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n),e},getNumber:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n||0),Number(e)},getColor:function(e,t,n){return null==(e=null!=e?e[t]:null)?e=n:e==mxConstants.NONE&&(e=null),e},clone:function(e,t,n){n=null!=n&&n;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==t||mxUtils.indexOf(t,i)<0)&&(a[i]=n||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t[n]||null!=e[n]&&!e[n].equals(t[n]))return!1;return!0},equalEntries:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n in e)if(e[n]!=t[n])return!1;return!0},extend:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},toString:function(e){var t,n="";for(t in e)try{if(null==e[t])n+=t+" = [null]\n";else if("function"==typeof e[t])n+=t+" => [Function]\n";else if("object"==typeof e[t])n=n+(t+" => [")+mxUtils.getFunctionName(e[t].constructor)+"]\n";else n+=t+" = "+e[t]+"\n"}catch(e){n+=t+"="+e.message}return n},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,t,n,a,i,s,o,r,l){if(r-=e,l-=t,0===n||0===a)return h;n=Math.abs(n),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=n*n)+(p=d*d)/(E=a*a))?(n*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*E-g*p-E*c)/(g*p+E*c))))*n*d/a)-h*(p=-1*s*a*i/n)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/n)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/n)-Math.atan2((d-p)/a,(i-c)/n))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*n,m*=a,n*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(n*b-m*u),v=E=0,h=[],f=0;f<o;++f){s+=i;var b,E=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,A=(v=n*u+m*b+l,-d*(c*b+a*u));u=-d*(n*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+t),h[b+2]=Number(E-A+e),h[b+3]=Number(v-u+t),h[b+4]=Number(E+e),h[b+5]=Number(v+t),p=E+A,g=v+u}return h},getBoundingBox:function(e,t){var n=null;if(null!=e&&null!=t&&0!=t){var a=mxUtils.toRadians(t),i=(n=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,n,i,s),a=mxUtils.getRotatedPoint(a,n,i,s),r=mxUtils.getRotatedPoint(r,n,i,s),l=mxUtils.getRotatedPoint(l,n,i,s);(n=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),n.add(new mxRectangle(r.x,r.y,0,0)),n.add(new mxRectangle(l.x,l.y,0,0))}return n},getRotatedPoint:function(e,t,n,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*t-(e=e.y-a.y)*n+a.x,e*t+i*n+a.y)},getPortConstraints:function(e,t,n,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,t,n){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,t,n);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,t,n){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=t.x;var r=n.x;if(t.x>n.x&&(e=n.x,r=t.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=t.y,o=n.y;var l=n.x-t.x;return 1e-7<Math.abs(l)&&(i=(n=(n.y-t.y)/l)*e+(t=t.y-n*t.x),o=n*r+t),o<i&&(t=o,o=i,i=t),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,t,n){return e.x<=t&&e.x+e.width>=t&&e.y<=n&&e.y+e.height>=n},intersects:function(e,t){var n=e.width,a=e.height,i=t.width,s=t.height;if(i<=0||s<=0||n<=0||a<=0)return!1;var o=e.x,r=e.y,l=t.x,d=t.y;s+=d,n+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(n<o||l<n)&&(a<r||d<a)},intersectsHotspot:function(e,t,n,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),t=(e=mxUtils.getRotatedPoint(new mxPoint(t,n),i,s,o)).x,n=e.y),mxUtils.contains(a,t,n)}return!0},getOffset:function(e,t){var n=0,a=0;if(null!=t&&t){var i=document.body,s=document.documentElement;n=n+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)n+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(n,a)},getScrollOrigin:function(e){for(var t=document.body,n=document.documentElement,a=new mxPoint(t.scrollLeft||n.scrollLeft,t.scrollTop||n.scrollTop);null!=e&&e!=t&&e!=n;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,t,n){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(t-e.x,n-e.y)},ltrim:function(e,t){return e.replace(RegExp("^["+(t||"\\s")+"]+","g"),"")},rtrim:function(e,t){return e.replace(RegExp("["+(t||"\\s")+"]+$","g"),"")},trim:function(e,t){return mxUtils.ltrim(mxUtils.rtrim(e,t),t)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,t){return(e%t+t)%t},intersection:function(e,t,n,a,i,s,o,r){var l=(r-s)*(n-e)-(o-i)*(a-t);return o=((o-i)*(t-s)-(r-s)*(e-i))/l,i=((n-e)*(t-s)-(a-t)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(n-e),t+o*(a-t)):null},ptSegDistSq:function(e,t,n,a,i,s){return n=(i-=e)*(n-=e)+(s-=t)*(a-=t)<=0?0:(e=(i=n-i)*n+(s=a-s)*a)<=0?0:e*e/(n*n+a*a),(i=i*i+s*s-n)<0&&(i=0),i},relativeCcw:function(e,t,n,a,i,s){return 0==(e=(i-=e)*(a-=t)-(s-=t)*(n-=e))&&(0<(e=i*n+s*a)&&((e=(i-n)*n+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,t){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,t,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,t,n,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,t){mxUtils.isVml(e)?e.style.filter=100<=t?null:"alpha(opacity="+t/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=t?null:"alpha(opacity="+t+")":e.style.opacity=t/100},createImage:function(e){var t=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((t=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),t.style.borderStyle="none"):((t=document.createElement("img")).setAttribute("src",e),t.setAttribute("border","0")),t},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,t){var n=s.get(e);null==n&&(n=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,n));var a=s.get(t);return null==a&&(a=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),s.put(t,a)),0==(n=mxCellPath.compare(n,a))?0:0<n==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)e[n].indexOf("=")<0&&t.push(e[n])}return t},indexOfStylename:function(e,t){if(null!=e&&null!=t)for(var n=e.split(";"),a=0,i=0;i<n.length;i++){if(n[i]==t)return a;a+=n[i].length+1}return-1},addStylename:function(e,t){return mxUtils.indexOfStylename(e,t)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=t),e},removeStylename:function(e,t){var n=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=t&&n.push(a[i]);return n.join(";")},removeAllStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)0<=e[n].indexOf("=")&&t.push(e[n])}return t.join(";")},setCellStyles:function(e,t,n,a){if(null!=t&&0<t.length){e.beginUpdate();try{for(var i=0;i<t.length;i++)if(null!=t[i]){var s=mxUtils.setStyle(e.getStyle(t[i]),n,a);e.setStyle(t[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,t,n){var a=null!=n&&(void 0===n.length||0<n.length);if(null==e||0==e.length)a&&(e=t+"="+n);else{var i=e.indexOf(t+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+t+"="+n):(t=a?t+"="+n:"",n=e.indexOf(";",i),a||n++,e=e.substring(0,i)+t+(i<n?e.substring(n):""))}return e},setCellStyleFlags:function(e,t,n,a,i){if(null!=t&&0<t.length){e.beginUpdate();try{for(var s=0;s<t.length;s++)if(null!=t[s]){var o=mxUtils.setStyleFlag(e.getStyle(t[s]),n,a,i);e.setStyle(t[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,t,n,a){if(null==e||0==e.length)e=a||null==a?t+"="+n:t+"=0";else{var i=e.indexOf(t+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+t+"="+n:e+i+t+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+t.length+1):e.substring(i+t.length+1,s),o=null==a?parseInt(o)^n:a?parseInt(o)|n:parseInt(o)&~n;e=e.substring(0,i)+t+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,t){var n=0,a=0;return e==mxConstants.ALIGN_CENTER?n=-.5:e==mxConstants.ALIGN_RIGHT&&(n=-1),t==mxConstants.ALIGN_MIDDLE?a=-.5:t==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(n,a)},getSizeForString:function(e,t,n){t=null!=t?t:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=n,a.style.fontSize=Math.round(t)+"px",a.style.lineHeight=Math.round(t*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,t,n,a,i){a=null!=a?a:0,i=null!=i?i:0,t=null!=t?t:1,null==n&&(n=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),t=new mxTemporaryCellStates(e.getView(),t,n);try{o=(new mxCodec).encode(e.getView())}finally{t.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,t,n,a){if(e<1)return 1;a=null!=a?a:0;var i=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;n=n.height-2*a,a=t.getGraphBounds().clone(),t=t.getView().getScale(),a.width/=t,a.height/=t,n=(t=a.width)/a.height/(i/n),a=Math.sqrt(e);var s=Math.sqrt(n);if(n=a*s,a/=s,n<1&&e<a){var o=a/e;a=e,n/=o}for(a<1&&e<n&&(o=n/e,n=e,a/=o),o=Math.ceil(n)*Math.ceil(a),s=0;e<o;){o=Math.floor(n)/n;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(n-1)/n),1==r&&(r=Math.floor(a-1)/a),n*=o=r<o?o:r,a*=o,o=Math.ceil(n)*Math.ceil(a),10<++s)break}return i*n/t*.99999},show:function(e,t,n,a){if(n=null!=n?n:0,a=null!=a?a:0,null==t?t=window.open().document:t.open(),n=-(i=e.getGraphBounds()).x+n,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",t.writeln(i),t.close(),null!=(e=t.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=n+"px",e.style.top=a+"px")}else{for(t.writeln("<html"),t.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(t.writeln("</head>"),t.writeln("</html>"),t.close(),null==t.body&&t.documentElement.appendChild(t.createElement("body")),t.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),t.body.appendChild(o),e=e.nextSibling;null!=(e=t.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+n+","+a+")"),(n=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),n.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(t.body),t},printScreen:function(e){var t=window.open();mxUtils.show(e,t.document),e=function(){t.focus(),t.print(),t.close()},mxClient.IS_GC?t.setTimeout(e,500):e()},popup:function(e,t){if(t){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.appendChild(a),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),n.document.close()):((a=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,t){return prompt(e,t)},confirm:function(e){return confirm(e)},error:function(e,t,n,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-t)/2,a/4,t,null,!1,!0);return n&&(mxUtils.br(i),t=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",function(e){o.destroy()}),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),t.appendChild(n),i.appendChild(t),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,t,n,i,a,s,o,r,l,d){return(e=new mxDragSource(e,n)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof t?t(e):t},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var t=i.cloneNode(!0),n=parseInt(t.style.width),a=parseInt(t.style.height);return t.style.width=Math.round(n*e.view.scale)+"px",t.style.height=Math.round(a*e.view.scale)+"px",t})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var t=1;t<arguments.length;t+=2)null!=arguments[t+1]&&(this.properties[arguments[t]]=arguments[t+1])}function mxMouseEvent(e,t){this.evt=e,this.state=t}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var t=this.getSource();null!=t;){if(t==e.node)return!0;t=t.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,t){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(t)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var t=0;t<this.eventListeners.length;)this.eventListeners[t+1]==e?this.eventListeners.splice(t,2):t+=2},mxEventSource.prototype.fireEvent=function(e,t){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==t&&(t=this.getEventSource()),null==t&&(t=this);for(var n=[t,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,n)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,t,n){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:t,f:n})};return window.addEventListener?function(e,t,n){e.addEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.attachEvent("on"+t,n),a(e,t,n)}}(),removeListener:function(){var a=function(e,t,n){if(null!=e.mxListenerList){t=e.mxListenerList.length;for(var a=0;a<t;a++)if(e.mxListenerList[a].f==n){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.detachEvent("on"+t,n),a(e,t,n)}}(),removeAllListeners:function(e){var t=e.mxListenerList;if(null!=t)for(;0<t.length;){var n=t[0];mxEvent.removeListener(e,n.name,n.f)}},addGestureListeners:function(e,t,n,a){null!=t&&mxEvent.addListener(e,"mousedown",t),null!=n&&mxEvent.addListener(e,"mousemove",n),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.addListener(e,"touchstart",t),null!=n&&mxEvent.addListener(e,"touchmove",n),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,t,n,a){null!=t&&mxEvent.removeListener(e,"mousedown",t),null!=n&&mxEvent.removeListener(e,"mousemove",n),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.removeListener(e,"touchstart",t),null!=n&&mxEvent.removeListener(e,"touchmove",n),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,n,t,a,i,s,o){var r=function(e){return"function"==typeof t?t(e):t};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var t=r(e);n.dblClick(e,null!=t?t.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var t=e.length,n=0;n<t;n+=1)mxEvent.release(e[n])},addMouseWheelListener:function(n){if(null!=n){var e=function(e){null==e&&(e=window.event);var t=0;0!=(t=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&n(e,0<t)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,t,n){n=null==n||n,(null==t||t)&&(e.preventDefault?(n&&e.stopPropagation(),e.preventDefault()):n&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,t,n,a,i,s){this.url=e,this.params=t,this.method=n||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,t){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,t){null!=t&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,t){var n=null;(e=e||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=t&&a.setAttribute("target",t),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,t){return t=mxClipboard.copy(e,t),mxClipboard.insertCount=0,mxClipboard.removeCells(e,t),t},removeCells:function(e,t){e.removeCells(t)},copy:function(e,t){t=t||e.getSelectionCells();var n=e.getExportableCells(t);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(n),n},paste:function(e){if(null!=mxClipboard.cells){var t=e.getImportableCells(mxClipboard.cells),n=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();t=e.importCells(t,n,n,a);mxClipboard.insertCount++,e.setSelectionCells(t)}}};function mxWindow(e,t,n,a,i,s,o,r,l,d){null!=t&&(o=null==o||o,this.content=t,this.init(n,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,t,n){this.src=e,this.width=t,this.height=n}function mxDivResizer(e,t){if("div"==e.nodeName.toLowerCase()){null==t&&(t=window),this.div=e;var n=mxUtils.getCurrentStyle(e);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(t,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,t){this.element=e,this.dropHandler=t,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(t,e,n,a){this.model=t,this.urlInit=e,this.urlPoll=n,this.urlNotify=a,null!=t&&(this.codec=new mxCodec,this.codec.lookup=function(e){return t.getCell(e)}),t.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");(null!=n&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(n.changes,n.undone)+"</edit>")}))}function mxUndoableEdit(e,t){this.source=e,this.changes=[],this.significant=null==t||t}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,t,n,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=t+"px",this.table=document.createElement("table"),this.table.className=i,null!=n&&(mxClient.IS_IE||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),t=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",t.appendChild(this.title),e.appendChild(t),t=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),t.appendChild(this.td),e.appendChild(t),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var t=this.title.firstChild;null!=t;){var n=t.nextSibling;t.nodeType==mxConstants.NODETYPE_TEXT&&t.parentNode.removeChild(t),t=n}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var t=mxWindow.activeWindow.getElement();null!=t&&null!=t.style&&(t.style.zIndex=e)}t=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",t))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setSize(s+t,o+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,t){e=Math.max(this.minimumSize.width,e),t=Math.max(this.minimumSize.height,t),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=t+"px"),this.table.style.width=e+"px",this.table.style.height=t+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var n=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),n)n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var t=this.getMinimumSize();0<t.height&&(mxClient.IS_IE||(this.div.style.height=t.height+"px"),this.table.style.height=t.height+"px"),0<t.width&&(mxClient.IS_IE||(this.div.style.width=t.width+"px"),this.table.style.width=t.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var n=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(n)n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(t=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var t=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=t.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setLocation(s+t,o+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,t){this.div.style.left=e+"px",this.div.style.top=t+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");n.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){t()}),n.appendChild(a),this.body.appendChild(n)},mxForm.prototype.addText=function(e,t){var n=document.createElement("input");return n.setAttribute("type","text"),n.value=t,this.addField(e,n)},mxForm.prototype.addCheckbox=function(e,t){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(e,n),t&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(e,t,n){var a=document.createElement("textarea");return mxClient.IS_NS&&n--,a.setAttribute("rows",n||2),a.value=t,this.addField(e,a)},mxForm.prototype.addCombo=function(e,t,n){var a=document.createElement("select");return null!=n&&a.setAttribute("size",n),t&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,t,n,a){var i=document.createElement("option");mxUtils.writeln(i,t),i.setAttribute("value",n),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),n.appendChild(a),(a=document.createElement("td")).appendChild(t),n.appendChild(a),this.body.appendChild(n),t},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),t=this.getDocumentHeight(),n=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(a)&&0<=n&&0<=a&&0<e-a-n&&(this.div.style.width=e-a-n+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<t-i-s&&(this.div.style.height=t-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,t,n){return e.getCellAt(t,n)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,t){var n=mxEvent.getClientX(t),a=mxEvent.getClientY(t),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return n>=i.x-s.x&&a>=i.y-s.y&&n<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(t=this.getGraphForEvent(e))&&!this.graphContainsEvent(t,e)&&(t=null),t!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=t,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var t=mxEvent.getClientX(e),n=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(t+=this.dragOffset.x,n+=this.dragOffset.y),t+=document.body.scrollLeft||document.documentElement.scrollLeft,n+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=t+"px",this.dragElement.style.top=n+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var t=this.currentGraph.view.scale,n=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/t-n.x,this.currentPoint.y/t-n.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,t){var n=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(t)-n.x+a.x;n=mxEvent.getClientY(t)-n.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,n,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,n),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(t);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(t))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),n=new mxPoint(i,n),n=this.currentGuide.move(s,n,a),s=!1,i=n.x,n=n.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,n=(e.snap(n/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,n+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(n)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,n)},mxDragSource.prototype.drop=function(e,t,n,a,i){this.dropHandler(e,t,n,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,t,n,a,i,s){var o=document.createElement(null!=t?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",t),null!=e&&(null!=t?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",t):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var t=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),t!=o&&(this.currentImg=o,this.menu.factoryMethod=s,t=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(t.x,t.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var t=document.createElement("div");t.style.display="inline",t.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=e||"mxToolbarCombo",t.appendChild(n),this.container.appendChild(t),n},mxToolbar.prototype.addActionCombo=function(e,t){var n=document.createElement("select");return n.className=t||"mxToolbarCombo",this.addOption(n,e,null),mxEvent.addListener(n,"change",function(e){var t=n.options[n.selectedIndex];n.selectedIndex=0,null!=t.funct&&t.funct(e)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(e,t,n){var a=document.createElement("option");return mxUtils.writeln(a,t),"function"==typeof n?a.funct=n:a.setAttribute("value",n),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,t,n,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",t),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),n()),s},mxToolbar.prototype.addMode=function(e,t,n,a,i,s){s=null==s||s;var o=document.createElement(null!=t?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",t),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,n),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,t){if(this.selectedMode!=e){if(null!=this.selectedMode){var n=this.selectedMode.altIcon;null!=n?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",t))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,t,n){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,t,n){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,t,n))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(n,a,t){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=t?t(e):this.stop(e)});mxUtils.get(n,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",n,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var t=e.getDocumentElement();null==t?i("Invalid response: "+e.getText()):this.receive(t)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,t){for(var n="",a=t?-1:1,i=t?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);n=n+mxUtils.getXml(s,this.linefeed)}return n},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var t=e.getAttribute("namespace");for(null!=t&&(this.model.prefix=t+"-"),t=e.firstChild;null!=t;){var n=t.nodeName.toLowerCase();"state"==n?this.processState(t):"delta"==n&&this.processDelta(t),t=t.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var t=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",t))}},mxSession.prototype.createUndoableEdit=function(e){var t=new mxUndoableEdit(this.model,this.significantRemoteChanges);return t.changes=e,t.notify=function(){t.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",t.changes)),t.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",t,"changes",t.changes))},t},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var t=[];for(e=e.firstChild;null!=e;){var n=this.decodeChange(e);null!=n&&t.push(n),e=e.nextSibling}return t},mxSession.prototype.decodeChange=function(e){var t=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(t="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(t.model=this.model,t.execute(),"mxChildChange"==e.nodeName&&null==t.parent&&this.cellRemoved(t.child))),t},mxSession.prototype.cellRemoved=function(e,t){this.codec.putObject(e.getId(),e);for(var n=this.model.getChildCount(e),a=0;a<n;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var t=this.changes[e];null!=t.execute?t.execute():null!=t.undo&&t.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,t=0;t<e;t++){var n=this.changes[t];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var t=this.history[this.indexOfNextAdd++];if(t.redo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",t));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),t=0;t<e.length;t++)e[t].die()};var mxUrlConverter=function(e){var n=!0,a=null,i=null;return{isEnabled:function(){return n},setEnabled:function(e){n=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(n&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var t=(a=i+location.pathname).lastIndexOf("/");0<t&&(a=a.substring(0,t+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,t){},mouseMove:function(e,t){},mouseUp:mxUtils.bind(this,function(e,t){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),t=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,t),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,t,n,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=n?n:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=t+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=t-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,t=s.panDy;0==e&&0==t||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+t/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.graphModelChanged(t.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,t,n,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=t?t:6,this.ease=null!=n?n:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,t){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=t&&t;var n=null;if(e.ownerDocument!=document)for(n=e;null!=n&&"svg"!=n.nodeName;)n=n.parentNode;null!=n&&(0<n.getElementsByTagName("defs").length&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,t,n,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=t?((i=document.createElement("img")).src=t,r.appendChild(i)):null!=i&&((t=document.createElement("div")).className=i,r.appendChild(t)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=n&&n(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var t=document.createElement("img");t.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(t)},mxPopupMenu.prototype.showSubmenu=function(e,t){if(null!=t.div){t.div.style.left=e.div.offsetLeft+t.offsetLeft+t.offsetWidth-1+"px",t.div.style.top=e.div.offsetTop+t.offsetTop+"px",document.body.appendChild(t.div);var n=parseInt(t.div.offsetLeft),a=parseInt(t.div.offsetWidth),i=document.body,s=document.documentElement;n+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(t.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(t.div)}},mxPopupMenu.prototype.addSeparator=function(e,t){if(e=e||this,this.smartSeparators&&!t)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var n=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",n.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),n.appendChild(a),e.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(e,t,n,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=t+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var t=0;t<this.cells.length;t++)this.animateCell(cells[t],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,t,n){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,t.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(n&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),t,n)},mxMorphing.prototype.stopRecursion=function(e,t){return null!=t&&(0!=t.x||0!=t.y)},mxMorphing.prototype.getDelta=function(e){var t=this.getOriginForCell(e.cell),n=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-n.x,e.y/a-n.y),new mxPoint((t.x-e.x)*a,(t.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var t=null;return null!=e&&(t=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(t.x+=e.x,t.y+=e.y)),null==t&&(t=new mxPoint(-(t=this.graph.view.getTranslate()).x,-t.y)),t},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,t,n){this.images[e]={value:t,fallback:n}},mxImageBundle.prototype.getImage=function(e){var t=null;return null!=e&&(null!=(e=this.images[e])&&(t=this.alt?e.fallback:e.value)),t},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,t){null!=e&&(this.visitStatesRecursive(e,t,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,t,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,t,n){if(null!=e){n(e,t);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,t,n)}}},mxImageExport.prototype.drawCellState=function(e,t){e.shape instanceof mxShape&&(t.save(),e.shape.paint(t),t.restore()),null!=e.text&&(t.save(),e.text.paint(t),t.restore())},mxImageExport.prototype.drawOverlays=function(e,n){null!=e.overlays&&e.overlays.visit(function(e,t){t instanceof mxShape&&t.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,t=2;t<arguments.length;t+=2)this.lastX=arguments[t-1],this.lastY=arguments[t],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,t,n,a,i){return n*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,t),Math.cos(n),Math.sin(n),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,t){this.state.dx+=e,this.state.dy+=t},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,t,n,a,i,s,o,r,l){(n=this.state).fillColor=e,n.fillAlpha=null!=r?r:1,n.gradientColor=t,n.gradientAlpha=null!=l?l:1,n.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,t){this.state.shadowDx=e,this.state.shadowDy=t},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,t){this.addOp(this.moveOp,e,t)},mxAbstractCanvas2D.prototype.lineTo=function(e,t){this.addOp(this.lineOp,e,t)},mxAbstractCanvas2D.prototype.quadTo=function(e,t,n,a){this.addOp(this.quadOp,e,t,n,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,t,n,a,i,s){this.addOp(this.curveOp,e,t,n,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,t,n,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,t,n,a,i,s,o),t=0;t<e.length;t+=6)this.curveTo(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])},mxAbstractCanvas2D.prototype.close=function(e,t,n,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("scale");t.setAttribute("scale",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.translate=function(e,t){var n=this.createElement("translate");n.setAttribute("dx",this.format(e)),n.setAttribute("dy",this.format(t)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(e,t,n,a,i){var s=this.createElement("rotate");(0!=e||t||n)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",t?"1":"0"),s.setAttribute("flipV",n?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("alpha");t.setAttribute("alpha",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var t=this.createElement("fillcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setGradient=function(e,t,n,a,i,s,o,r,l){if(null!=e&&null!=t){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",t),d.setAttribute("x",this.format(n)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var t=this.createElement("strokecolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var t=this.createElement("strokewidth");t.setAttribute("width",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var t=this.createElement("dashed");t.setAttribute("dashed",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var t=this.createElement("dashpattern");t.setAttribute("pattern",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var t=this.createElement("linecap");t.setAttribute("cap",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var t=this.createElement("linejoin");t.setAttribute("join",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var t=this.createElement("miterlimit");t.setAttribute("limit",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var t=this.createElement("fontcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var t=this.createElement("fontbackgroundcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var t=this.createElement("fontbordercolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var t=this.createElement("fontsize");t.setAttribute("size",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var t=this.createElement("fontfamily");t.setAttribute("family",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var t=this.createElement("fontstyle");t.setAttribute("style",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var t=this.createElement("shadow");t.setAttribute("enabled",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var t=this.createElement("shadowcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var t=this.createElement("shadowalpha");t.setAttribute("alpha",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,t){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==t)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",e),n.setAttribute("dy",t),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(e,t,n,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(t)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(t)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,t){var n=this.createElement("move");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.lineTo=function(e,t){var n=this.createElement("line");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(t)),i.setAttribute("x2",this.format(n)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=n,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,t,n,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(t)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(t)),u.setAttribute("w",this.format(n)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,t){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(t||mxConstants.NS_SVG,e);var n=this.root.ownerDocument.createElement(e);return null!=t&&n.setAttribute("xmlns",t),n},mxSvgCanvas2D.prototype.createGradientId=function(e,t,n,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==t.charAt(0)&&(t=t.substring(1)),e=e.toLowerCase()+"-"+n,t=t.toLowerCase()+"-"+a,(n=null)==i||i==mxConstants.DIRECTION_SOUTH?n="s":i==mxConstants.DIRECTION_EAST?n="e":(a=e,e=t,t=a,i==mxConstants.DIRECTION_NORTH?n="s":i==mxConstants.DIRECTION_WEST&&(n="e")),"mx-gradient-"+e+"-"+t+"-"+n},mxSvgCanvas2D.prototype.getSvgGradient=function(e,t,n,a,i){var s=this.createGradientId(e,t,n,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,t,n,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,t,n,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),n=n<1?";stop-opacity:"+n:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+n),s.appendChild(i),n=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+t+n),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=n.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?n.setAttribute("fill","none"):n.setAttribute("fill","transparent"),e=!1),t&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&n.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents&&("path"!=n.nodeName||this.path[this.path.length-1]==this.closeOp)&&n.setAttribute("pointer-events","all"),this.root.appendChild(n)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var t=Math.max(1,this.format(e.strokeWidth*e.scale));1!=t&&this.node.setAttribute("stroke-width",t),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(t))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var t=e.lineCap;"flat"==t&&(t="butt"),"butt"!=t&&this.node.setAttribute("stroke-linecap",t)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var t=this.state.dashPattern.split(" "),n=[];if(0<t.length)for(var a=0;a<t.length;a++)n[a]=Number(t[a])*e;return n.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var t=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",t),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var t=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",t.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",t.shadowColor),e.setAttribute("transform","translate("+this.format(t.shadowDx*t.scale)+","+this.format(t.shadowDy*t.scale)+")"+(t.transform||"")),e.setAttribute("opacity",t.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,t,n,a,i){if(0!=e||t||n){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",t&&n)e+=180;else if(t^n){var o=t?a:0,r=t?-1:1,l=n?i:0,d=n?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(t?!n:n)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,t,n,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((t+i.dy)*i.scale)),s.setAttribute("width",this.format(n*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){this.rect(e,t,n,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+n/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((t+a/2+i.dy)*i.scale)),s.setAttribute("rx",n/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,t+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-n-2*e),r&&(c=-1,u=-a-2*t),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,t,n,a,i){return n=this.state,a="display:inline-block;font-size:"+Math.round(n.fontSize)+"px;font-family:"+n.fontFamily+";color:"+n.fontColor+";line-height:"+Math.round(n.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),t==mxConstants.ALIGN_CENTER?a+="text-align:center;":t==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),t="",null!=n.fontBackgroundColor&&(t+="background-color:"+n.fontBackgroundColor+";"),null!=n.fontBorderColor&&(t+="border:1px solid "+n.fontBorderColor+";"),mxUtils.isNode(e)||((n=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=n.value,i?a+=t:0<t.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+t+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,t+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<n&&(p+="width:"+Math.round(n)+"px;")):d&&(p+="width:"+Math.round(n)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<n&&(p+="width:"+Math.round(n)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);n=d?Math.max(n,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=n/2:s==mxConstants.ALIGN_RIGHT&&(i-=n),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),t+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+n/2+","+a/2+")",e=(t=this.rotatePoint((e+n/2)*u.scale,(t+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-n*u.scale/2,t=t.y-a*u.scale/2):(e*=u.scale,t*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(t)+")"+s),l.setAttribute("width",Math.round(Math.max(1,n))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,t,n,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,t,n,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(t=Math.round(t))+"-"+(n=Math.round(n))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("width",n),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,t,n,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(t*r.scale)+")"),d&&0<n&&0<a){var g=e;c=t,s==mxConstants.ALIGN_CENTER?g-=n/2:s==mxConstants.ALIGN_RIGHT&&(g-=n),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,n*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=t+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,t,n,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var t=this.state;e.setAttribute("fill",t.fontColor),(!this.styleEnabled||t.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",t.fontFamily),(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,t,n,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?n-=i/2:o==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((n+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),t=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(t?0:1),c.width,c.height+(t?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),t=mxUtils.htmlEntities(t,!1),c.innerHTML=t.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?n-=i/2:o==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((n+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((t=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),t.setAttribute("stroke",d.fontBorderColor||"none"),t.setAttribute("x",Math.floor(c.x-1)),t.setAttribute("y",Math.floor(c.y-1)),t.setAttribute("width",Math.ceil(c.width+2)),t.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,t.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&t.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(t,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,t){this.graph=e,this.setStates(t)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(n,e&&null!=a.fillColor,t&&null!=a.strokeColor)),t&&null!=a.strokeColor?(n.stroked="true",n.strokecolor=a.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),e&&null!=a.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":fill");if(t.color=e.fillColor,null!=e.gradientColor){t.type="gradient",t.method="none",t.color2=e.gradientColor;var n=180-e.rotation;n=e.gradientDirection==mxConstants.DIRECTION_WEST?n-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?n+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?n-(180+("y"==this.root.style.flip?-180:0)):n+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),t.angle=mxUtils.mod(n,360),t.opacity=100*e.alpha*e.fillAlpha+"%",t.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(t.opacity=100*e.alpha+"%");return t},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":stroke");return t.endcap=e.lineCap||"flat",t.joinstyle=e.lineJoin||"miter",t.miterlimit=e.miterLimit||"10",e.alpha<1&&(t.opacity=100*e.alpha+"%"),e.dashed&&(t.dashstyle=this.getVmlDashStyle()),t},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var t=this.state.dashPattern.split(" ");0<t.length&&1==t[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,t,n){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),n?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",t?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,t,n,a,i){t&&n?e+=180:t?this.root.style.flip="x":n&&(this.root.style.flip="y"),(t?!n:n)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((t=(t+i.dy)*i.scale)-o);var r=(n=(n+i.dx)*i.scale)+2/3*(e-n);t=(a=(a+i.dy)*i.scale)+2/3*(t-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(t)+" "+this.format(n)+" "+this.format(a)),this.lastX=n/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,t,n,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((t+s.dx)*s.scale)+"px",e.style.top=this.format((n+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)},mxVmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,t,n,a),this.node.setAttribute("arcsize",Math.max(100*i/n,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,t,n,a)},mxVmlCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,t,n,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,t,n,a){n=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?n.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,n.appendChild(a)):(n.style.cssText=s,n.innerHTML=e),(e=n.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=t||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),n},mxVmlCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(t=this.rotatePoint(e,t,u.rotation,u.rotationCx,u.rotationCy)).x,t=t.y),8==document.documentMode?(e+=u.dx,t+=u.dy):(e*=u.scale,t*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(t)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<n&&(i.style.width=Math.round(n)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<n&&(i.style.width=Math.round(n)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=n+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){n=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(n)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-n)).toFixed(8)),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(n%=Math.PI)>Math.PI/2&&(n=Math.PI-n),o=Math.cos(n);var h=Math.sin(n);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+n*-h)/2-m*n*(g+.5)+r*a*(v+.5),d=(n-n*o+a*-h)/2+r*n*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-n/2)*u.scale)+"px",g.style.top=this.format(t+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-n/2)*u)+"px",l.style.top=this.format(t+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+n*g*this.state.scale)+"px",l.style.top=this.format(t+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,t,n,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,t,n,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,t=(t+a.dy)*a.scale,(n=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",n.style.height="1px",n.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(n.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),n.appendChild(d),n.style.left=this.format(e-i)+"px",n.style.top=this.format(t+s)+"px",this.root.appendChild(n)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,t){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var n=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var t=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),t=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),t=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),t=!0),t){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,n.scrollHeight-3-this.graph.panDy)]}r=r||t};for(var f=function(e){e+=this.graph.panDy;var t=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),t=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),t=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),t=!0),t){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(n.scrollWidth-3-this.graph.panDx,e)]}l=l||t},b=0;b<this.states.length;b++){var E=this.states[b];null!=E&&(this.horizontal&&(e.call(this,E.getCenterX()),e.call(this,E.x),e.call(this,E.x+E.width)),this.vertical&&(f.call(this,E.getCenterY()),f.call(this,E.y),f.call(this,E.y+E.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",t&&(r||(t=a.x-(this.graph.snap(a.x/i-n.x)+n.x)*i,s=this.graph.snap(s/i)*i-t),l||(n=a.y-(this.graph.snap(a.y/i-n.y)+n.y)*i,o=this.graph.snap(o/i)*i-n)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var t=0;t<e.length;t++)this.constraints.push(this.parseConstraint(e[t]))}},mxStencil.prototype.parseConstraint=function(e){var t=Number(e.getAttribute("x")),n=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(t,n),e)},mxStencil.prototype.evaluateTextAttribute=function(e,t,n){return t=this.evaluateAttribute(e,t,n),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(t=mxResources.get(t)),t},mxStencil.prototype.evaluateAttribute=function(e,t,n){return null==(t=e.getAttribute(t))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(t=e(n)))),t},mxStencil.prototype.drawShape=function(e,t,n,a,i,s){this.drawChildren(e,t,n,a,i,s,this.bgNode,!1),this.drawChildren(e,t,n,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,t,n,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,null);for(n=this.computeAspect(t.style,n,a,i,s,l),a=Math.min(n.width,n.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(t.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,o,n,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,t,n,a,i,s){e=t,t=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,t=i/this.w0;var r=(a-i)/2;e+=r,n-=r}return"fixed"==this.aspect&&(t=o=Math.min(t,o),s?(e+=(i-this.w0*t)/2,n+=(a-this.h0*o)/2):(e+=(a-this.w0*t)/2,n+=(i-this.h0*o)/2)),new mxRectangle(e,n,t,o)},mxStencil.prototype.drawNode=function(e,t,n,a,i){var s=n.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),n=n.firstChild;null!=n;)n.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,n,a,i),n=n.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,o+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,o+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d,o+Number(n.getAttribute("x3"))*l,r+Number(n.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(n.getAttribute("rx"))*l,Number(n.getAttribute("ry"))*d,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("roundrect"==s)0==(t=n.getAttribute("arcsize"))&&(t=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,t=Number(t)/100,t=Math.min(c*t,a*t),e.roundrect(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,c,a,t,t);else if("ellipse"==s)e.ellipse(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("image"==s)t=this.evaluateAttribute(n,"src",t),e.image(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d,t,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(n,"str",t),a="1"==n.getAttribute("vertical")?-90:0,"0"==n.getAttribute("align-shape")){var m=t.rotation,u=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0);t=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),a=u&&t?a-m:u||t?a+m:a-m}a-=n.getAttribute("rotation"),e.text(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,0,0,c,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(n.getAttribute("name")))&&(o+=Number(n.getAttribute("x"))*l,r+=Number(n.getAttribute("y"))*d,c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,m.drawShape(e,t,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(n.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(n=n.getAttribute("pattern"))){for(n=n.split(" "),l=[],d=0;d<n.length;d++)0<n[d].length&&l.push(Number(n[d])*c);n=l.join(" "),e.setDashPattern(n)}}else"strokecolor"==s?e.setStrokeColor(n.getAttribute("color")):"linecap"==s?e.setLineCap(n.getAttribute("cap")):"linejoin"==s?e.setLineJoin(n.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(n.getAttribute("color")):"alpha"==s?e.setAlpha(n.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(n.getAttribute("color")):"fontstyle"==s?e.setFontStyle(n.getAttribute("style")):"fontfamily"==s?e.setFontFamily(n.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(n.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var t=1;t<this.points.length;t++)null!=e[t]&&this.bounds.add(new mxRectangle(Number(e[t].x),Number(e[t].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,t=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(t=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var n=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);""!=t.tagUrn&&(t.coordsize=n*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),t=this.scale,e.translate(-Math.round(this.bounds.x/t),-Math.round(this.bounds.y/t))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),t=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var t in e.gradients){var n=e.gradients[t];n.mxRefCount=(n.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t,s=this.bounds.height/t;if(this.isPaintBoundsInverted()){n=n+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,n,a,i,s),this.configureCanvas(e,n,a,i,s),null!=this.stencil)this.paintStencilShape(e,n,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(n=[],a=0;a<this.points.length;a++)n.push(new mxPoint(this.points[a].x/t,this.points[a].y/t));this.paintEdgeShape(e,n)}else this.paintVertexShape(e,n,a,i,s)},mxShape.prototype.configureCanvas=function(e,t,n,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(t=this.getGradientBounds(e,t,n,a,i),e.setGradient(this.fill,this.gradient,t.x,t.y,t.width,t.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,i)},mxShape.prototype.updateTransform=function(e,t,n,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,t+a/2,n+i/2)},mxShape.prototype.paintStencilShape=function(e,t,n,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,t,n,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,t,n,a,i)},mxShape.prototype.paintVertexShape=function(e,t,n,a,i){this.paintBackground(e,t,n,a,i),e.setShadow(!1),this.paintForeground(e,t,n,a,i)},mxShape.prototype.paintBackground=function(e,t,n,a,i){},mxShape.prototype.paintForeground=function(e,t,n,a,i){},mxShape.prototype.paintEdgeShape=function(e,t){},mxShape.prototype.getArcSize=function(e,t){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*n,t*n)},mxShape.prototype.paintGlassEffect=function(e,t,n,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",t,n,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(t-o+s,n-o),e.quadTo(t-o,n-o,t-o,n-o+s),e.lineTo(t-o,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+o,n+.4*i),e.lineTo(t+a+o,n-o+s),e.quadTo(t+a+o,n-o,t+a+o-s,n-o)):(e.moveTo(t-o,n-o),e.lineTo(t-o,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+o,n+.4*i),e.lineTo(t+a+o,n-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var t=this.getShapeRotation();0!=t&&(e=mxUtils.getBoundingBox(e,t)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var t=(e.width-e.height)/2;e.x+=t,e.y-=t,t=e.width,e.width=e.height,e.height=t}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var t=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(t/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,t,n,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",t),e.setAttribute("y",n),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var t in e){var n=e[t];n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,t){mxStencilRegistry.stencils[e]=t},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,t){mxMarker.markers[e]=t},createMarker:function(e,t,n,a,i,s,o,r,l,d){var c=mxMarker.markers[n];return null!=c?c(e,t,n,a,i,s,o,r,l,d):null}};function mxActor(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxCloud(e,t,n,a){mxActor.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRhombus(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxPolyline(e,t,n){mxShape.call(this),this.points=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxArrow(e,t,n,a,i,s,o){mxShape.call(this),this.points=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E){mxShape.call(this),this.value=e,this.bounds=t,this.color=null!=i?i:"black",this.align=null!=n?n:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=E?E:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,t,n){mxShape.call(this),this.bounds=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxImageShape(e,t,n,a,i){mxShape.call(this),this.bounds=e,this.image=t,this.fill=n,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,t,n,a){mxRectangleShape.call(this,e,t,n,a)}function mxCylinder(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxConnector(e,t,n){mxPolyline.call(this,e,t,n)}function mxSwimlane(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,t,n,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=null!=n?n:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,t,n,a){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=n||0,this.border=a||0}function mxCompactTreeLayout(e,t,n){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.invert=null!=n&&n}function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,t){mxGraphLayout.call(this,e),this.radius=null!=t?t:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,t,n){mxGraphLayout.call(this,e),this.layouts=t,this.master=n}function mxEdgeLabelLayout(e,t){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,t,n,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=n,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,n=[],null==t&&(t=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,t,n),a=0;a<t.length;a++){i=n[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];n[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&n[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}n[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,t,n,a,i,s){this.layout=e,this.intraCellSpacing=t,this.interRankCellSpacing=n,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,t,n,a,i,s,o,r,l,d){t=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=t,c.y-=r,o=n!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-t,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),n==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function t(e,t,n,a,i,s,o,r,l,d){r=n==mxConstants.ARROW_DIAMOND?.7071:.9862,t=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=t,c.y-=r,a.x+=-i-t,a.y+=-s-r;var m=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,t,n,a,i,s,o,r,l,d){t=1.118*i*l,n=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=t,c.y-=n,a.x+=2*-t,a.y+=2*-n,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,t,n,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",t),mxMarker.addMarker("diamondThin",t)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,t,n,a,i){t=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-t,2*i/5,a/2-t,0,a/2,0),e.curveTo(a/2+t,0,a/2+t,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,t,n,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(t,n,a,i,s,s)}else e.rect(t,n,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,t,n,a,i){this.glass&&this.paintGlassEffect(e,t,n,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var t=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,t)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-t/2)+"px",e.style.top=Math.round(this.bounds.y-t/2)+"px","CSS1Compat"==document.compatMode&&(t=-t),e.style.width=Math.round(Math.max(0,this.bounds.width+t))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+t))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var t=this.stroke;null!=t&&t!=mxConstants.NONE?(e.style.borderColor=t,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(t=this.fill)&&t!=mxConstants.NONE?(e.style.backgroundColor=t,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var t="";if(this.opacity<100&&(t+="alpha(opacity="+this.opacity+")"),this.isShadow&&(t+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var n=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=n,n=a,a=s):2==o?(s=n,n=a,a=s):3==o&&(i="1"),t+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=t},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,t,n,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(t+s,n+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,t,n,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(t+s,n),e.lineTo(t+a,n+o),e.lineTo(t+s,n+i),e.lineTo(t,n+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,t){this.paintLine(e,t,this.isRounded)},mxPolyline.prototype.paintLine=function(e,t,n){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=t[0],s=t[t.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<t.length-1;o++){var r=t[o],l=i.x-r.x;i=i.y-r.y;if(n&&o<t.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=t[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,t){var n=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=t[0],o=t[t.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*n-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+n*r)+c),u=(s=s.y-a/2+n*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-n*r,o.y-n*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var t=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var n=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,n=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(t=e.getBBox()).width&&0==t.height)return;this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),t=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(n=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(n=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=n),n=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(n=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=n&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*n,this.bounds.y+this.margin.y*a,n,a))}null!=this.boundingBox&&(0!=t&&(t=mxUtils.getBoundingBox(this.boundingBox,t),this.boundingBox.x=t.x,this.boundingBox.y=t.y,mxClient.IS_QUIRKS||(this.boundingBox.width=t.width,this.boundingBox.height=t.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,t,n,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t;t=this.bounds.height/t;this.updateTransform(e,n,a,i,t),this.configureCanvas(e,n,a,i,t);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(n,a,i,t,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),t=this.node.style,n=this.margin.x,a=this.margin.y;0!=e?(t[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-n+"% "+100*-a+"%",t[mxClient.CSS_PREFIX+"Transform"]="translate("+100*n+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(t[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",t[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*n+"%,"+100*a+"%)"),t.left=Math.round(this.bounds.x)+"px",t.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,t=this.margin.x,n=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(t=r*-(t+.5))-s*(n=o*-(n+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*t-l*n)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var t=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=t||null!=n)if("fill"==this.overflow)null!=t&&(this.node.style.backgroundColor=t),null!=n&&(this.node.style.border="1px solid "+n);else{var a="";null!=t&&(a+="background-color:"+t+";"),null!=n&&(a+="border:1px solid "+n+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var t=Math.round(this.bounds.width/this.scale),n=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<n&&(e.maxHeight=n+"px"),0<t&&(e.width=t+"px")):"fill"==this.overflow&&(e.width=t+"px",0<n&&(e.maxHeight=n+"px")),this.wrap?(!this.clipped&&0<t&&(e.width=t+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,t,n,a,i){n+=i/2,e.begin(),e.moveTo(t,n),e.lineTo(t+a,n),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,t,n,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(t,n,a,i),e.fillAndStroke()),e.image(t,n,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var t=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=t,this.flipH&&this.flipV?t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?t+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=t&&(e.style.filter=t),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,t,n,a,i){this.paintImage(e,t,n,a,i),this.paintIndicator(e,t,n,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,t,n,a,i){null!=this.image&&(t=this.getImageBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(n-o)/2:i==mxConstants.ALIGN_RIGHT?e+(n-o-l):e+l,t=s==mxConstants.ALIGN_TOP?t+l:s==mxConstants.ALIGN_BOTTOM?t+(a-r-l):t+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,t,n,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(t,n,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(t=this.getIndicatorBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(n-o-l):i==mxConstants.ALIGN_CENTER?e+(n-o)/2:e+l,t=s==mxConstants.ALIGN_BOTTOM?t+(a-r-l):s==mxConstants.ALIGN_TOP?t+l:t+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var t=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);t.x-=this.bounds.x,t.y-=this.bounds.y,e.style.left=Math.round(t.x)+"px",e.style.top=Math.round(t.y)+"px",e.style.width=Math.round(t.width)+"px",e.style.height=Math.round(t.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,t,n,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,t,n,a,i,s){t=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,t),e.curveTo(0,2*t,a,2*t,a,t),s||(e.stroke(),e.begin())),s||(e.moveTo(0,t),e.curveTo(0,-t/3,a,-t/3,a,t),e.lineTo(a,i-t),e.curveTo(a,i+t/3,0,i+t/3,0,i-t),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,t){var n=this.createMarker(e,t,!0),a=this.createMarker(e,t,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,t,this.isRounded):this.paintCurvedLine(e,t),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=n&&n(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,t){e.begin();var n=t[0],a=t.length;for(e.moveTo(n.x,n.y),n=1;n<a-2;n++){var i=t[n],s=t[n+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=t[a-2],s=t[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,t,n){var a=t.length,i=n?t[1]:t[a-2],s=(a=(t=n?t[0]:t[a-1]).x-i.x,t.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,t,i,a,s,n,this.strokewidth,0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var t=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=Math.max(t,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(t*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,t,n){return 3*n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,t,n,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(t,n),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,t,n,a,i,s,l,o,r)):this.paintSwimlane(e,t,n,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(t,s,a,i),e.image(i.x-t,i.y-n,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,t,n,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,t,n,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,t,n,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(t,n),e.lineTo(t,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,t,n,a){return new mxRectangle(e+n-this.imageSize,t,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,t,n){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,t,n,a){return null!=(t=null!=(n=this.graph.view.getState(t))?n.style:this.graph.getCellStyle(t))?t[e]:null},mxGraphLayout.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=n(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;t&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,t,n,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var t=this.graph.getModel();return!t.isEdge(e)||!this.graph.isCellVisible(e)||null==t.getTerminal(e,!0)||null==t.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,t?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,t?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var t=new mxPoint;if(null!=e&&e!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,e))for(var a=n.getGeometry(e);e!=this.parent;)t.x+=a.x,t.y+=a.y,e=n.getParent(e),a=n.getGeometry(e)}return t},mxGraphLayout.prototype.setEdgePoints=function(e,t){if(null!=e){var n=this.graph.model,a=n.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=t)for(var i=n.getParent(e),s=(i=this.getParentOffset(i),0);s<t.length;s++)t[s].x-=i.x,t[s].y-=i.y;a.points=t,n.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(t,n,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(t+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(n+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(t-=(o=this.getParentOffset(o)).x,n-=o.y)),i.x==t&&i.y==n||((i=i.clone()).x=t,i.y=n,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var t=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var n=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/n,s=Math.max(r.y-a.y,0)/n,o=Math.max(a.x+a.width-(r.x+r.width),0)/n,r=Math.max(a.y+a.height-(r.y+r.height),0)/n;t=new mxRectangle(t.x-i,t.y-s,t.width+i+o,t.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),t=t.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),t.x+=e.x,t.y+=e.y)),new mxRectangle(t.x,t.y,t.width,t.height)},mxGraphLayout.prototype.arrangeGroups=function(e,t){this.graph.getModel().beginUpdate();try{for(var n=e.length-1;0<=n;n--){var a=e[n],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-t-r,o.y=o.y+s.y-t-l,o.width=s.width+2*t+r,o.height=s.height+2*t+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,t+r-s.x,t+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,t,n){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(t=s?t:n,null!=(o=this.graph.getView().getState(i))&&(t-=s?o.x:o.y),o=0;o<l;o++)if((n=a.getChildAt(i,o))!=e&&null!=(n=a.getGeometry(n))){if(n=s?n.x+n.width/2:n.y+n.height/2,r<t&&t<n)break;r=n}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var t=this.graph.getModel(),n=t.getGeometry(e);return null!=this.graph.container&&(null==n&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),n},mxStackLayout.prototype.execute=function(e){if(null!=e){var t=this.isHorizontal(),n=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=t?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);t==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),t?o+=l:s+=l}n.beginUpdate();try{l=0,r=null;for(var d=n.getChildCount(e),c=0;c<d;c++){var m=n.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=n.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(t&&r.x+r.width+u.width+2*this.spacing>this.wrap||!t&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,t?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,t?u.height:u.width),null!=r?t?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(t?u.x=s:u.y=o),t?u.y=o:u.x=s,this.fill&&0<i&&(t?u.height=i:u.width=i),n.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),t?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,n.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(t?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{n.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,t,n){var a=(n=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=n.getChildCount(a);for(i=0;i<o;i++){var r=n.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<t&&t<r)break;s=r}}t=a.getIndex(e),t=Math.max(0,i-(t<i?1:0)),n.add(a,e,t)}},mxPartitionLayout.prototype.execute=function(e){var t=this.isHorizontal(),n=this.graph.getModel(),a=n.getGeometry(e);if(null!=this.graph.container&&(null==a&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=t?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=t?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=t?(a.width-l-e)/s:(a.height-d-e)/s)){n.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=n.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,t?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),n.setGeometry(r,m))}}finally{n.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.getModel();if(null==t)if(0<this.graph.getEdges(e,n.getParent(e),this.invert,!this.invert,!1).length)t=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){t=o[a];break}}if(null!=t){this.parentsChanged=this.resizeParent?{}:null,n.beginUpdate();try{var i=this.dfs(t,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(t);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,t,n){for(e.x+=t,e.y+=n,this.apply(e),e=e.child;null!=e;)this.moveNode(e,t,n),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,t,n){n=null!=n?n:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==n[a]&&!this.isVertexIgnored(e)){n[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,t,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,t,n))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var t=e.child;null!=t;)this.layout(t),t=t.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,t,n,a){if(e.x+=t+e.offsetX,e.y+=n+e.offsetY,a=this.apply(e,a),null!=(t=e.child)){a=this.horizontalLayout(t,e.x,e.y,a),n=e.y+t.offsetY;for(var i=t.next;null!=i;)a=this.horizontalLayout(i,e.x+t.offsetX,n,a),n+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,t,n,a,i){if(e.x+=n+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(t=e.child))for(i=this.verticalLayout(t,e,e.x,e.y,i),n=e.x+t.offsetY,a=t.next;null!=a;)i=this.verticalLayout(a,e,n,e.y+t.offsetX,i),n+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,t){var n=this.nodeDistance+this.levelDistance,a=(t-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-t;e.child.offsetX=n+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(n,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(n,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var t=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+t,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-t),e.contour.lowerHead=this.createLine(e.height+t,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var t=2*this.nodeDistance,n=e.child;e.contour=n.contour;var a=n.width+t,i=a;for(n=n.next;null!=n;){var s=this.merge(e.contour,n.contour);n.offsetY=s+a,n.offsetX=0,i+=s+(a=n.width+t),n=n.next}return i},mxCompactTreeLayout.prototype.merge=function(e,t){for(var n=0,a=0,i=0,s=e.lowerHead,o=t.upperHead;null!=o&&null!=s;){var r=this.offset(n,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;n+o.dx<=s.dx?(n+=o.dx,a+=o.dy,o=o.next):(n-=s.dx,a-=s.dy,s=s.next)}return null!=o?(n=this.bridge(e.upperTail,0,0,o,n,a),e.upperTail=null!=n.next?t.upperTail:n,e.lowerTail=t.lowerTail):null==(n=this.bridge(t.lowerTail,n,a,s,0,0)).next&&(e.lowerTail=n),e.lowerHead=t.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,t,n,a,i,s){var o;return i<=e||e+n<=0?0:0<(o=0<i*a-n*s?e<0?e*a/n-t:0<e?e*s/i-t:-t:i<e+n?s-(t+(i-e)*a/n):e+n<i?(n+e)*s/i-(t+a):s-(t+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,t,n,a,i,s){return t=i+a.dx-t,i=i=0,0==a.dx?i=a.dy:(i=t*a.dy,i/=a.dx),t=this.createLine(t,i,a.next),e.next=this.createLine(0,s+a.dy-i-n,t),t},mxCompactTreeLayout.prototype.createNode=function(e){var t={};return t.cell=e,t.x=0,t.y=0,t.width=0,t.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(t.width=e.height,t.height=e.width):(t.width=e.width,t.height=e.height)),t.offsetX=0,t.offsetY=0,t.contour={},t},mxCompactTreeLayout.prototype.apply=function(e,t){var n=this.graph.getModel(),a=e.cell,i=n.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(n=n.getParent(a),a=mxCellPath.create(n),null==this.parentsChanged[a]&&(this.parentsChanged[a]=n))),t=null==t?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x+t.width,i.x+i.width),Math.max(t.y+t.height,i.y+i.height))),t},mxCompactTreeLayout.prototype.createLine=function(e,t,n){var a={};return a.dx=e,a.dy=t,a.next=n,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,t=[];for(e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var t=e.child,n=e.cell,a=0,i=[];null!=t;){a++;var s=t.x;this.horizontal&&(s=t.y),i.push(new WeightedCellSorter(t,s)),t=t.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),t=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(t+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(n),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(n,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+t,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+t,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),t+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?1:t.weightedValue<e.weightedValue?-1:t.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var t=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(e),a=0;a<n.length;a++)this.isVertexIgnored(n[a])||this.vertexArray.push(n[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}t.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);n=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<n.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(n[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=n=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),n=null==n?m:Math.min(n,m),e=null==e?u:Math.min(e,u)));a=1-(n||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{t.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(n=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(n=.001);var t=this.dispX[e]/n*Math.min(n,this.temperature),n=this.dispY[e]/n*Math.min(n,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=t,this.cellLocation[e][1]+=n}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var t=0;t<this.neighbours[e].length;t++){var n=this.neighbours[e][t];if(e!=n&&this.isMoveable[e]&&this.isMoveable[n]){(a=(s=this.cellLocation[e][0]-this.cellLocation[n][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[n][1])*o-this.radiusSquared[e]-this.radiusSquared[n])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[n]+=s,this.dispY[n]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,t=0;t<e;t++)for(var n=t;n<e;n++){if(!this.allowedToRun)return;if(n!=t&&this.isMoveable[t]&&this.isMoveable[n]){var a=this.cellLocation[t][0]-this.cellLocation[n][0],i=this.cellLocation[t][1]-this.cellLocation[n][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[t]-this.radius[n];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[t]+=a,this.dispY[t]+=i,this.dispX[n]-=a,this.dispY[n]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0,a=null,i=null,s=[],o=t.getChildCount(e),r=0;r<o;r++){var l=t.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),n=Math.max(n,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,n);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{t.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,t){return Math.max(e*t/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,t,n,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],n+t+t*Math.sin(o*s),a+t+t*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var t in e){var n=e[t];1<n.length&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var t=this.graph.getModel(),n=[],a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==n[o]&&(n[o]=[]),n[o].push(s))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var t=this.graph.getView(),n=t.getState(e),a=null!=n?n.getVisibleTerminal(!0):t.getVisibleTerminal(e,!0);return e=null!=n?n.getVisibleTerminal(!1):t.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var t=e[0];if((o=(n=this.graph.getModel()).getGeometry(n.getTerminal(t,!0)))==(s=n.getGeometry(n.getTerminal(t,!1)))){t=o.x+o.width+this.spacing;for(var n=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],t,n),t+=this.spacing}else if(null!=o&&null!=s){t=o.x+o.width/2,n=o.y+o.height/2,a=s.x+s.width/2-t;var i=s.y+s.height/2-n,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,t=t+a/2+o*(e.length-1)/2,n=n+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],t,n),t-=o,n+=s}},mxParallelEdgeLayout.prototype.route=function(e,t,n){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(t,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,t,n){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var t=this.graph.view,n=this.graph.getModel(),a=[],i=[],s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o),l=t.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,t){var n=this.graph.getModel();n.beginUpdate();try{for(var a=0;a<t.length;a++){var i=t[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,t){var n=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,t)){var i=-a.y-a.height+t.y,s=-a.y+t.y+t.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+t.x,a=-a.x+t.x+t.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=n.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),n.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,t){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,t){this.isVertex()?this.x[0]=t:this.isEdge()&&(this.x[e-this.minRank-1]=t)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,t){this.isVertex()?this.y[0]=t:this.isEdge()&&(this.y[e-this.minRank-1]=t)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsTarget.length;t++){var n=this.connectsAsTarget[t];-1==n.maxRank||n.maxRank==e+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsSource.length;t++){var n=this.connectsAsSource[t];-1==n.minRank||n.minRank==e-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,t){this.temp[0]=t},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var t=0;t<this.hashCode.length;t++)if(this.hashCode[t]!=e.hashCode[t])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.nextLayerConnectedCells[t]=[],t==this.temp.length-1?this.nextLayerConnectedCells[t].push(this.source):this.nextLayerConnectedCells[t].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.previousLayerConnectedCells[t]=[],0==t?this.previousLayerConnectedCells[t].push(this.target):this.previousLayerConnectedCells[t].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,t){this.temp[e-this.minRank-1]=t},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,t,n){for(var a=e.getGraph(),i=0;i<t.length;i++){n[i]=new mxGraphHierarchyNode(t[i]);var s=mxCellPath.create(t[i]);this.vertexMapper[s]=n[i],s=e.getEdges(t[i]),n[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=t[i]&&d!=t[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(t[i],d,!1),l=e.getEdgesBetween(t[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=n[i],mxUtils.indexOf(n[i].connectsAsSource,l)<0&&n[i].connectsAsSource.push(l)}}}n[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var t=0;t<this.roots.length;t++){var n=mxCellPath.create(this.roots[t]);null!=(n=this.vertexMapper[n])&&e.push(n)}for(var a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(n=e[0]).connectsAsTarget,o=n.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(t=0;t<s.length;t++){var d=s[t];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(n.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(t=0;t<o.length;t++)(d=o[t]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(t=e.shift(),e.push(n),t==n&&1==e.length)break}for(a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]-=this.maxRank;for(t=0;t<i.length;t++)for(e=0,s=(n=i[t]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,n.temp[0]=Math.max(e,d.temp[0]+1),e=n.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var t=null;if(null!=this.roots){var n=this.roots;for(t=[],e=0;e<n.length;e++){var a=mxCellPath.create(n[e]);t[e]=this.vertexMapper[a]}}this.visit(function(e,t,n,a,i){if(0==i&&t.maxRank<0&&t.minRank<0&&(s[t.temp[0]].push(t),t.maxRank=t.temp[0],t.minRank=t.temp[0],t.temp[0]=s[t.maxRank].length-1),null!=e&&null!=n&&1<e.maxRank-t.maxRank)for(n.maxRank=e.maxRank,n.minRank=t.maxRank,n.temp=[],n.x=[],n.y=[],e=n.minRank+1;e<n.maxRank;e++)s[e].push(n),n.setGeneralPurposeVariable(e,s[e].length-1)},t,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,t,n,a){if(null!=t){for(var i=0;i<t.length;i++){var s=t[i];null!=s&&(null==a&&(a={}),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,t,n,a,i,s){if(null!=t){var o=mxCellPath.create(t.cell);if(null==i[o])for(a(e,i[o]=t,n,s,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)o=e[n],this.dfs(t,o.target,o,a,i,s+1);else a(e,t,n,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,t,n,a,i,s,o,r){if(null!=t)if(null==e||null!=t.hashCode&&t.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,t.hashCode=e.hashCode.slice(),t.hashCode[s-1]=o),null==i[o=mxCellPath.create(t.cell)])for(a(e,i[o]=t,n,r,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)o=e[n],this.extendedDfs(t,o.target,o,a,i,t.hashCode,n,r+1);else a(e,t,n,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var t=0;t<e.ranks.length;t++)this.nestedBestRanks[t]=e.ranks[t].slice();var n=0,a=this.calculateCrossings(e);for(t=0;t<this.maxIterations&&n<this.maxNoImprovementIterations;t++){this.weightedMedian(t,e),this.transpose(t,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=n=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(n++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(n=[],a=[],t=0;t<e.maxRank+1;t++)a[t]=[],n[t]=a[t];for(t=0;t<this.nestedBestRanks.length;t++)for(i=0;i<this.nestedBestRanks[t].length;i++)a[t].push(this.nestedBestRanks[t][i]);e.ranks=n},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var t=e.ranks.length,n=0,a=1;a<t;a++)n+=this.calculateRankCrossing(a,e);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,t){for(var n=0,a=t.ranks[e],i=a.length,s=t.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&n++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&n++}return n/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,t){for(var n=!0,a=0;n&&a++<10;)for(var i=1==e%2&&1==a%2,s=(n=!1,0);s<t.ranks.length;s++){for(var o=t.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),E=(m=[],u=[],0);E<f.length;E++)m[E]=f[E].getGeneralPurposeVariable(s+1);for(E=0;E<b.length;E++)u[E]=b[E].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],E=0;E<d.length;E++)p[E]=d[E].getGeneralPurposeVariable(s+1);for(E=0;E<c.length;E++)g[E]=c[E].getGeneralPurposeVariable(s-1);var A=0,y=0;for(E=0;E<m.length;E++)for(var S=0;S<p.length;S++)m[E]>p[S]&&A++,m[E]<p[S]&&y++;for(E=0;E<u.length;E++)for(S=0;S<g.length;S++)u[E]>g[S]&&A++,u[E]<g[S]&&y++;(y<A||y==A&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(n=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,t){var n=0==e%2;if(n)for(var a=t.maxRank-1;0<=a;a--)this.medianRank(a,n);else for(a=1;a<t.maxRank;a++)this.medianRank(a,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,t){for(var n=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<n;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=t?e+1:e-1,null!=(o=t?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<n;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,t){for(var n=[],a=0,i=0;i<e.length;i++){var s=e[i];n[a++]=s.getGeneralPurposeVariable(t)}return n.sort(function(e,t){return e-t}),1==a%2?n[Math.floor(a/2)]:2==a?(n[0]+n[1])/2:(s=n[(i=a/2)-1]-n[0],a=n[a-1]-n[i],(n[i-1]*a+n[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.medianValue>e.medianValue?-1:t.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var t=this.layout.getModel(),s={},o=mxUtils.clone(t.vertexMapper,null,!0),n=null;if(null!=t.roots){var a=t.roots;n=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);n[e]=t.vertexMapper[i]}}if(t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget),t.connectsAsSource.push(n)),e=mxCellPath.create(t.cell),s[e]=t,delete o[e]},n,!0,null),n=null,0<o.lenth&&(n=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),t.connectsAsSource.push(n),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget)),e=mxCellPath.create(t.cell),s[e]=t,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=n&&0<n.length)for(t=t.roots,e=0;e<n.length;e++)i=n[e].cell,0==a.getIncomingEdges(i).length&&t.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxHierarchicalLayout(e,t,n){mxGraphLayout.call(this,e),this.orientation=null!=t?t:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,t){this.model=e,this.previous=this.root=t}function mxChildChange(e,t,n,a){this.model=e,this.previous=this.parent=t,this.child=n,this.previousIndex=this.index=a}function mxTerminalChange(e,t,n,a){this.model=e,this.cell=t,this.previous=this.terminal=n,this.source=a}function mxValueChange(e,t,n){this.model=e,this.cell=t,this.previous=this.value=n}function mxStyleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.style=n}function mxGeometryChange(e,t,n){this.model=e,this.cell=t,this.previous=this.geometry=n}function mxCollapseChange(e,t,n){this.model=e,this.cell=t,this.previous=this.collapsed=n}function mxVisibleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.visible=n}function mxCellAttributeChange(e,t,n){this.cell=e,this.attribute=t,this.previous=this.value=n}function mxCell(e,t,n){this.value=e,this.setGeometry(t),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(e,t,n,a){mxRectangle.call(this,e,t,n,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var t=0;t<e.ranks.length;t++){mxLog.write("Rank ",t," : ");for(var n=e.ranks[t],a=0;a<n.length;a++)mxLog.write(n[a].getGeneralPurposeVariable(t)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var t=1e8;if(this.fineTuning)for(var n=0;n<this.maxIterations;n++){if(0!=n&&(this.medianPos(n,e),this.minNode(e)),this.currentXDelta<t){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}t=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var t=[],n=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,t.push(r),n[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*t.length,s=0;0<t.length&&s<=e;){i=(r=t.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,t){if(0==e%2)for(var n=t.maxRank;0<n;n--)this.rankMedianPosition(n-1,t,n);else for(n=0;n<t.maxRank-1;n++)this.rankMedianPosition(n+1,t,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,t,n){t=t.ranks[e];for(var a=[],i=[],s=0;s<t.length;s++){var o=t[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=n<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=n<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,n):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,t){for(var n=0,a=0;a<t.length;a++){var i=t[a];e.isVertex()&&i.isVertex()?n++:n=e.isEdge()&&i.isEdge()?n+8:n+2}return n},mxCoordinateAssignment.prototype.medianXValue=function(e,t){if(0==e.length)return 0;for(var n=[],a=0;a<e.length;a++)n[a]=e[a].getGeneralPurposeVariable(t);return n.sort(function(e,t){return e-t}),1==e.length%2?n[Math.floor(e.length/2)]:(n[(a=e.length/2)-1]+n[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,t){this.calculateWidestRank(e,t);for(var n=this.widestRank;0<=n;n--)n<t.maxRank&&this.rankCoordinates(n,e,t);for(n=this.widestRank+1;n<=t.maxRank;n++)0<n&&this.rankCoordinates(n,e,t)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,t,n){t=n.ranks[e],n=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<t.length;s++){var o=t[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,n=Math.max(n,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,t){var n=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=t.maxRank;0<=i;i--){for(var s=0,o=t.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=n,r=s/2+a/2+this.interRankCellSpacing,a=s,n=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+r:n-r,d=0;d<o.length;d++)o[d].setY(i,n)}},mxCoordinateAssignment.prototype.minPath=function(e,t){var n,a=t.edgeMapper;for(n in a){var i=a[n];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(t,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(t,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,t,n,a){e=e.ranks[n];for(var i=-1,s=0;s<e.length;s++)if(t==e[s]){i=s;break}if(i<0)return!1;if(a<(s=t.getGeneralPurposeVariable(n))){if(0==i)return!0;if(!((n=(n=(e=e[i-1]).getGeneralPurposeVariable(n))+e.width/2+this.intraCellSpacing+t.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(n=(n=(e=e[i+1]).getGeneralPurposeVariable(n))-e.width/2-this.intraCellSpacing-t.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,t){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<t.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=0;n=null,this.layout.resizeParent&&(n={});var a,i=t.edgeMapper,s=t.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==n[r]&&(n[r]=o)}}for(a in this.layout.resizeParent&&null!=n&&this.adjustParents(n),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(t),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var t,n=[];for(t in e)n.push(e[t]);this.layout.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var t=0;t<e.ranks.length;t++)for(var n=e.ranks[t],a=0;a<n.length;a++){var i=n[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(t),o=t-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(t),o=t+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var t=0;if(101207!=e.temp[0]){var n=e.maxRank,a=e.minRank;n==a&&(n=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[n],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+t;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var E=f;f=b,b=E}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[n]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),t=0==t?this.parallelEdgeSpacing:0<t?-t:-t+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var t=e.cell,n=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(t,n,a):this.layout.setVertexLocation(t,a,n),this.limitX=Math.max(this.limitX,n+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,t){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?-1:t.weightedValue<e.weightedValue?1:t.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.model;if(this.edgesCache={},null!=t||null!=e){if(null!=t&&null!=e){for(var a=[],i=0;i<t.length;i++)n.isAncestor(e,t[i])&&a.push(t[i]);this.roots=a}else this.roots=t;n.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,t){var n=[];if(null!=e&&null!=t){var a,i=this.graph.model,s=null,o=-1e5;for(a in t){var r=t[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&n.push(r),o<(l=d-c)&&(o=l,s=r)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(e){var t=mxCellPath.create(e);if(null!=this.edgesCache[t])return this.edgesCache[t];for(var n=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o);this.isPort(r)?a=a.concat(n.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(n.getEdges(r,!0,!0)))}for(a=a.concat(n.getEdges(e,!0,!0)),n=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&n.push(a[o]);return this.edgesCache[t]=n},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,t){var n=null!=(n=this.graph.view.getState(e))?n.getVisibleTerminal(t):this.graph.view.getVisibleTerminal(e,t);return this.isPort(n)&&(n=this.graph.model.getParent(n)),n},mxHierarchicalLayout.prototype.run=function(e){var t=[],n=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];t.push(r),this.traverse(o[s],!0,null,n,r,t,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],t.push(r),traverse(roots.get(s),!0,null,n,r,t,null);for(s=n=0;s<t.length;s++){for(i in a=[],r=t[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),n=this.placementStage(n,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,t){var n=this.graph.model;if(n.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(t[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,t)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==t||!n&&o==t&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,t,n,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(n=0;n<s.length;n++)if(null!=(e=s[n])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(n=0;n<l.length;n++)r=this.getVisibleTerminal(l[n],!0)==e,(!t||r)&&(r=this.getVisibleTerminal(l[n],!r),i=this.traverse(r,t,l[n],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,t){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(t),n.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,t){var n=null;if(null!=e){n=[];for(var a=0;a<e.length;a++)t(e[a])&&n.push(e[a])}return n},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,t){var n=[];t=t||this.getRoot(),(null==e||e(t))&&n.push(t);for(var a=this.getChildCount(t),i=0;i<a;i++){var s=this.getChildAt(t,i);n=n.concat(this.filterDescendants(e,s))}return n},mxGraphModel.prototype.getRoot=function(e){var t=e||this.root;if(null!=e)for(;null!=e;)t=e,e=this.getParent(e);return t},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var t=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),t},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,t){for(;null!=t&&t!=e;)t=this.getParent(t);return t==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,t,n){if(t!=e&&null!=e&&null!=t){null==n&&(n=this.getChildCount(e));var a=e!=this.getParent(t);this.execute(new mxChildChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParents(t)}return t},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((t=this.getCell(e.getId()))!=e){for(;null!=t;)e.setId(this.createId(e)),t=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var t=this.getChildCount(e),n=0;n<t;n++)this.cellAdded(this.getChildAt(e,n))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,t){t=t||this.getRoot(e);for(var n=this.getChildCount(e),a=0;a<n;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,t)}for(i=this.getEdgeCount(e),n=[],a=0;a<i;a++)n.push(this.getEdgeAt(e,a));for(a=0;a<n.length;a++)i=n[a],this.isAncestor(t,i)&&this.updateEdgeParent(i,t)},mxGraphModel.prototype.updateEdgeParent=function(e,t){for(var n=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(t,n)&&this.isAncestor(t,a)&&(null!=(i=n==a?this.getParent(n):this.getNearestCommonAncestor(n,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(n=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(n=n.clone()).translate(-a,-s),this.setGeometry(e,n)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var t=null;return null!=e?(t=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(t.x+=e.x,t.y+=e.y)):t=new mxPoint,t},mxGraphModel.prototype.getNearestCommonAncestor=function(e,t){if(null!=e&&null!=t&&(null!=(s=mxCellPath.create(t))&&0<s.length)){var n=e,a=mxCellPath.create(n);if(s.length<a.length){n=t;var i=a,s=(a=s,i)}for(;null!=n;){if(i=this.getParent(n),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return n;a=mxCellPath.getParentPath(a),n=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var t=this.getChildCount(e)-1;0<=t;t--)this.cellRemoved(this.getChildAt(e,t));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,t,n){var a=this.getParent(e);return null!=t?(t!=a||a.getIndex(e)!=n)&&t.insert(e,n):null!=a&&(n=a.getIndex(e),a.remove(n)),this.contains(a)||null==t?null==t&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,t){return null!=e?e.getChildAt(t):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,t,n){t=null!=t&&t,n=null!=n&&n;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!n&&!t||n&&this.isEdge(o)||t&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,t){return null!=e?e.getTerminal(t):null},mxGraphModel.prototype.setTerminal=function(e,t,n){var a=t!=this.getTerminal(e,n);return this.execute(new mxTerminalChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),t},mxGraphModel.prototype.setTerminals=function(e,t,n){this.beginUpdate();try{this.setTerminal(e,t,!0),this.setTerminal(e,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,t,n){var a=this.getTerminal(e,n);return null!=t?t.insertEdge(e,n):null!=a&&a.removeEdge(e,n),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,t){return null!=e?e.getEdgeAt(t):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,t,n){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=n&&this.getTerminal(o,t)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,t,n,a){t=null==t||t,n=null==n||n,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(t&&d==e||n&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;var a=this.getEdgeCount(e),i=this.getEdgeCount(t),s=e,o=a;for(i<a&&(o=i,s=t),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==t||!n&&(d==e&&l==t))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==t&&null!=r&&r!=t&&a?i.push(r):r==t&&null!=o&&o!=t&&n&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var t=[],n=0;n<e.length;n++){for(var a=e[n],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&t.push(a)}return t},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,t){return this.execute(new mxValueChange(this,e,t)),t},mxGraphModel.prototype.valueForCellChanged=function(e,t){return e.valueChanged(t)},mxGraphModel.prototype.getGeometry=function(e,t){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,t){return t!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,t)),t},mxGraphModel.prototype.geometryForCellChanged=function(e,t){var n=this.getGeometry(e);return e.setGeometry(t),n},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,t){return t!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,t)),t},mxGraphModel.prototype.styleForCellChanged=function(e,t){var n=this.getStyle(e);return e.setStyle(t),n},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,t){return t!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,t)),t},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,t){var n=this.isCollapsed(e);return e.setCollapsed(t),n},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,t){return t!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,t)),t},mxGraphModel.prototype.visibleStateForCellChanged=function(e,t){var n=this.isVisible(e);return e.setVisible(t),n},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,t,n){n=null==n||n,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,t,n,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,t,n,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&n?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=t.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,n,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var t=[];if(null!=e)for(var n={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==n[s]&&(n[s]=i,t.push(i))}}return t},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,t){for(var n={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],n,t)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],n);return a},mxGraphModel.prototype.cloneCellImpl=function(e,t,n){var a=this.cellCloned(e);if(t[mxObjectIdentity.get(e)]=a,n){n=this.getChildCount(e);for(var i=0;i<n;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),t,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,t,n){null!=(a=this.getTerminal(t,!0))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(t,!1))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(t,i),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),t=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=t},mxChildChange.prototype.connect=function(e,t){t=null==t||t;var n=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=n&&(t?this.model.terminalForCellChanged(e,n,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(t?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(n,!0),e.setTerminal(a,!1),n=this.model.getChildCount(e),a=0;a<n;a++)this.connect(this.model.getChildAt(e,a),t)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var t=this.getValue();return this.setValue(e),t},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,t){return t?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,t){return null!=e&&(null==t&&(t=this.getChildCount(),e.getParent()==this&&t--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(t,0,e)),e},mxCell.prototype.remove=function(e){var t=null;return null!=this.children&&0<=e&&(null!=(t=this.getChildAt(e))&&(this.children.splice(e,1),t.setParent(null))),t},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,t){return null!=e&&(e.removeFromTerminal(t),e.setTerminal(this,t),null==this.edges||e.getTerminal(!t)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,t){if(null!=e){if(e.getTerminal(!t)!=this&&null!=this.edges){var n=this.getEdgeIndex(e);0<=n&&this.edges.splice(n,1)}e.setTerminal(null,t)}return e},mxCell.prototype.removeFromTerminal=function(e){var t=this.getTerminal(e);null!=t&&t.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,t){var n=this.getValue();return(null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(e):null)||t},mxCell.prototype.setAttribute=function(e,t){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(e,t)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,t){return t?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,t){if(this.clone(),this.relative||(this.x+=e,this.y+=t),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=t),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=t),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=this.points.length,a=0;a<n;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=t)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var t="";if(null!=e)for(var n=e.getParent();null!=n;)t=n.getIndex(e)+mxCellPath.PATH_SEPARATOR+t,n=(e=n).getParent();return 1<(e=t.length)&&(t=t.substring(0,e-1)),t},getParentPath:function(e){if(null!=e){var t=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=t)return e.substring(0,t);if(0<e.length)return""}return null},resolve:function(e,t){var n=e;if(null!=t)for(var a=t.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)n=n.getChildAt(parseInt(a[i]));return n},compare:function(e,t){for(var n=Math.min(e.length,t.length),a=0,i=0;i<n;i++)if(e[i]!=t[i]){a=0==e[i].length||0==t[i].length?e[i]==t[i]?0:e[i]>t[i]?1:-1:(n=parseInt(e[i]))==(i=parseInt(t[i]))?0:i<n?1:-1;break}return 0==a&&((n=e.length)!=(i=t.length)&&(a=i<n?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,t,n,a){t=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(n.y-i,n.x-t),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=t-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=t+e.height*Math.tan(l)/2),a&&(n.x>=e.x&&n.x<=e.x+e.width?o.x=n.x:n.y>=e.y&&n.y<=e.y+e.height&&(o.y=n.y),n.x<e.x?o.x=e.x:n.x>e.x+e.width&&(o.x=e.x+e.width),n.y<e.y?o.y=e.y:n.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,t,n,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;t=n.x,n=n.y;var c=parseInt(t-l),m=parseInt(n-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(t,n);if(a){if(s<=n&&n<=s+e.height)return e=n-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,t<=i&&(e=-e),new mxPoint(l+e,n);if(i<=t&&t<=i+e.width)return e=t-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,n<=s&&(e=-e),new mxPoint(t,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-t,2)+Math.pow(l-n,2)),t=Math.sqrt(Math.pow(r-t,2)+Math.pow(d-n,2)),s=n=0,s=i<t?(n=o,l):(n=r,d),new mxPoint(n,s)},RhombusPerimeter:function(e,t,n,a){t=e.x;var i=e.y,s=e.width,o=t+s/2,r=i+(e=e.height)/2,l=n.x;if(n=n.y,o==l)return new mxPoint(o,n<r?i:i+e);if(r==n)return new mxPoint(l<o?t:t+s,r);var d=o,c=r;return a&&(t<=l&&l<=t+s?d=l:i<=n&&n<=i+e&&(c=n)),l<o?n<r?mxUtils.intersection(l,n,d,c,o,i,t,r):mxUtils.intersection(l,n,d,c,o,i+e,t,r):n<r?mxUtils.intersection(l,n,d,c,o,i,t+s,r):mxUtils.intersection(l,n,d,c,o,i+e,t+s,r)},TrianglePerimeter:function(e,t,n,a){var i=(t=null!=t?t.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);t==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):t==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):t==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=n.x-l,g=n.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=t==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&n.x>=c.x&&n.x<=u.x||!i&&n.y>=c.y&&n.y<=u.y)?i?new mxPoint(n.x,c.y):new mxPoint(c.x,n.y):t==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):t==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):t==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),n.y>=o&&n.y<=o+e?(a.x=i?l:t==mxConstants.DIRECTION_WEST?s+r:s,a.y=n.y):n.x>=s&&n.x<=s+r&&(a.x=n.x,a.y=i?t==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&n.x<=s+r/2||!i&&n.y<=o+e/2?mxUtils.intersection(n.x,n.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(n.x,n.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,t,n,a,i,s,o,r,l){this.graph=e,this.scale=null!=t?t:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=n?n:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,t,n){this.view=e,this.cell=t,this.style=n,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,t,n){this.selectionModel=e,this.added=null!=t?t.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var t=this.graph.cellRenderer.initializeOverlay,n=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,t){t.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var t=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){t()}),mxEvent.addListener(this.wnd,"resize",function(e){t()})}}});if(e=function(e,t){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",t&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),t){var n=a.createElement("hr");n.className="mxPageBreak",a.body.appendChild(n)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,E=g*m+f+1;(n=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,E,e)}))).setAttribute("id","mxPage-"+E),e(n,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n)}finally{this.graph.cellRenderer.initializeOverlay=t}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,t){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=t&&e.writeln(t),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,t){var n=this.wnd.document,a=n.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=n.createElement("tbody"),s=0;s<e;s++){for(var o=n.createElement("tr"),r=0;r<t;r++){var l=s*t+r+1,d=n.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=n.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,n),d.appendChild(c)}else mxUtils.write(d,l,n);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,t,n){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=t+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=t-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),n(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,t,n,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,t),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,n,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(n=i.firstChild;null!=n;)p=n.nextSibling,"svg"==(t=n.nodeName.toLowerCase())?(n.setAttribute("width",parseInt(i.style.width)),n.setAttribute("height",parseInt(i.style.height))):"default"!=n.style.cursor&&"table"!=t&&n.parentNode.removeChild(n),n=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,t){this.styles[e]=t},mxStylesheet.prototype.getCellStyle=function(e,t){var n=t;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(n=null!=n&&";"!=e.charAt(0)?mxUtils.clone(n):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(o)?n[r]=parseFloat(o):n[r]=o}else if(null!=(o=this.styles[o]))for(r in o)n[r]=o[r]}return n},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,t){if(e=e||0,t=null!=t?t:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var n=this.shape.stencil.computeAspect(this.style,t.x,t.y,t.width,t.height);t.x=n.x,t.y=n.y,t.width=this.shape.stencil.w0*n.width,t.height=this.shape.stencil.h0*n.height}return 0!=e&&t.grow(e),t},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,t){t?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,t){t?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var t=0;t<this.absolutePoints.length;t++)e.absolutePoints[t]=this.absolutePoints[t].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var t=[],n=0;n<e.length;n++)this.graph.isCellSelectable(e[n])&&t.push(e[n]);this.changeSelection(t,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var t=0;t<e.length;t++)if(this.graph.isCellSelectable(e[t]))return e[t];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var t=null;this.singleSelection&&(t=this.cells,e=[this.getFirstSelectableCell(e)]);for(var n=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&n.push(e[a]);this.changeSelection(n,t)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var t=[],n=0;n<e.length;n++)this.isSelected(e[n])&&t.push(e[n]);this.changeSelection(null,t)}},mxGraphSelectionModel.prototype.changeSelection=function(e,t){if(null!=e&&0<e.length&&null!=e[0]||null!=t&&0<t.length&&null!=t[0]){var n=new mxSelectionChange(this,e,t);n.execute();var a=new mxUndoableEdit(this,!1);a.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var t=0;t<this.removed.length;t++)this.selectionModel.cellRemoved(this.removed[t]);if(null!=this.added)for(t=0;t<this.added.length;t++)this.selectionModel.cellAdded(this.added[t]);t=this.added,this.added=this.removed,this.removed=t,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),t=this.graph.isLabelClipped(e.cell),n=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),n?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);t&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!t&&n||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!t&&n||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,t){null==this.textarea&&this.init(),this.stopEditing(!0);var n=this.graph.getView().getState(e);if(null!=n){this.editingCell=e,this.trigger=t,(this.textNode=null)!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(n),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(n=this.getInitialValue(n,t))||0==n.length?(n=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=n,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),t=e.style;return t.position="absolute",t.whiteSpace="nowrap",t.visibility="hidden",t.display=mxClient.IS_QUIRKS?"inline":"inline-block",t.zoom="1",t.verticalAlign="top",t.lineHeight=this.textarea.style.lineHeight,t.fontSize=this.textarea.style.fontSize,t.fontFamily=this.textarea.style.fontFamily,t.fontWeight=this.textarea.style.fontWeight,t.textAlign=this.textarea.style.textAlign,t.fontStyle=this.textarea.style.fontStyle,t.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,t){return this.graph.getEditingValue(e.cell,t)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var t=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*t+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var t=this.graph.getModel().isEdge(e.cell),n=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*n,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*n+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*n+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*n+s;n=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*n+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-n-r),Math.max(i,e.height-o-l));return t?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=n,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(t?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,t){mxCellRenderer.prototype.defaultShapes[e]=t},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,t){var n=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(n.isVertex(e.cell)||n.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=t&&!t||(this.initializeShape(e),e.view.graph.ordered||n.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,t){for(var n=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==n;)n=this.findPreviousStateInContainer(a,o,s,t),s=o,o=i.getParent(s);return n},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,t,n,a){var i=null,s=e.getModel();for(n=null!=n?t.getIndex(n)-1:s.getChildCount(t)-1;0<=n&&null==i;n--)i=this.findPreviousStateInContainer(e,s.getChildAt(t,n),null,a);return null!=i||(null==(i=e.view.getState(t))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var t=e.shape.node.parentNode,n=this.getPreviousStateInContainer(e,t),a=t.firstChild;null!=n&&(a=n.shape.node,null!=n.text&&null!=n.text.node&&n.text.node.parentNode==t&&(a=n.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var t=(n=e.view).graph.getModel();if(n.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(n.graph.keepEdgesInBackground){var n,a=e.shape.node,i=a.parentNode;t=t.getParent(e.cell);null!=(i=null!=(n=n.getState(t))&&null!=n.shape&&null!=n.shape.node?n.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,t){e.shape.node.parentNode.insertBefore(e.shape.node,t),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var t=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=t?e.shape=new mxShape(t):(t=this.getShapeConstructor(e),e.shape=new t),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var t=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==t&&(t=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),t},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,t,n){var a=e.shape[t],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),n=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[t]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[t]=null)!=a&&(e.shape[t]=null!=a.shape&&"indicatorColor"!=t?a.shape[t]:a.style[n]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(n,e){var a=n.view.graph;if(a.getModel().isEdge(n.cell),0<n.style[mxConstants.STYLE_FONTSIZE]||null==n.style[mxConstants.STYLE_FONTSIZE]){var t=a.isHtmlLabel(n.cell)||null!=e&&mxUtils.isNode(e);n.text=new this.defaultTextShape(e,new mxRectangle,n.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(n),n.style[mxConstants.STYLE_FONTCOLOR],n.style[mxConstants.STYLE_FONTFAMILY],n.style[mxConstants.STYLE_FONTSIZE],n.style[mxConstants.STYLE_FONTSTYLE],n.style[mxConstants.STYLE_SPACING],n.style[mxConstants.STYLE_SPACING_TOP],n.style[mxConstants.STYLE_SPACING_RIGHT],n.style[mxConstants.STYLE_SPACING_BOTTOM],n.style[mxConstants.STYLE_SPACING_LEFT],n.style[mxConstants.STYLE_HORIZONTAL],n.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],n.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(n.cell)&&a.isHtmlLabel(n.cell),a.isLabelClipped(n.cell),n.style[mxConstants.STYLE_OVERFLOW],n.style[mxConstants.STYLE_LABEL_PADDING]),n.text.opacity=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_OPACITY,100),n.text.dialect=t?mxConstants.DIALECT_STRICTHTML:n.view.graph.dialect,n.text.state=n,this.initializeLabel(n);var i=!1,s=function(e){var t=n;return(mxClient.IS_TOUCH||i)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t};mxEvent.addGestureListeners(n.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(n.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.dblClick(e,n.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var t=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(t.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var t=e.view.graph.getCellOverlays(e.cell),n=null;if(null!=t){n=new mxDictionary;for(var a=0;a<t.length;a++){var i=null!=e.overlays?e.overlays.remove(t[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,t[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=t[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,t[a],i),null!=t[a].cursor&&(i.node.style.cursor=t[a].cursor)),n.put(t[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,t){t.destroy()}),e.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(e,t){t.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(t,n,e){var a=t.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))})},mxCellRenderer.prototype.createControl=function(n){var a=n.view.graph,e=a.getFoldingImage(n);if(a.foldingEnabled&&null!=e){if(null==n.control){var t=new mxRectangle(0,0,e.width,e.height);n.control=new mxImageShape(t,e.src),n.control.preserveImageAspect=!1,n.control.dialect=a.dialect,this.initControl(n,n.control,!0,function(e){if(a.isEnabled()){var t=!a.isCellCollapsed(n.cell);a.foldCells(t,!1,[n.cell]),mxEvent.consume(e)}})}}else null!=n.control&&(n.control.destroy(),n.control=null)},mxCellRenderer.prototype.initControl=function(t,e,n,a){var i=t.view.graph;return i.isHtmlLabel(t.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),n&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,t){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,t){return!0},mxCellRenderer.prototype.installListeners=function(n){var a=n.view.graph,t=function(e){var t=n;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t},i=!1;mxEvent.addListener(n.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(n.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(n.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(n,e),mxEvent.consume(e))):this.isShapeEvent(n,e)&&(a.dblClick(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,t){var n=this.getLabelValue(e);if(null==e.text&&null!=n&&(mxUtils.isNode(n)||0<n.length)?this.createLabel(e,n):null==e.text||null!=n&&0!=n.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!t&&e.text.value==n&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=n,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var t=e.view.graph,n=e.view.scale,a=t.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*n,i.y+=a.y*n,null!=(t=t.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*t.width*n-e.text.spacingLeft*n-e.text.spacingRight*n),i.height=Math.max(0,e.text.margin.y*t.height*n-e.text.spacingTop*n-e.text.spacingBottom*n))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),t.isSwimlane(e.cell)&&(0<(t=t.getStartSize(e.cell)).width?(a=Math.min(i.width,t.width*n),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<t.height&&(a=Math.min(i.height,t.height*n),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,t){if(e.text.isPaintBoundsInverted()){var n=(e.width-e.height)/2;t.x+=n,t.y-=n,n=t.width,t.width=t.height,t.height=n}if(t.x-=e.text.margin.x*t.width,t.y-=e.text.margin.y*t.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){n=e.view.scale;var a=e.text.getSpacing();t.x+=a.x*n,t.y+=a.y*n,t.width=Math.max(0,t.width-e.text.spacingLeft*n-e.text.spacingRight*n),t.height=Math.max(0,t.height-e.text.spacingTop*n-e.text.spacingBottom*n)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(n=e.getCenterX(),a=e.getCenterY(),t.x!=n||t.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(i),Math.sin(i),new mxPoint(n,a)),t.x=pt.x,t.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,t){var n=t.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=n.getCenterX(),i=n.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;n.x=Math.round(a-n.width/2),n.y=Math.round(i-n.height/2)}!o&&null!=t.bounds&&t.scale==s.view.scale&&t.bounds.equals(n)||(t.bounds=n,t.scale=s.view.scale,t.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,t){if(null!=e.control){var n=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!t&&e.control.scale==i&&e.control.bounds.equals(n)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=n,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var t=e.control.scale,n=e.control.bounds.width/t,a=(t=e.control.bounds.height/t,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+n*a,s=e.y+t*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-n/2*a),Math.round(s-t/2*a),Math.round(n*a),Math.round(t*a))},mxCellRenderer.prototype.redraw=function(e,t,n){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=t&&t,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),t=!0),delete e.invalidOrder,delete e.orderChanged,!t&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==n||n?e.shape.redraw():e.shape.updateBoundingBox()),(null==n||n)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,t){t.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,t,n,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(t=new mxCellState).x=r.x,t.y=r.y;else{if(null==t)return;var c=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(t.cell)).relative?d=r.x<=.5:null!=n&&(d=n.x+n.width<t.x)}r=!0,null!=l?((n=new mxCellState).x=l.x,n.y=l.y):null!=n&&((c=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(n.cell)).relative?r=e.x<=.5:null!=t&&(r=t.x+t.width<n.x)),null!=t&&null!=n&&(e=d?t.x:t.x+t.width,t=s.getRoutingCenterY(t),o=r?n.x:n.x+n.width,n=s.getRoutingCenterY(n),s=new mxPoint(e+(d?-a:a),t),l=new mxPoint(o+(r?-a:a),n),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,t)),i.push(new mxPoint(a,n))):(s.x<l.x==d?(a=t+(n-t)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,t,n,a,i){if(null!=t){var s=(n=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=n.transformControlPoint(e,a),mxUtils.contains(t,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*n.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=n.getRoutingCenterX(t),r=s):(l=n.getRoutingCenterY(t),d=s),null==a||a.x<t.x||a.x>t.x+t.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=t.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=t.y+t.height+2*r:o=e==mxConstants.DIRECTION_EAST?t.x-2*d:t.x+t.width+2*d:null!=a&&(o=n.getRoutingCenterX(t),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,t,n,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=t&&null!=n)if(null!=s){var l=Math.min(t.x,n.x),d=Math.max(t.x+t.width,n.x+n.width),c=(r=Math.min(t.y,n.y),Math.max(t.y+t.height,n.y+n.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(t.x,n.x))==(d=Math.min(t.x+t.width,n.x+n.width)))||(r=(r=Math.max(t.y,n.y))==(c=Math.min(t.y+t.height,n.y+n.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,t,n,a,i):mxEdgeStyle.TopToBottom(e,t,n,a,i)},SideToSide:function(e,t,n,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((t=new mxCellState).x=o.x,t.y=o.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(e=Math.max(t.x,n.x),o=Math.min(t.x+t.width,n.x+n.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(t),s=s.getRoutingCenterY(n),null!=a&&(a.y>=t.y&&a.y<=t.y+t.height&&(o=a.y),a.y>=n.y&&a.y<=n.y+n.height&&(s=a.y)),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(n,e,a.y)&&!mxUtils.contains(t,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(t.y,n.y),t=Math.min(t.y+t.height,n.y+n.height),i.push(new mxPoint(e,s+(t-s)/2)))))},TopToBottom:function(e,t,n,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((t=new mxCellState).x=o.x,t.y=o.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(o=Math.max(t.y,n.y),r=Math.min(t.y+t.height,n.y+n.height),e=s.getRoutingCenterX(t),null!=a&&a.x>=t.x&&a.x<=t.x+t.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=n.x&&a.x<=n.x+n.width?a.x:s.getRoutingCenterX(n),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(n,a.x,o)&&!mxUtils.contains(t,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(t.x,n.x),t=Math.min(t.x+t.width,n.x+n.width),i.push(new mxPoint(s+(t-s)/2,o)))))},SegmentConnector:function(e,t,n,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=t?l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=t,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=n,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=n&&(l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,t,n,a,i){var s=e.view.graph,o=null!=t&&s.getModel().isEdge(t.cell);s=null!=n&&s.getModel().isEdge(n.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,t,n,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=t?t.x:r.x;o=null!=t?t.y:r.y;var d=null!=t?t.width:1,c=null!=t?t.height:1,m=null!=n?n.x:l.x,u=null!=n?n.y:l.y,p=null!=n?n.width:1,g=null!=n?n.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=t&&(v[0]=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=n&&(v[1]=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=t&&(c=r),t=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(t[d][0]=(c.x-a[d][0])/a[d][2],t[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<t[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),t[d][1]=(c.y-a[d][1])/a[d][3],t[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<t[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=n&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),n=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),n[d]=u[d][0]&v[d],n[d]|=(u[d][1]&v[d])<<8,n[d]|=(u[1-d][d]&v[d])<<16,n[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&n[d])&&(n[d]<<=8),0==(3840&n[d])&&(n[d]=15&n[d]|n[d]>>8),0==(983040&n[d])&&(n[d]=65535&n[d]|(251658240&n[d])>>8),e[d]=15&n[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=n=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=n&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+t[p][0]*a[p][2]:u?a[p][1]+t[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:n=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,t,n,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=t)<1&&(i+=4),(e-=t)<1&&(e+=4),t=routePatterns[i-1][e-1],0!=n&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(t=inlineRoutePatterns[i-1][e-1]),t}},mxStyleRegistry={values:[],putValue:function(e,t){mxStyleRegistry.values[e]=t},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var t in mxStyleRegistry.values)if(mxStyleRegistry.values[t]==e)return t;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,t){if(this.view=e,this.previous=this.root=t,this.isUp=null==t,!this.isUp)for(var n=this.view.currentRoot,a=this.view.graph.getModel();null!=n;){if(n==t){this.isUp=!0;break}n=a.getParent(n)}}function mxGraph(e,t,n,a){this.mouseListeners=null,this.renderHint=n,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=t?t:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,t){this.graphModelChanged(t.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,t,n,a,i,s){this.image=e,this.tooltip=t,this.align=null!=n?n:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,t){this.source=e,null!=t&&this.init(t)}function mxMultiplicity(e,t,n,a,i,s,o,r,l,d){this.source=e,this.type=t,this.attr=n,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.beforeUndo(t.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsMoved(t.getProperty("cells"),t.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,t,n,a){this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.shiftRightwards=null==t||t,this.shiftDownwards=null==n||n,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,t,n,a){this.horizontal=null==t||t,this.addEnabled=null==n||n,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(t.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,t,n){if(this.view=e,t=null!=t?t:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(t),null!=n){t=e.createState(new mxCell);for(var a=0;a<n.length;a++)e.validateBounds(t,n[a]);var i=null;for(a=0;a<n.length;a++){var s=e.validatePoints(t,n[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,t){this.point=e,this.perimeter=null==t||t}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,t){null!=e&&(this.graph=e,this.factoryMethod=t,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,t,n,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=t?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,t){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=t,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,t){null!=e&&(this.graph=e,this.target=t||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,t){null!=e&&(this.graph=e,this.delay=t||500,this.graph.addMouseListener(this))}function mxCellTracker(e,t,n){mxCellMarker.call(this,e,t),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,t,n,a){null!=e&&(this.graph=e,this.highlightColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var n=this.handler.escape;this.handler.escape=function(e){n.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,t){this.editor=t,null!=e&&null!=t&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i))}return t},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var t=new mxCurrentRootChange(this,e);t.execute();var n=new mxUndoableEdit(this,!1);n.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,t,n){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==t&&this.translate.y==n||(this.scale=e,this.translate.x=t,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var t=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",t))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,t){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==t||(this.translate.x=e,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,t,n){var a=this.graph.getModel();if(e=e||a.getRoot(),t=null!=t&&t,n=null==n||n,this.removeState(e),n&&(t||e!=this.currentRoot)){n=a.getChildCount(e);for(var i=0;i<n;i++)this.clear(a.getChildAt(e,i),t)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,t,n,a){var i=this.graph.getModel();if(e=e||i.getRoot(),t=null==t||t,n=null==n||n,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),t)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,t,n,a)}if(n)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),t,n)},mxGraphView.prototype.validate=function(e){var t=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var n=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){n=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=n&&(this.canvas.style.display=n,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",t)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(t=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,t=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*t,e.height*t)},mxGraphView.prototype.redrawBackgroundImage=function(e,t){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*t.width,e.bounds.height=this.scale*t.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,t){var n=this.graph.getModel(),a=this.getState(t,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(t)){if(t!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(t))){if(!n.isEdge(t)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,n.isVertex(t)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(t);null!=(i=this.graph.getChildOffsetForCell(t))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(s=n.getChildCount(t),i=0;i<s;i++)o=n.getChildAt(t,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);t==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,t){var n=this.graph.getModel(),a=this.getState(t),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(t);if(null!=s&&n.isEdge(t)){var o=this.getState(this.getVisibleTerminal(t,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&n.isEdge(o.cell)&&!n.isAncestor(o.cell,t)){var r=this.getState(n.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(t,!1));a.setVisibleTerminalState(l,!1),null!=l&&n.isEdge(l.cell)&&!n.isAncestor(l.cell,t)&&(r=this.getState(n.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&n.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,t!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(n.isEdge(t)||n.isVertex(t))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(s=n.getChildCount(t),o=0;o<s;o++)r=n.getChildAt(t,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,t){var n=t.cell;if(!this.graph.isCellCollapsed(n)||n==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(n),s=0;s<i;s++)this.validateBounds(t,a.getChildAt(n,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,t,n){this.updateFixedTerminalPoint(e,t,!0,this.graph.getConnectionConstraint(e,t,!0)),this.updateFixedTerminalPoint(e,n,!1,this.graph.getConnectionConstraint(e,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,t,n,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(t,a)),null==i&&null==t){t=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(n))&&(i=new mxPoint(t*(a.x+i.x+s.x),t*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,n)},mxGraphView.prototype.updatePoints=function(e,t,n,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,t,n,a);if(null!=s)s(e,n=this.getTerminalPort(e,n,!0),a=this.getTerminalPort(e,a,!1),t,i);else if(null!=t)for(s=0;s<t.length;s++)null!=t[s]&&(a=mxUtils.clone(t[s]),i.push(this.transformControlPoint(e,a)));t=e.absolutePoints,i.push(t[t.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,t){var n=e.origin;return new mxPoint(this.scale*(t.x+this.translate.x+n.x),this.scale*(t.y+this.translate.y+n.y))},mxGraphView.prototype.getEdgeStyle=function(e,t,n,a){return"string"==typeof(e=null!=n&&n==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(t=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,t,n){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!1),null==i&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,t,n,a){t=this.getTerminalPort(e,t,a);var i=this.getNextPoint(e,n,a),s=this.graph.isOrthogonal(e);n=mxUtils.toRadians(Number(t.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(t.getCenterX(),t.getCenterY());if(0!=n){var r=Math.cos(-n),l=Math.sin(-n);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),t=this.getPerimeterPoint(t,i,0==n&&s,r),0!=n&&(r=Math.cos(n),l=Math.sin(n),t=mxUtils.getRotatedPoint(t,r,l,o)),e.setAbsoluteTerminalPoint(t,a)},mxGraphView.prototype.getTerminalPort=function(e,t,n){return null!=(e=mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(t=e)),t},mxGraphView.prototype.getPerimeterPoint=function(e,t,n,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=t&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,t,n)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+t*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+t*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,t){return t=null!=t?t:0,null!=e&&(t+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(t*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var t=mxStyleRegistry.getValue(e);null==t&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,t,n){var a=null;return null!=(e=e.absolutePoints)&&(n||2<e.length||null==t)&&(a=e.length,a=e[n?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=t&&(a=new mxPoint(t.getCenterX(),t.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,t){for(var n=this.graph.getModel(),a=n.getTerminal(e,t),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=n.getParent(a);return n.getParent(i)==n.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var t=e.absolutePoints;if(e.length=0,null!=t&&0<t.length){var n=t[0],a=t[t.length-1];if(null==n||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(n.x!=a.x||n.y!=a.y){var i=a.x-n.x,s=a.y-n.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=n)){n=s.x;for(var r=s.y,l=n,d=r,c=1;c<t.length;c++){var m=t[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,n=Math.min(s.x,n),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=n,e.y=r,e.width=Math.max(1,l-n),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,t){var n=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=t&&!t.relative)null!=t&&(null!=(d=t.offset)&&(n+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=t?t.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=n=a=0,null!=t){a=t.y;var d=t.offset;null!=d&&(n=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,n=s.x+d*i+((0==o?0:l/o)*a+n)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(n,a)},mxGraphView.prototype.getRelativePoint=function(e,t,n){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=t-l))*e+(s=(d=o.y-s)-(s=n-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,t,n)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var t=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=t&&0<t.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(n=this.getPoint(e,i))&&(e.absoluteOffset=n)}else{var n=t[0],a=t[t.length-1];if(null!=n&&null!=a){t=a.x-n.x;var i,s=a.y-n.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=n.y+s/2+o*this.scale,e.absoluteOffset.x=n.x+t/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,t){t=t||!1;var n=null;return null!=e&&(n=this.states.get(e),this.graph.isCellVisible(e)&&(null==n&&t&&this.graph.isCellVisible(e)?(n=this.createState(e),this.states.put(e,n)):t&&null!=n&&this.updateStyle&&(n.style=this.graph.getCellStyle(e)))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var t=[],n=0;n<e.length;n++){var a=this.getState(e[n]);null!=a&&t.push(a)}return t},mxGraphView.prototype.removeState=function(e){var t=null;return null!=e&&(null!=(t=this.states.remove(e))&&(this.graph.cellRenderer.destroy(t),t.destroy())),t},mxGraphView.prototype.createState=function(e){var t=this.graph.getCellStyle(e);return e=new mxCellState(this,e,t),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var t=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-t.x,e.clientY-t.y);t=this.graph.container.offsetWidth;var n=this.graph.container.clientWidth;return n<t&&e.x>n+2&&e.x<=t||(t=this.graph.container.offsetHeight,(n=this.graph.container.clientHeight)<t&&e.y>n+2&&e.y<=t)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,t){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var t,n;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(t=e,n=null,mxClient.IS_TOUCH&&(n=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(i,n,t),n=a.view.getState(a.getCellAt(t.x,t.y))),n)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,t){if(null!=this.graph.container){var n=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=n<t?t+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,t){var n=document.createElement("DIV");return null!=e&&null!=t?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e,n.style.height=t):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var t=e.offsetWidth,n=e.offsetHeight;this.canvas=this.createVmlPane(t,n),this.backgroundPane=this.createVmlPane(t,n),this.drawPane=this.createVmlPane(t,n),this.overlayPane=this.createVmlPane(t,n),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,t){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e+"px",n.style.height=t+"px",n.setAttribute("coordsize",e+","+t),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var t=document.createElementNS(mxConstants.NS_SVG,"svg");t.style.width="100%",t.style.height="100%",t.style.display="block",t.appendChild(this.canvas),null!=e&&(e.appendChild(t),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(t,i)<0&&t.push(i)}}return this.getModel().getTopmostCells(t)},mxGraph.prototype.graphModelChanged=function(e){for(var t=0;t<e.length;t++)this.processChange(e[t]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(t=t.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(t=t.concat(this.model.getDescendants(a.cell)))}return t},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var t=this.model.getParent(e.child);null!=t?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),t!=e.previous&&(null!=t&&this.view.invalidate(t,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var t=this.model.getChildCount(e),n=0;n<t;n++)this.removeStateForCell(this.model.getChildAt(e,n));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,t){null==e.overlays&&(e.overlays=[]),e.overlays.push(t);var n=this.view.getState(e);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",t)),t},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,t){if(null==t)this.removeCellOverlays(e);else{var n=mxUtils.indexOf(e.overlays,t);0<=n?(e.overlays.splice(n,1),0==e.overlays.length&&(e.overlays=null),null!=(n=this.view.getState(e))&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t))):t=null}return t},mxGraph.prototype.removeCellOverlays=function(e){var t=e.overlays;if(null!=t){e.overlays=null;var n=this.view.getState(e);for(null!=n&&this.cellRenderer.redraw(n),n=0;n<t.length;n++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t[n]))}return t},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var t=this.model.getChildCount(e),n=0;n<t;n++){var a=this.model.getChildAt(e,n);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(n,e,t,a){return null!=e&&0<e.length?(e=new mxCellOverlay(t=null!=t?t:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,t){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,e)):(this.removeCellOverlays(n),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,t){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",t)),this.cellEditor.startEditing(e,t))},mxGraph.prototype.getEditingValue=function(e,t){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,t,n){this.model.beginUpdate();try{this.cellLabelChanged(e,t,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",t,"event",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,t,n){this.model.beginUpdate();try{this.model.setValue(e,t),n&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var t=0;t<e.length;t++){var n=this.view.getState(e[t]);null!=n&&null!=n.handler&&n.handler.reset()}},mxGraph.prototype.click=function(e){var t=e.getEvent(),n=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",t,"cell",n);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(t)&&!a.isConsumed()&&(null!=n?this.selectCellForEvent(n,t):(n=null,this.isSwimlaneSelectionEnabled()&&(n=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=n?this.selectCellForEvent(n,t):this.isToggleEvent(t)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&null!=t&&this.isCellEditable(t)&&this.startEditingAtCell(t,e)},mxGraph.prototype.scrollPointToVisible=function(e,t,n,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,t+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&t>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&t<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,n&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-t)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&n&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,t=this.container.scrollHeight+a-s):(t=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=t+"px",i.scrollTop+=a-s)):(s=t-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var t=0;t="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(t)&&(t=0),t}var t=mxUtils.getCurrentStyle(this.container),n=new mxRectangle;return n.x=e(t.borderLeftWidth)+parseInt(t.paddingLeft||0),n.y=e(t.borderTopWidth)+parseInt(t.paddingTop||0),n.width=e(t.borderRightWidth)+parseInt(t.paddingRight||0),n.height=e(t.borderBottomWidth)+parseInt(t.paddingBottom||0),n},mxGraph.prototype.getPreferredPageSize=function(e,t,n){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return t=this.pageBreaksVisible?Math.ceil(t/i.width):1,n=this.pageBreaksVisible?Math.ceil(n/i.height):1,new mxRectangle(0,0,t*i.width+2+a.x/e,n*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var t=this.getBorder(),n=Math.max(0,e.x+e.width+1+t);t=Math.max(0,e.y+e.height+1+t);if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),t=Math.max(t,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,t),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,n,t);null!=a&&(n=a.width,t=a.height)}null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),t=Math.max(t,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n-1),t=Math.ceil(t-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,n)+"px",a.style.minHeight=Math.max(1,t)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,t)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,t)+"px"),this.updatePageBreaks(this.pageBreaksVisible,n-1,t-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,t){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var n=this.getBorderSizes();e+=Math.max(2,n.x+n.width+1),t+=Math.max(2,n.y+n.height+1)}else 9<=document.documentMode?(e+=3,t+=5):(e+=1,t+=1);else t+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),t=Math.min(this.maximumContainerSize.height,t)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(t)+"px"},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((t-i.x)/i.width):0,e=e?Math.ceil((n-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,n)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(t,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var t=this.model.getStyle(e),n=null;n=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=t&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(t,n))),null==n&&(n=mxGraph.prototype.EMPTY_ARRAY),n},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var t=e[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(t);null!=n?e[mxConstants.STYLE_IMAGE]=n:n=t,null!=n&&"data:image/"==n.substring(0,11)&&(0<(t=n.indexOf(","))&&(n=n.substring(0,t)+";base64,"+n.substring(t+1)),e[mxConstants.STYLE_IMAGE]=n)}return e},mxGraph.prototype.setCellStyle=function(e,t){if(null!=(t=t||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setStyle(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,t,n){n=n||this.getSelectionCell(),this.toggleCellStyles(e,t,[n])},mxGraph.prototype.toggleCellStyles=function(e,t,n){var a;(t=null!=t&&t,null!=(n=n||this.getSelectionCells())&&0<n.length)&&(null!=(a=null!=(a=this.view.getState(n[0]))?a.style:this.getCellStyle(n[0]))&&(t=mxUtils.getValue(a,e,t)?0:1,this.setCellStyles(e,t,n)))},mxGraph.prototype.setCellStyles=function(e,t,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,e,t)},mxGraph.prototype.toggleCellStyleFlags=function(e,t,n){this.setCellStyleFlags(e,t,null,n)},mxGraph.prototype.setCellStyleFlags=function(e,t,n,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==n)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(n=(parseInt(i[e]||0)&t)!=t);mxUtils.setCellStyleFlags(this.model,a,e,t,n)}},mxGraph.prototype.alignCells=function(e,t,n){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){if(null==n)for(var a=0;a<t.length;a++){var i=this.getCellGeometry(t[a]);if(null!=i&&!this.model.isEdge(t[a]))if(null==n){if(e==mxConstants.ALIGN_CENTER){n=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)n=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)n=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){n=i.y+i.height/2;break}n=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else n=e==mxConstants.ALIGN_RIGHT?Math.max(n,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(n,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(n,i.y+i.height):Math.min(n,i.x)}if(null!=n){this.model.beginUpdate();try{for(a=0;a<t.length;a++)null!=(i=this.getCellGeometry(t[a]))&&!this.model.isEdge(t[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=n-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=n-i.width:e==mxConstants.ALIGN_TOP?i.y=n:e==mxConstants.ALIGN_MIDDLE?i.y=n-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=n-i.height:i.x=n,this.model.setGeometry(t[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",t))}finally{this.model.endUpdate()}}}return t},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var t=this.model.getStyle(e);null==t||0==t.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var t=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=e&&t.push(this.imageBundles[n]);this.imageBundles=t},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var t=0;t<this.imageBundles.length;t++){var n=this.imageBundles[t].getImage(e);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(e,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(t,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsOrdered=function(e,t){if(null!=e){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=this.model.getParent(e[n]);t?this.model.add(a,e[n],n):this.model.add(a,e[n],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",t,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,t,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==e&&(e=this.createGroupCell(n));var a=this.getBoundsForGroup(e,n,t);if(0<n.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(n,e,s,null,null,!1,!1),this.cellsMoved(n,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",t,"cells",n))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var t=[];if(null!=e&&0<e.length){var n=this.model.getParent(e[0]);t.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==n&&t.push(e[a])}return t},mxGraph.prototype.getBoundsForGroup=function(e,t,n){return null!=(t=this.getBoundingBoxFromGeometry(t))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),t.x-=e.width,t.y-=e.height,t.width+=e.width,t.height+=e.height),t.x-=n,t.y-=n,t.width+=2*n,t.height+=2*n),t},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var t=[];if(null==e){e=this.getSelectionCells();for(var n=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&n.push(e[a]);e=n}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),t=t.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var t=this.getDefaultParent(),n=this.model.getChildCount(t);this.cellsAdded(e,t,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,t,n){null==e&&(e=this.getSelectionCells()),t=null!=t?t:0,n=null!=n&&n,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();n&&(r.x+=s.x-o.width-t,r.y+=s.y-o.height-t),r.width=s.width+o.width+2*t,r.height=s.height+o.height+2*t,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+t,-s.y+o.height+t)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,t){t=null==t||t;var n=null;if(null!=e){for(var a={},i=(n=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],n.push(e[i])}if(0<n.length){var s=this.view.scale,o=this.view.translate;for(n=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!t&&this.model.isEdge(n[i])&&null!=this.getEdgeValidationError(n[i],this.model.getTerminal(n[i],!0),this.model.getTerminal(n[i],!1)))n[i]=null;else{var r=this.model.getGeometry(n[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(n[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else n=[]}return n},mxGraph.prototype.insertVertex=function(e,t,n,a,i,s,o,r,l){return t=this.createVertex(e,t,n,a,i,s,o,r,l),this.addCell(t,e)},mxGraph.prototype.createVertex=function(e,t,n,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(n=new mxCell(n,e,r)).setId(t),n.setVertex(!0),n.setConnectable(!0),n},mxGraph.prototype.insertEdge=function(e,t,n,a,i,s){return t=this.createEdge(e,t,n,a,i,s),this.addEdge(t,e,a,i)},mxGraph.prototype.createEdge=function(e,t,n,a,i,s){return(e=new mxCell(n,new mxGeometry,s)).setId(t),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,t,n,a,i){return this.addCell(e,t,i,n,a)},mxGraph.prototype.addCell=function(e,t,n,a,i){return this.addCells([e],t,n,a,i)[0]},mxGraph.prototype.addCells=function(e,t,n,a,i){null==t&&(t=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(t)),this.model.beginUpdate();try{this.cellsAdded(e,t,n,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",t,"index",n,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,t,n,a,i,s,o){if(null!=e&&null!=t&&null!=n){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(t):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])n--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=t&&t!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}t==c&&n+d>this.model.getChildCount(t)&&n--,this.model.add(t,e[d],n+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",t,"index",n,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,t){t=null==t||t,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),t&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var t=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/t-n.x,m[u].y/t-n.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,t,n,a,i){a=a||0,i=i||0,null==n&&(n=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(t,a,i,!1,!1),this.cellsAdded(t,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([n],s,this.model.getChildCount(s),o,t[0],!1),this.cellConnected(e,t[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",t,"newEdge",n,"dx",a,"dy",i))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(e,t,n){null==t&&(t=this.getSelectionCells()),n&&(t=this.addAllEdges(t)),this.model.beginUpdate();try{this.cellsToggled(t,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",t,"includeEdges",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsToggled=function(e,t){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setVisible(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,t,n,a){t=null!=t&&t,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,e,t,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",t,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(e,t,n,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],t))&&t!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],t),this.swapBounds(e[i],t),this.isExtendParent(e[i])&&this.extendParent(e[i]),n)){var s=this.model.getChildren(e[i]);this.foldCells(s,t,n)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",t,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,t){if(null!=e){var n=this.model.getGeometry(e);null!=n&&(n=n.clone(),this.updateAlternateBounds(e,n,t),n.swap(),this.model.setGeometry(e,n))}},mxGraph.prototype.updateAlternateBounds=function(e,t,n){if(null!=e&&null!=t){if(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e),null==t.alternateBounds){var a=t;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),t.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=t.alternateBounds){t.alternateBounds.x=t.x,t.alternateBounds.y=t.y;var i=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=t.alternateBounds.getCenterX()-t.getCenterX(),n=t.alternateBounds.getCenterY()-t.getCenterY(),a=Math.cos(i),i=Math.sin(i),t.alternateBounds.x+=a*e-i*n-e,t.alternateBounds.y+=i*e+a*n-n)}}},mxGraph.prototype.addAllEdges=function(e){var t=e.slice();return t.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var t=[];if(null!=e)for(var n=0;n<e.length;n++){for(var a=this.model.getEdgeCount(e[n]),i=0;i<a;i++)t.push(this.model.getEdgeAt(e[n],i));a=this.model.getChildren(e[n]),t=t.concat(this.getAllEdges(a))}return t},mxGraph.prototype.updateCellSize=function(e,t){t=null!=t&&t,this.model.beginUpdate();try{this.cellSizeUpdated(e,t),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,t){if(null!=e){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=n&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.height+8),i&&(a.height=n.height+8),a.width=n.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.width+8),i&&(a.width=n.width+8),a.height=n.height),this.model.setStyle(e,r)}else a.width=n.width,a.height=n.height;if(!t&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var t=null;if(null!=e){var n=this.view.getState(e),a=null!=n?n.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;t=0;null==this.getImage(n)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(t+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,t+=2*(a[mxConstants.STYLE_SPACING]||0),t+=a[mxConstants.STYLE_SPACING_TOP]||0,t+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(n=this.getFoldingImage(n))&&(s+=n.width+8),t=null!=(n=this.getLabel(e))&&0<n.length?(this.isHtmlLabel(e)||(n=n.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(n,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,t=i.height+t,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=t,t=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),t=this.snap(t+this.gridSize/2)),new mxRectangle(0,0,e,t)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return t},mxGraph.prototype.handleGesture=function(e,t){if(.2<Math.abs(1-t.scale)){var n=this.view.scale,a=this.view.translate,i=e.width*t.scale,s=e.height*t.scale,o=e.y-(s-e.height)/2;n=new mxRectangle(this.snap((e.x-(i-e.width)/2)/n)-a.x,this.snap(o/n)-a.y,this.snap(i/n),this.snap(s/n));this.resizeCell(e.cell,n)}},mxGraph.prototype.resizeCell=function(e,t){return this.resizeCells([e],[t])[0]},mxGraph.prototype.resizeCells=function(e,t){this.model.beginUpdate();try{this.cellsResized(e,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,t){if(null!=e&&null!=t&&e.length==t.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=t[n],i=this.model.getGeometry(e[n]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[n])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[n],i),this.isExtendParent(e[n])&&this.extendParent(e[n])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var t=this.model.getParent(e),n=this.model.getGeometry(t);null!=t&&null!=n&&!this.isCellCollapsed(t)&&(null!=(e=this.model.getGeometry(e))&&(n.width<e.x+e.width||n.height<e.y+e.height))&&((n=n.clone()).width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height),this.cellsResized([t],[n]))}},mxGraph.prototype.importCells=function(e,t,n,a,i){return this.moveCells(e,t,n,!0,a,i)},mxGraph.prototype.moveCells=function(e,t,n,a,i,s){if(t=null!=t?t:0,n=null!=n?n:0,a=null!=a&&a,null!=e&&(0!=t||0!=n||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,t,n,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",t,"dy",n,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,t,n,a,i){if(null!=e&&(0!=t||0!=n)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],t,n),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",n,"dy",n,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,t,n){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(t,n),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(t,n):(a.offset.x+=t,a.offset.y+=n)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var t=this.model.getParent(e);if(t==this.getDefaultParent()||t==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=t&&t!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(t))){var n=e=0,a=i.width,i=i.height;return this.isSwimlane(t)&&(e=(t=this.getStartSize(t)).width,a-=t.width,n=t.height,i-=t.height),new mxRectangle(e,n,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var t=this.model.getGeometry(e),n=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=t&&null!=n&&!t.relative&&(t.x<n.x||t.y<n.y||n.width<t.x+t.width||n.height<t.y+t.height)&&(e=this.getOverlap(e),0<n.width&&(t.x=Math.min(t.x,n.x+n.width-(1-e)*t.width)),0<n.height&&(t.y=Math.min(t.y,n.y+n.height-(1-e)*t.height)),t.x=Math.max(t.x,n.x-t.width*e),t.y=Math.max(t.y,n.y-t.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var t={},n=0;n<e.length;n++){var a=mxCellPath.create(e[n]);t[a]=e[n]}this.model.beginUpdate();try{for(n=0;n<e.length;n++){var i=this.model.getEdges(e[n]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==t[l]||null==t[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var t=this.model.getGeometry(e);return null!=t&&null!=t.points&&0<t.points.length&&((t=t.clone()).points=[],this.model.setGeometry(e,t)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,t){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,t,n){t=null;var a=e.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(t=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=t&&(a=mxUtils.getValue(e.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(t,a)},mxGraph.prototype.setConnectionConstraint=function(e,t,n,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,t){var n=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=t.point){var l=n=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(n=-1,d=-a.width),u&&(l=-1,c=-a.height)}n=new mxPoint(a.x+t.point.x*a.width*n-d,a.y+t.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,t.perimeter?(0!=o&&null!=n&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),n=mxUtils.getRotatedPoint(n,a,r,i)),null!=n&&t.perimeter&&(n=this.view.getPerimeterPoint(e,n,!1))):s+=o,0!=s&&null!=n&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),n=mxUtils.getRotatedPoint(n,a,r,i))}return n},mxGraph.prototype.connectCell=function(e,t,n,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.cellConnected(e,t,n,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,t,n,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.setConnectionConstraint(e,t,n,a),this.isPortsEnabled()&&(a=null,this.isPort(t)&&(a=t.getId(),t=this.getTerminalForPort(t,n)),this.setCellStyles(n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,t,n),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var t=this.view.scale,n=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/t-n.x+l,c[0].y/t-n.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/t-n.x+l,c[v].y/t-n.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,t){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),t=this.getCurrentRoot();if(null!=t){for(var n=this.model.getParent(t);n!=e&&!this.isValidRoot(n)&&this.model.getParent(n)!=e;)n=this.model.getParent(n);n==e||this.model.getParent(n)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(t)&&this.setSelectionCell(t)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,t,n){var a=[e];if(t&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),n){n=this.model.getChildCount(e);for(var i=0;i<n;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),t,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,t){t=null!=t&&t;var n=null;if(null!=e)for(var a=0;a<e.length;a++)if(t||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i)}}return n},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,t){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-t;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==t){if(mxClient.IS_IE?n.setAttribute("transform","translate("+e+","+t+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+e+","+t+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=n.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,n.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=t+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=t+"px"}else n.style.left=e+"px",n.style.top=t+"px";this.panDx=e,this.panDy=t,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,t){this.zoom(e/this.view.scale,t)},mxGraph.prototype.zoom=function(e,t){t=null!=t?t:this.centerZoom;var n=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=n,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(n));else if(t&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*n);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(n,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(n),mxUtils.hasScrollbars(this.container)&&(i=a=0,t&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var t=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var n=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=n-e.x,e.height=a-e.y,t<1?(n=((t=e.height/t)-e.height)/2,e.height=t,t=Math.min(e.y,n),e.y-=t,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(n=((t*=e.width)-e.width)/2,e.width=t,t=Math.min(e.x,n),e.x-=t,n=Math.min(this.container.scrollWidth,e.x+e.width),e.width=n-e.x),t=this.container.clientWidth/e.width,n=this.view.scale*t,mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),this.container.scrollLeft=Math.round(e.x*t),this.container.scrollTop=Math.round(e.y*t)):this.view.scaleAndTranslate(n,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,t){if(null!=this.container){e=null!=e?e:0,t=null!=t&&t;var n=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();t&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=t?e:2*e;n=Math.floor(100*Math.min(n/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(n=Math.max(n,this.minFitScale)),null!=this.maxFitScale&&(n=Math.min(n,this.maxFitScale)),t?this.view.scale!=n&&this.view.setScale(n):mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*n-e-Math.max(0,(this.container.clientWidth-o*n)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*n-e-Math.max(0,(this.container.clientHeight-r*n)/2))):this.view.scaleAndTranslate(n,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,t){var n=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(n=new mxRectangle(n+i.x,a+i.y,i.width,i.height),t&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,n.x=n.getCenterX()-a/2,n.width=a,n.y=n.getCenterY()-i/2,n.height=i),this.scrollRectToVisible(n)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var t=!1;if(null!=e){var n=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(n,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){n=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=n.scrollLeft-e.x;a=Math.max(o-n.scrollLeft,0);0<o?n.scrollLeft-=o+2:0<(o=e.x+i-n.scrollLeft-n.clientWidth)&&(n.scrollLeft+=o+2),i=n.scrollTop-e.y,o=Math.max(0,i-n.scrollTop),0<i?n.scrollTop-=i+2:0<(i=e.y+s-n.scrollTop-n.clientHeight)&&(n.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+n&&(this.view.translate.x-=(e.x+i-n-o)/l,t=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,t=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,t=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,t=!0),t&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return t},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var t=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=t?t:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var t=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=t&&t==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,t,n){return null==this.getEdgeValidationError(e,t,n)},mxGraph.prototype.getEdgeValidationError=function(e,t,n){if(null!=e&&!this.isAllowDanglingEdges()&&(null==t||null==n))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&t==n&&null!=t||!this.isValidConnection(t,n))return"";if(null==t||null==n)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(t,n,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(t,!0,e),s=this.model.getDirectedEdgeCount(n,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,t,n,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,t,n))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,t,n){return null},mxGraph.prototype.validateGraph=function(e,t){e=null!=e?e:this.model.getRoot(),t=null!=t?t:{};for(var n=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=t;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),n=n&&null==o}return a="",this.isCellCollapsed(e)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,t))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!n?a:null},mxGraph.prototype.getCellValidationError=function(e){var t=this.model.getDirectedEdgeCount(e,!0),n=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,t){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var t=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!t))return t?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var t="";if(this.labelsVisible&&null!=e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(t=this.convertValueToString(e))}return t},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,n,t,a){var i=null;return null!=e&&(null==e.control||n!=e.control.node&&n.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,t){null!=i||n!=t.node&&n.parentNode!=t.node||(i=t.overlay.toString())}),null==i&&(null!=(t=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof t.getTooltipForNode&&(i=t.getTooltipForNode(n))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var t=new mxRectangle,n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&(n=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?t.height=n:t.width=n),t},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var t;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var t=this.model.getGeometry(e);return this.isCellsLocked()||null!=t&&this.model.isVertex(e)&&t.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,t){return!0},mxGraph.prototype.isCellBendable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,t,n){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,t){return this.isValidSource(e)&&this.isValidTarget(t)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var t=this.cellEditor.getEditingCell();return null==e?null!=t:e==t},mxGraph.prototype.isAutoSizeCell=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,t){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,t)}))},mxGraph.prototype.isCellFoldable=function(e,t){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,t,n){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,t,n)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,t,n){return!(!this.model.isEdge(e)||null==t||1!=t.length||!this.isCellConnectable(t[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),t[0]))&&(n=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(t[0],n)&&!this.model.isAncestor(t[0],e))},mxGraph.prototype.getDropTarget=function(e,t,n){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==n)n=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=n;)i=this.model.getParent(i);i==n&&(n=a)}for(;null!=n&&!this.isValidDropTarget(n,e,t)&&!this.model.isLayer(n);)n=this.model.getParent(n);return!this.model.isLayer(n)&&mxUtils.indexOf(e,n)<0?n:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,t,n){if(null!=(n=n||this.getDefaultParent()))for(var a=this.model.getChildCount(n),i=0;i<a;i++){var s=this.model.getChildAt(n,i),o=this.getSwimlaneAt(e,t,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,t)))return s}return null},mxGraph.prototype.getCellAt=function(e,t,n,a,i){if(a=null==a||a,i=null==i||i,null!=(n=null!=n?n:this.getDefaultParent()))for(var s=this.model.getChildCount(n)-1;0<=s;s--){var o=this.model.getChildAt(n,s),r=this.getCellAt(e,t,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,t)))return o}return null},mxGraph.prototype.intersects=function(e,t,n){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,t,n)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),t=(i=mxUtils.getRotatedPoint(new mxPoint(t,n),a,i,s)).x,n=i.y),mxUtils.contains(e,t,n))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,t,n){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(t-=a.x,n-=a.y,0<e.width&&0<t&&t>e.width*i||0<e.height&&0<n&&n>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,t,n){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=t&&t,null!=n&&n),t=[],n=0;n<e.length;n++)this.isCellVisible(e[n])&&t.push(e[n]);return t},mxGraph.prototype.getConnections=function(e,t){return this.getEdges(e,t,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,t){return this.getEdges(e,t,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,t){return this.getEdges(e,t,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,t,n,a,i,s){n=null==n||n,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,n,a)))}for(o=o.concat(this.model.getEdges(e,n,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(n&&c==e&&(null==t||this.isValidAncestor(l,t,s))||a&&l==e&&(null==t||this.isValidAncestor(c,t,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,t,n){return n?this.model.isAncestor(t,e):this.model.getParent(e)==t},mxGraph.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==t&&null!=l&&l!=t&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==t&&null!=r&&r!=t&&n&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==t||!n&&o==t&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=t?this.gridSize/2:0;return n.x=this.snap(n.x/a-i.x-s),n.y=this.snap(n.y/a-i.y-s),n},mxGraph.prototype.getCells=function(e,t,n,a,i,s){if(s=null!=s?s:[],0<n||0<a){var o=e+n,r=t+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=t&&u.x+u.width<=o?s.push(c):this.getCells(e,t,n,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,t,n,a,i){var s=[];if((a||i)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),r=0;r<o;r++){var l=this.model.getChildAt(n,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=t)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,t,n){t=null!=t&&t,n=null!=n&&n;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,t?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(n&&0==m&&0<u||!n&&0==u&&0<m)&&a.push(d),r<(c=n?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=n(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;t&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,t,n,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,t){var n=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(n,t),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,t,n){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!t||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&n?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(t=i.getIndex(a),e=e?(t++,this.model.getChildAt(i,t%s)):(t--,this.model.getChildAt(i,t<0?s-1:t)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(t,n,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&t||this.model.isEdge(e)&&n)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,t){var n=this.isCellSelected(e);this.isToggleEvent(t)?n?this.removeSelectionCell(e):this.addSelectionCell(e):(!n||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,t){this.isToggleEvent(t)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var t=null;return null!=e&&(t=this.model.isEdge(e.cell)?(t=this.view.getEdgeStyle(e),this.isLoop(e)||t==mxEdgeStyle.ElbowConnector||t==mxEdgeStyle.SideToSide||t==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):t==mxEdgeStyle.SegmentConnector||t==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),t},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var t=0;t<this.mouseListeners.length;t++)if(this.mouseListeners[t]==e){this.mouseListeners.splice(t,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var t=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=t.x-this.panDx,e.graphY=t.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,t,n){if(null==n&&(n=this),this.updateMouseEvent(t),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-t.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-t.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(t.getEvent(),t.getCell()),t.getEvent().cancelBubble=!0):(this.lastTouchX=t.getX(),this.lastTouchY=t.getY(),this.lastTouchTime=a)}if(a=2!=t.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-t.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-t.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=t.getX(),this.lastMouseY=t.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||t.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(t.getGraphX(),t.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(n=[n,t],t.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,n):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,n):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,n)}e==mxEvent.MOUSE_UP&&this.click(t)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var t=e.view.graph.getModel().isEdge(e.cell),n=e.view.scale,a=null,i=this.image.width,s=this.image.height;return t?a=1==(t=e.absolutePoints).length%2?t[Math.floor(t.length/2)]:(e=t[(a=t.length/2)-1],t=t[a],new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*n),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*n),i*n,s*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var t=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&t.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,t){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var t=this.source.view.scale,n=new mxRectangle((n=this.source.getGraphBounds()).x/t+this.source.panDx,n.y/t+this.source.panDy,n.width/t,n.height/t),a=new mxRectangle(0,0,this.source.container.clientWidth/t,this.source.container.clientHeight/t);(s=n.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/t,s.width),t=Math.max(i.height/t,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/t))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(t=this.source.view.translate).x+this.source.panDx;var o=t.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),n.x<0&&(i-=n.x),n.y<0&&(o-=n.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);n=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((n.x-t.x-this.source.panDx)/o,(n.y-t.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(n=this.selectionBorder.bounds).x==this.bounds.x&&n.y==this.bounds.y&&n.width==this.bounds.width&&n.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),n=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-n.width/2,this.bounds.y+this.bounds.height-n.height/2,n.width,n.height),n.x==a.x&&n.y==a.y&&n.width==a.width&&n.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,t){this.enabled&&this.showViewport&&(this.zoom=t.isSource(this.sizer),this.startX=t.getX(),this.startY=t.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),t.consume()},mxOutline.prototype.mouseMove=function(e,t){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=t.getX()-this.startX,a=t.getY()-this.startY,i=null;if(this.zoom)a=n/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+n,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),n=n/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-n-this.dx0,-a-this.dy0)}n=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-n.width/2,i.y+i.height-n.height/2,n.width,n.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),t.consume()}},mxOutline.prototype.mouseUp=function(e,t){if(this.active){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(0<Math.abs(n)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-n*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),n/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-n,i.y-a));this.update(),t.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,t,n,a,i,s){var o="";return(this.source&&this.checkTerminal(e,n,t)||!this.source&&this.checkTerminal(e,a,t))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,t,n,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,t,n,a){t=e.model.getValue(n),a=e.model.getValue(a),n=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){n=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,t,i[s])){n=this.validNeighborsAllowed;break}}return n},mxMultiplicity.prototype.checkTerminal=function(e,t,n){return t=e.model.getValue(t),this.checkType(e,t,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,t,n,a,i){return null!=t&&(isNaN(t.nodeType)?t==n:mxUtils.isNode(t,n,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var t=this.graph.getModel();t.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((t=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var t=this.getGraph().getModel();if(this.isBubbling())for(var n=t.getParents(e);0<n.length;)e=e.concat(n),n=t.getParents(n);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,t){if(null!=e&&null!=t)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],n.x,n.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var t=[],n={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==n[o]&&(n[o]=i[s],t.push(i[s]))}}return t},mxLayoutManager.prototype.getCellsForChange=function(e){var t=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,t.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,t.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=null,a=0;a<e.length;a++)e[a]!=t.getRoot()&&e[a]!=n&&(n=e[a],this.executeLayout(this.getLayout(n),n));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{t.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,t){null!=e&&null!=t&&e.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isCellIgnored(e[n])){this.cellResized(e[n]);break}}finally{t.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var t=this.getGraph(),n=t.getView(),a=t.getModel(),i=n.getState(e),s=n.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=n.translate,d=n.scale,c=(n=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+n-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,n,s,l,c,p,i,this.isExtendParents()&&t.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,t,n,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-t,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-n);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var t=this.getGraph(),n=t.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return t.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),n,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var t=this.graph.view.getState(e);return e=null!=t?t.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)this.isSwimlaneIgnored(e[n])||this.swimlaneAdded(e[n])}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var t=this.getGraph().getModel(),n=t.getParent(e),a=t.getChildCount(n),i=null,s=0;s<a;s++){var o=t.getChildAt(n,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=t.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isSwimlaneIgnored(e[n])){var a=t.getGeometry(e[n]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[n];null!=s;){var o=s,r=(s=t.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,t,n){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=n||!i&&r.width!=t)&&(r=r.clone(),i?r.height=n:r.width=t,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;t-=s.width,n-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,t,n)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,t,n,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(t,n),this.deltas[s]=o,this.count++):a?(o.X+=t,o.Y+=n):(o.X=t,o.Y=n),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var t,n=this.graph.getModel(),a=n.getRoot();for(t in this.deltas){var i=mxCellPath.resolve(a,t),s=this.graph.view.getState(i),o=this.deltas[t];i=this.graph.view.getState(n.getParent(i));this.translateState(i,s,o.x,o.y)}for(t in this.deltas)i=mxCellPath.resolve(a,t),s=this.graph.view.getState(i),o=this.deltas[t],i=this.graph.view.getState(n.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,t,n,a){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.invalid=!0,this.graph.view.validateBounds(e,t.cell),e=i.getGeometry(t.cell);var s=mxCellPath.create(t.cell);0==n&&0==a||null==e||e.relative&&null==this.deltas[s]||(t.x+=n,t.y+=a)}for(e=i.getChildCount(t.cell),s=0;s<e;s++)this.translateState(t,this.graph.view.getState(i.getChildAt(t.cell,s)),n,a)}},mxCellStatePreview.prototype.revalidateState=function(e,t,n,a,i){if(null!=t){t.invalid=!0,this.graph.view.validatePoints(e,t.cell);var s=mxCellPath.create(t.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(t.cell);for(0==n&&0==a||null==r||!r.relative||!o.isVertex(t.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(t.x+=n,t.y+=a,this.graph.cellRenderer.redraw(t)),null!=i&&i(t),e=o.getChildCount(t.cell),s=0;s<e;s++)this.revalidateState(t,this.graph.view.getState(o.getChildAt(t.cell,s)),n,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var t=this.graph.getModel(),n=t.getEdgeCount(e.cell),a=0;a<n;a++){var i=this.graph.view.getState(t.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&null!=t.getState()){var n=this.getInitialCellForEvent(t);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(n),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,t.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(n);this.graph.isCellMovable(n)&&(!a.isEdge(n)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(n,!0)||null==a.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(t.getEvent())&&this.graph.isCellsCloneable())&&this.start(n,t.getX(),t.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=t.getSource().nodeName?t.consume():mxClient.IS_SF&&"SELECT"==t.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),t=this.graph.getModel(),n=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&t.isVertex(e)&&null!=t.getGeometry(e)&&!t.getGeometry(e).relative});return this.graph.view.getCellStates(t.filterDescendants(n,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;n.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==t?t=new mxRectangle(s.x,s.y,s.width,s.height):t.add(s)}}return t},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,t,n){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,t,n),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var t=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/t)*t,e.y=this.graph.snap(e.y/t)*t,e},mxGraphHandler.prototype.mouseMove=function(e,t){var n=this.graph;if(!t.isConsumed()&&n.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(n.container,t.getX(),t.getY())).x-this.first.x,i=s.y-this.first.y,s=n.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=n.isGridEnabledEvent(t.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(t))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=n.getView().translate,l=n.getView().scale;o=this.bounds.x-(n.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(n.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),n.isConstrainedEvent(t.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=t.getCell(),n.isDropEnabled()&&this.highlightEnabled&&(s=n.getDropTarget(this.cells,t.getEvent(),i)),o=s,r=n.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=n.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&(null!=(a=n.getView().getState(i))&&(n=null==n.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(n),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}t.consume(),mxEvent.consume(t.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||t.isConsumed()||null==t.getState()||n.isMouseDown||(null==(a=n.getCursorForCell(t.getCell()))&&n.isEnabled()&&n.isCellMovable(t.getCell())&&(a=n.getModel().isEdge(t.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),t.getState().setCursor(a),t.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()){var n=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=n.getView().scale,i=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,t.getCell());this.connectOnDrop&&null==this.target&&null!=o&&n.getModel().isVertex(o)&&n.isCellConnectable(o)&&n.isEdgeValid(null,this.cell,o)?n.connectionHandler.connect(this.cell,o,t.getEvent()):(o=this.target,n.isSplitEnabled()&&n.isSplitTarget(o,this.cells,t.getEvent())?n.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,t.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(t)}this.cellWasClicked&&t.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());n=mxUtils.getRotatedPoint(n,t,a,i)}return null!=e&&!mxUtils.contains(e,n.x,n.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,t,n,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,t-this.graph.panDx/this.graph.view.scale,n-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(t)||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)},mxPanningHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var n=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());this.triggerX=n.x,this.triggerY=n.y,this.popupTrigger=this.isPopupTrigger(t),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(t),this.startX=t.getX(),this.startY=t.getY(),this.panningTrigger&&this.consumePanningTrigger(t)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,t){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a)),this.graph.panGraph(n+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",t)),t.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(n)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",t))}},mxPanningHandler.prototype.mouseUp=function(e,t){var n=Math.abs(t.getX()-this.startX),a=Math.abs(t.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){n=t.getX()-this.startX,a=t.getY()-this.startY,this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+n/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",t)),t.consume()}else this.popupTrigger&&n<this.graph.tolerance&&a<this.graph.tolerance&&(n=this.getCellForPopupEvent(t),this.graph.isEnabled()&&this.selectOnPopup&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(t.getX()+a.x,t.getY()+a.y),this.popup(a.x+1,a.y+1,n,t.getEvent()),t.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,t){this.graph.getView().setTranslate(e,t)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var t=null;if(this.isEnabled()){var n=null!=(t=this.getState(e))&&this.isValidState(t);e=this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return t},mxCellMarker.prototype.markCell=function(e,t){var n=this.graph.getView().getState(e);null!=n&&(this.currentColor=null!=t?t:this.validColor,this.markedState=n,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,t,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var t=this.graph.getView();return cell=this.getCell(e),null!=(t=this.getStateToMark(t.getState(cell)))&&this.intersects(t,e)?t:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,t){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,t.getGraphX(),t.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,t){t.reset.apply(t)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var t=this.graph.getSelectionCells(),n=0;n<t.length;n++){var a=this.graph.view.getState(t[n]);if(null!=a){var i=e.remove(t[n]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(t[n],i)}}e.visit(mxUtils.bind(this,function(e,t){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",t.state)),t.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseDown.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseMove.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseUp.apply(t,n)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var t=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,t)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,t){return t=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(t)?(null!=t?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,t),null!=this.error&&0==this.error.length&&(t=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(t)||(t=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),t):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,t,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,t){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,t,n,a){this.previous=e,this.first=new mxPoint(t,n),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,t){return this.isValidTarget(t)?this.graph.getEdgeValidationError(null,e,t):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var t=[],n=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);n.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(n.dialect=mxConstants.DIALECT_STRICTHTML,n.init(this.graph.container)):(n.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=n.node.previousSibling&&n.node.parentNode.insertBefore(n.node,n.node.parentNode.firstChild)),n.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=n,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(n.node,this.graph,a,i),t.push(n),this.redrawIcons(t,this.iconState),t},mxConnectionHandler.prototype.redrawIcons=function(e,t){if(null!=e&&null!=e[0]&&null!=t){var n=this.getIconPosition(e[0],t);e[0].bounds.x=n.x,e[0].bounds.y=n.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,t){var n=this.graph.getView().scale,a=t.getCenterX(),i=t.getCenterY();if(this.graph.isSwimlane(t.cell)){a=0!=(s=this.graph.getStartSize(t.cell)).width?t.x+s.width*n/2:a,i=0!=s.height?t.y+s.height*n/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(s);var s=Math.sin(s),o=new mxPoint(t.getCenterX(),t.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),n,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var t=0;t<e.length;t++)e[t].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,t){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!t.isConsumed()&&!this.isConnecting()&&this.isStartEvent(t)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.edgeState=this.createEdgeState(t),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(t.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),t.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=t.getX(),this.initialTouchY=t.getY();var a=this.graph.view.getState(this.marker.getCell(t));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(t,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,t){null!=t&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=t,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var t=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=t},mxConnectionHandler.prototype.convertWaypoint=function(e){var t=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();e.x=e.x/t-n.x,e.y=e.y/t-n.y},mxConnectionHandler.prototype.mouseMove=function(e,t){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-t.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-t.getY())<this.tapAndHoldTolerance),t.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(t),null!=this.first){var n=this.graph.getView().scale,a=null,i=n=new mxPoint(this.graph.snap(t.getGraphX()/n)*n,this.graph.snap(t.getGraphY()/n)*n);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(t.getGraphX()+this.connectIconOffset.x,t.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,t))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,t))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(n.x-this.first.x),o=Math.abs(n.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(t)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(n=[s],null!=this.waypoints&&(n=n.concat(this.waypoints)),n.push(i),this.shape.points=n),this.drawPreview()),mxEvent.consume(t.getEvent()),t.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),t.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&t.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(n=!1,s=t.getSource(),i=0;i<this.icons.length&&!n;i++)n=s==this.icons[i].node||s.parentNode==this.icons[i].node;n||this.updateIcons(this.currentState,this.icons,t)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,t){var n=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(n=i)}else n=new mxPoint(e.getCenterX(),e.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,t,n){n=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(t=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,t,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),n=e)}else n=s;return n},mxConnectionHandler.prototype.updateIcons=function(e,t,n){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var t=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),n=Math.abs(t.x-this.first.x);t=Math.abs(t.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||t>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),n=this.graph.view.scale,t=new mxPoint(this.graph.snap(e.getGraphX()/n)*n,this.graph.snap(e.getGraphY()/n)*n),this.waypoints.push(t))},mxConnectionHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(t))return this.addWaypointForEvent(t),void t.consume();if(null==this.error){var n=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(n,a,t.getEvent(),t.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),t.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,t,n,a){if(null!=t||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==t&&this.isCreateTarget()&&null!=(t=this.createTargetVertex(n,e))){if(null!=(a=this.graph.getDropTarget([t],n,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(t);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(t,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=t&&i.getParent(e)==i.getParent(t)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=t.geometry&&t.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,t,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,t,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==t&&((u=this.graph.getPointForEvent(n,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",n,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,t)}},mxConnectionHandler.prototype.selectCells=function(e,t){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,t,n,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,t,n,a,i,s):(t=this.createEdge(n,a,i,s),this.graph.addEdge(t,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,t){for(var n=this.graph.getCellGeometry(t);null!=n&&n.relative;)t=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t);var a=this.graph.cloneCells([t])[0];if(null!=(n=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(n.x=this.graph.snap(i.x-n.width/2)-this.graph.panDx/this.graph.view.scale,n.y=this.graph.snap(i.y-n.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(t);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?n.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(n.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,t,n,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(t,n,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,t,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,t){return!1},mxConstraintHandler.prototype.update=function(e,t){if(this.isEnabled()&&!this.isEventIgnored(e)){var n=this.getTolerance(),a=new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),t):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(n)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(n=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(n.width-=1,n.height-=1),null==this.focusHighlight?((n=new mxRectangleShape(n,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.focusHighlight=n,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(n.node,this.graph,r)):(this.focusHighlight.bounds=n,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(t.getEvent())||null==t.getState())){var n=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=n.x,a.y-=n.y,this.start(t.getX()+a.x,t.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var t=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=t.x,e.graphY=t.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}t.consume(!1)}},mxRubberband.prototype.start=function(e,t){this.first=new mxPoint(e,t)},mxRubberband.prototype.mouseMove=function(e,t){if(!t.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);n.x-=a.x,n.y-=a.y;a=t.getX()+n.x,n=t.getY()+n.y;var i=this.first.x-a,s=this.first.y-n,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,n),t.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,t){var n=null!=this.div;this.reset(),n&&(n=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(n,t.getEvent()),t.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,t){this.currentX=e,this.currentY=t,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,t=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,t),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,t)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var t=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",t++)),this.sizers.push(this.createSizer("n-resize",t++)),this.sizers.push(this.createSizer("ne-resize",t++)),this.sizers.push(this.createSizer("w-resize",t++)),this.sizers.push(this.createSizer("e-resize",t++)),this.sizers.push(this.createSizer("sw-resize",t++)),this.sizers.push(this.createSizer("s-resize",t++))),this.sizers.push(this.createSizer("se-resize",t++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,t,n,a){return n=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),(a=this.createSizerShape(n,t,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(t)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,t,n){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):t==mxEvent.ROTATION_HANDLE?new mxEllipse(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,t,n){null!=e&&(e.bounds.x=Math.round(t-e.bounds.width/2),e.bounds.y=Math.round(n-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.sizers.length;n++)if(e.isSource(this.sizers[n])||null!=t&&mxUtils.intersects(this.sizers[n].bounds,t))return n;return null},mxVertexHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(0<this.tolerance||t.getState()==this.state)){var n=this.getHandleForEvent(t);null!=n&&(this.start(t.getX(),t.getY(),n),t.consume())}},mxVertexHandler.prototype.start=function(e,t,n){e=mxUtils.convertPoint(this.graph.container,e,t),this.startX=e.x,this.startY=e.y,this.index=n,this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,t){if(t.isConsumed()||null==this.index)null!=this.getHandleForEvent(t)&&t.consume(!1);else{var n=new mxPoint(t.getGraphX(),t.getGraphY()),a=this.graph.isGridEnabledEvent(t.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(n.x=this.graph.snap(n.x/i)*i,n.y=this.graph.snap(n.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],n.x,n.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-n.x,o=this.state.y+this.state.height/2-n.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=n.x-this.state.getCenterX(),o=n.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=n.x-this.startX,o=n.y-this.startY,n=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,n),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}t.consume()}},mxVertexHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&null!=this.index&&null!=this.state){var n=new mxPoint(t.getGraphX(),t.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(t.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(n=o*(r=n.x-this.startX)+s*(l=n.y-this.startY),s*r-o*l),l=n,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),t.consume()}},mxVertexHandler.prototype.rotateCell=function(e,t){var n=this.graph.getModel();if(n.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+t,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=t){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(t),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,n.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,n.setGeometry(e,s);for(s=n.getChildCount(e),a=0;a<s;a++)this.rotateCell(n.getChildAt(e,a),t)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,t,n,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,t=(this.labelShape.bounds.getCenterX()-this.startX)/a,n=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(t,n):(s.offset.x+=t,s.offset.y+=n),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,t,n,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){t=a.getCenterX()-s.getCenterX(),n=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*t-o*n-t;t=o*t+i*n-n,n=a.x-s.x;var l=a.y-s.y,d=i*n-o*l;i=o*n+i*l,a.x+=r,a.y+=t,this.graph.isCellCollapsed(e)||0==r&&0==t||(n=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,n,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,t,n){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=t,r.y+=n,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,t,n,a,i,s,o){if(this.singleSizer){o=e.x+e.width+t;var r=e.y+e.height+n;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=n,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=n,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=t,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=t,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var t=e.x+e.width,n=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],t,n);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=t,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=t,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=t,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var t=this.state.cell;if(null!=this.index){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.graph.getCellAt(n.x,n.y);this.graph.isSwimlane(t)&&this.graph.hitsSwimlaneContent(t,n.x,n.y)&&(t=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(t)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var t=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(t))return null;var n=a.graph.getModel();return(t==a.state.cell||null!=t&&!a.graph.connectableEdges&&n.isEdge(t))&&(t=null),t},e.isValidState=function(e){var t=a.graph.getModel();t=null!=(t=a.graph.view.getTerminalPort(e,a.graph.view.getState(t.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?t.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:t,a.isSource?t:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,t){return this.graph.getEdgeValidationError(this.state.cell,e,t)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,t=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var a=n==this.abspoints.length-1;if((a=0==n||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(n);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(n))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);t.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return t},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.bends.length;n++)if((e.isSource(this.bends[n])||null!=t&&mxUtils.intersects(this.bends[n].bounds,t))&&"hidden"!=this.bends[n].node.style.visibility)return n;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,t){var n=null;null!=(n=this.getHandleForEvent(t))&&!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(t.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(t.getCell()))&&this.start(t.getX(),t.getY(),n),t.consume())},mxEdgeHandler.prototype.start=function(e,t,n){this.startX=e,this.startY=t,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(t=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=t&&this.graph.isCellDisconnectable(e,t,this.isSource))&&(this.index=n)):this.index=n},mxEdgeHandler.prototype.clonePreviewState=function(e,t){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var n=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),t=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var t=e.x;Math.abs(n.x-t)<a&&(n.x=t,i=!0),e=e.y,Math.abs(n.y-e)<a&&(n.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(t.getRoutingCenterX(e),t.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=t.scale,r=t.translate,i||(n.x=(this.graph.snap(n.x/e-r.x)+r.x)*e),s||(n.y=(this.graph.snap(n.y/e-r.y)+r.y)*e)),n},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var t=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?t=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(t=this.constraintHandler.currentFocus),t},mxEdgeHandler.prototype.getPreviewPoints=function(e){var t=null!=(t=this.graph.getCellGeometry(this.state.cell)).points?t.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(t=null):(this.convertPoint(e,!1),null==t?t=[e]:t[this.index-1]=e),t},mxEdgeHandler.prototype.updatePreviewState=function(e,t,n){var a=this.isSource?n:this.state.getVisibleTerminalState(!0),i=this.isTarget?n:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==n&&(e.setAbsoluteTerminalPoint(t,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.getPointForEvent(t);if(this.isLabel)this.label.x=n.x,this.label.y=n.y;else{this.points=this.getPreviewPoints(n);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(t):null,i=this.clonePreviewState(n,null!=a?a.cell:null);this.updatePreviewState(i,n,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(t.getEvent()),t.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(t)&&t.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.state.cell;if(t.getX()!=this.startX||t.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)n=this.connect(n,a,this.isSource,this.graph.isCloneEvent(t.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),t);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(n,a,this.isSource)}}else this.active?this.changePoints(n,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),t.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x),e.y=Math.round(e.y/n-a.y),null!=(n=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=n.origin.x,e.y-=n.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,t,n){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,t,n);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((t-s.x)/o,(n-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,t,n,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!n);this.graph.connectCell(o,r,!n),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,t,n,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(t,n),a.setGeometry(e,i),this.graph.connectCell(e,null,n,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,t){var n=this.graph.getModel(),a=n.getGeometry(e);null!=a&&((a=a.clone()).points=t,n.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,t){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.graph.isGridEnabledEvent(t);this.convertPoint(n,a),this.addPointAt(e,n.x,n.y),mxEvent.consume(t)},mxEdgeHandler.prototype.addPointAt=function(e,t,n){var a=this.graph.getCellGeometry(e.cell);if(t=new mxPoint(t,n),null!=a){a=a.clone(),n=this.graph.view.translate;var i=this.graph.view.scale;n=mxUtils.findNearestSegment(e,(t.x+n.x)*i,(t.y+n.y)*i),null==a.points?a.points=[t]:a.points.splice(n,0,t),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,t){if(0<t&&t<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(t-1,1),this.graph.getModel().setGeometry(e.cell,n),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var t=this.state.cell,n=this.graph.getModel().getTerminal(t,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=n&&!this.graph.isCellDisconnectable(t,n,e)||null==n&&!this.graph.isTerminalPointMovable(t,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=n&&this.graph.isCellDisconnectable(t,n,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,t=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-t/2),Math.round(this.label.y-t/2),t,t),this.labelShape.redraw(),null!=(t=this.graph.getLabel(e))&&0<t.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var n=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);t=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-t.width/2),Math.round(a-t.height/2),t.width,t.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[n];var i=this.abspoints[n].x,s=(n=this.abspoints[n].y,this.bends.length-1);t=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-t.width/2),Math.round(n-t.height/2),t.width,t.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=n){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=n[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);return this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),t=this.createHandleShape(2),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var t=this.getCursorForBend();return e.node.style.cursor=t,t=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,t),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var t=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(t=this.doubleClickOrientationResource,t=mxResources.get(t)||t),t},mxElbowEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x-i.x),e.y=Math.round(e.y/n-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=null==(n=null!=(n=this.graph.getModel().getGeometry(this.state.cell).points)?n[0]:null)?new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2):new mxPoint(this.graph.getView().scale*(n.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(n.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var t=this.state.absolutePoints,n=t[0].clone();this.convertPoint(n,!1);for(var a=[],i=1;i<t.length;i++){var s=t[i].clone();this.convertPoint(s,!1),i==this.index&&(n.x==s.x?(n.x=e.x,s.x=e.x):(n.y=e.y,s.y=e.y)),i<t.length-1&&a.push(s),n=s}if(1==a.length){if(n=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?t[1].y==t[2].y?a[0].y=n.getRoutingCenterY(i)-r:a[0].x=n.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(t[1].y==t[0].y?a[0].y=n.getRoutingCenterY(s)-r:a[0].x=n.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none");var n=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<n.length-1;a++)t=this.createVirtualBend(),e.push(t),t.node.style.cursor=0==n[a].x-n[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")}return t=this.createHandleShape(n.length),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,t){if(this.graph.isCellBendable(this.state.cell)){var n=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],t=a[i+1];var s=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-n/2),Math.round(s.y-n/2),n,n),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,t){t=[];var n=this.abspoints;if(1<n.length)for(var a=n[0],i=n[1],s=2;s<n.length;s++){var o=n[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),t.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,t){this.normalKeys[e]=t},mxKeyHandler.prototype.bindShiftKey=function(e,t){this.shiftKeys[e]=t},mxKeyHandler.prototype.bindControlKey=function(e,t){this.controlKeys[e]=t},mxKeyHandler.prototype.bindControlShiftKey=function(e,t){this.controlShiftKeys[e]=t},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var t=this.getFunction(e);null!=t&&(t(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,t){this.reset(t,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,t){t.getX()==this.lastX&&t.getY()==this.lastY||(this.reset(t,!0),(this.isHideOnHover()||t.getState()!=this.state||t.getSource()!=this.node&&(!this.stateSource||null!=t.getState()&&this.stateSource==(t.isSource(t.getState().shape)||!t.isSource(t.getState().text))))&&this.hideTooltip()),this.lastX=t.getX(),this.lastY=t.getY()},mxTooltipHandler.prototype.mouseUp=function(e,t){this.reset(t,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,t){if(this.resetTimer(),t&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var n=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(n.shape)||e.isSource(n.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(n,a,i,s);this.show(e,i,s),this.state=n,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,t,n){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=t+a.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,t){},mxCellTracker.prototype.mouseMove=function(e,t){this.isEnabled()&&this.process(t)},mxCellTracker.prototype.mouseUp=function(e,t){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(t)});n?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,t,n,a){if(null!=this.config){var i=this.createConditions(e,n,a);this.addItems(e,t,n,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,t,n,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(t.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(t,e,l,m,d,c,n,o,u),this.addItems(e,t,n,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,t,n,a,i,s,o,r,l){return e.addItem(n,a,function(e){"function"==typeof i&&i.call(t,t,o,e),null!=s&&t.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,t,n){var a=e.graph.getModel(),i=a.getChildCount(t),s=[];for(s.nocell=null==t,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=t,a=null!=t&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(t,!1),s.collapsable=a&&e.graph.isCellFoldable(t,!0),s.validRoot=a&&e.graph.isValidRoot(t),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(t),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,t,n))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,t){var n=t.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,t,n,a){var i=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(e,t,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(e,t,a)},mxDefaultToolbar.prototype.addOption=function(e,t,n){return this.toolbar.addOption(e,t,n)},mxDefaultToolbar.prototype.addMode=function(e,t,n,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(n),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,t,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,t,n,a,i,s){var o=function(){return"function"==typeof n?n():null!=n?n.clone():null},r=mxUtils.bind(this,function(e,t){"function"==typeof i?i(this.editor,o(),e,t):this.drop(o(),e,t),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,t,r,a,null,s),this.installDropHandler(e,function(e,t,n){r(t,n)}),e},mxDefaultToolbar.prototype.drop=function(e,t,n){var a=this.editor.graph,i=a.getModel();if(null!=n&&!i.isEdge(n)&&this.connectOnDrop&&a.isCellConnectable(n))this.connect(e,t,n);else{for(;null!=n&&!a.isValidDropTarget(n,[e],t);)n=i.getParent(n);this.insert(e,t,n)}},mxDefaultToolbar.prototype.insert=function(e,t,n){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(t),s=mxEvent.getClientY(t);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(n,[e],t)?a.splitEdge(n,[e],null,i.x,i.y):this.editor.addVertex(n,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,t,n){var a=(t=this.editor.graph).getModel();if(null!=n&&t.isCellConnectable(e)&&t.isEdgeValid(null,n,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(n),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*t.gridSize,l=20*a.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(n);if(t.addCell(e,d),t.constrainChild(e),i=this.editor.createEdge(n,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}t.addEdge(i,d,n,e)}finally{a.endUpdate()}t.setSelectionCells([e,i]),t.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(t,n){var a=document.createElement("img");a.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*t.offsetWidth+"px",a.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,n,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var t=e.getUrlImage();if(null==t||mxClient.IS_LOCAL)e.execute("show");else{var n=mxUtils.getViewXml(e.graph,1);n=mxUtils.getXml(n,"\n");mxUtils.submit(t,e.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,t){e.showProperties(t)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,t){e.graph.isEnabled()&&e.graph.isCellEditable(t)&&e.graph.startEditingAtCell(t)}),this.addAction("toBack",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,t){e.graph.enterGroup(t)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!0,!1,t)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!1,!1,t)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var t=100*e.graph.getView().scale;t=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,t))/100;isNaN(t)||e.graph.getView().setScale(t)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,t){this.actions[e]=t},mxEditor.prototype.execute=function(t,e,n){var a=this.actions[t];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(e,t){this.templates[e]=t},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){return this.createPopupMenu(e,t,n)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,t){return this.createEdge(e,t)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var t=null,n=i.graph.getModel();return null!=n.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),t=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==n.getParent(n.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),t=i.diagramLayout)),t},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,t){var n=t.getProperty("cell");null!=n&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),t.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");this.undoManager.undoableEditHappened(n)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,t){var n=t.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(n))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var t=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,t),e.getView().addListener(mxEvent.UP,t)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,t){this.setModified(!0),1==this.validating&&s.validateGraph();for(var n=t.getProperty("edit").changes,a=0;a<n.length;a++){var i=n[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var n=this;e.addMouseListener({mouseDown:function(e,t){null==n.insertFunction||t.isPopupTrigger()||!n.forcedInserting&&null!=t.getState()||(n.graph.clearSelection(),n.insertFunction(t.getEvent(),t.getCell()),this.isActive=!0,t.consume())},mouseMove:function(e,t){this.isActive&&t.consume()},mouseUp:function(e,t){this.isActive&&(this.isActive=!1,t.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,t=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return t.isVertexIgnored=function(e){return!t.graph.isSwimlane(e)},t},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){t.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(e,t){null!=e&&new mxCompactTreeLayout(this.graph,t).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",t=this.graph,n=t.getCurrentRoot();null!=n&&null!=t.getModel().getParent(t.getModel().getParent(n));)t.isValidRoot(n)&&(e=" > "+t.convertValueToString(n)+e),n=t.getModel().getParent(n);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var t=mxUtils.load(e).getXml();this.readGraphModel(t.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,t){if(null!=(e=e||this.getUrlPost())&&0<e.length){var n=this.writeGraphModel(t);this.postDiagram(e,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(t,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(t,this.postParameterName+"="+n,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",t,"data",n))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var t=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(t,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,t,n,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,t,n)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,t){null!=t.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,t){var n=this.graph.getStylesheet().styles[t];this.graph.getView().getStylesheet().putCellStyle(t,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var t=(n=mxUtils.getOffset(this.graph.container)).x+10,n=n.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(t+=a.x+Math.min(200,a.width),n+=a.y)}else t=this.properties.getX(),n=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,t,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var a=this.graph.getModel(),e=a.getValue(n);if(mxUtils.isNode(e)){var t=new mxForm("properties");t.addText("ID",n.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(n)&&(null!=(i=a.getGeometry(n))&&(s=t.addText("top",i.y),o=t.addText("left",i.x),r=t.addText("width",i.width),l=t.addText("height",i.height)));var d=a.getStyle(n),c=t.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=t.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(n,i)),0<c.value.length?a.setStyle(n,c.value):a.setStyle(n,null);for(var e=0;e<m.length;e++){var t=new mxCellAttributeChange(n,m[e].nodeName,u[e].value);a.execute(t)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),t.addButtons(e,d),t.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var n=mxUtils.bind(this,function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)});this.graph.getModel().addListener(mxEvent.CHANGE,n),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n),this.graph.addListener(mxEvent.ROOT,n),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var t=document.createElement("iframe");t.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("frameBorder","0"),t.style.backgroundColor="white",e=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,t,(e-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){t.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var t=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),n=new mxOutline(this.graph,e);t.setClosable(!0),t.setResizable(!0),t.destroyOnClose=!1,t.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=t,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,t,n){this.popupHandler.createMenu(this,e,t,n)},mxEditor.prototype.createEdge=function(e,t){var n=null;if(null!=this.defaultEdge)n=this.graph.getModel().cloneCell(this.defaultEdge);else{(n=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,n.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&n.setStyle(a),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var t=this.consumeCycleAttribute(e);null!=t&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+t)}},mxEditor.prototype.addVertex=function(e,t,n,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(n,a);var s=this.graph.getView().scale,o=i.getGeometry(t),r=i.getGeometry(e);if(this.graph.isSwimlane(t)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(n-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<n+r&&(n-=n+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(n-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(n/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),t.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(t),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",t,"parent",e)),i.beginUpdate();try{null!=(t=this.graph.addCell(t,e))&&(this.graph.constrainChild(t),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",t)))}finally{i.endUpdate()}return null!=t&&(this.graph.setSelectionCell(t),this.graph.scrollCellToVisible(t),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",t))),t},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var t=e.getName();mxCodecRegistry.codecs[t]=e;var n=mxUtils.getFunctionName(e.template.constructor);n!=t&&mxCodecRegistry.addAlias(n,t)}return e},addAlias:function(e,t){mxCodecRegistry.aliases[e]=t},getCodec:function(e){var t=null;if(null!=e){t=mxUtils.getFunctionName(e);var n=mxCodecRegistry.aliases[t];if(null!=n&&(t=n),null==(t=mxCodecRegistry.codecs[t]))try{t=new mxObjectCodec(new e),mxCodecRegistry.register(t)}catch(e){}}return t}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,t,n,a){for(var i in this.template=e,this.exclude=null!=t?t:[],this.idrefs=null!=n?n:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,t){return this.objects[e]=t},mxCodec.prototype.getObject=function(e){var t=null;return null!=e&&(null==(t=this.objects[e])&&(null==(t=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(t=this.decode(e))))),t},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,t){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=t?t:"id",e)},mxCodec.prototype.getId=function(e){var t=null;return null!=e&&(null==(t=this.reference(e))&&e instanceof mxCell&&(null==(t=e.getId())&&(0==(t=mxCellPath.create(e)).length&&(t="root")))),t},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var t=null;if(null!=e&&null!=e.constructor){var n=mxCodecRegistry.getCodec(e.constructor);null!=n?t=n.encode(this,e):mxUtils.isNode(e)?t=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return t},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,t,n){if(t.appendChild(this.encode(e)),null==n||n){n=e.getChildCount();for(var a=0;a<n;a++)this.encodeCell(e.getChildAt(a),t)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,t){t=null==t||t;var n=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(n=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(n))for(var a=e.firstChild;null!=a&&!this.isCellCodec(n);)n=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(n)||(n=mxCodecRegistry.getCodec(mxCell)),n=n.decode(this,e),t&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(e){var t=e.parent,n=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=t&&t.insert(e),null!=n&&n.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,t,n){null!=t&&null!=n&&e.setAttribute(t,n)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var t=this.reverse[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var t=this.mapping[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.isExcluded=function(e,t,n,a){return t==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,t)},mxObjectCodec.prototype.isReference=function(e,t,n,a){return 0<=mxUtils.indexOf(this.idrefs,t)},mxObjectCodec.prototype.encode=function(e,t){var n=e.document.createElement(this.getName());return t=this.beforeEncode(e,t,n),this.encodeObject(e,t,n),this.afterEncode(e,t,n)},mxObjectCodec.prototype.encodeObject=function(e,t,n){for(var a in e.setAttribute(n,"id",e.getId(t)),t){var i=a,s=t[i];null!=s&&!this.isExcluded(t,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,t,i,s,n))}},mxObjectCodec.prototype.encodeValue=function(e,t,n,a,i){if(null!=a){if(this.isReference(t,n,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+a);a=s}s=this.template[n],(null==n||e.encodeDefaults||s!=a)&&(n=this.getAttributeName(n),this.writeAttribute(e,t,n,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,t,n,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,t,n,a,i):this.writeComplexAttribute(e,t,n,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,t,n,a,i){a=this.convertValueToXml(a),null==n?(t=e.document.createElement("add"),"function"==typeof a?t.appendChild(e.document.createTextNode(a)):e.setAttribute(t,"value",a),i.appendChild(t)):"function"!=typeof a&&e.setAttribute(i,n,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,t,n,a,i){null!=(e=e.encode(a))?(null!=n&&e.setAttribute("as",n),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,t,n){return t},mxObjectCodec.prototype.afterEncode=function(e,t,n){return n},mxObjectCodec.prototype.decode=function(e,t,n){var a=t.getAttribute("id"),i=e.objects[a];return null==i&&(i=n||this.cloneTemplate(),null!=a&&e.putObject(a,i)),t=this.beforeDecode(e,t,i),this.decodeNode(e,t,i),this.afterDecode(e,t,i)},mxObjectCodec.prototype.decodeNode=function(e,t,n){null!=t&&(this.decodeAttributes(e,t,n),this.decodeChildren(e,t,n))},mxObjectCodec.prototype.decodeAttributes=function(e,t,n){if(null!=(t=t.attributes))for(var a=0;a<t.length;a++)this.decodeAttribute(e,t[a],n)},mxObjectCodec.prototype.decodeAttribute=function(e,t,n){var a=t.nodeName;if("as"!=a&&"id"!=a){t="value"==a?t.nodeValue:this.convertValueFromXml(t.nodeValue);var i=this.getFieldName(a);if(this.isReference(n,i,t,!1)){if(null==(e=e.getObject(t)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+t);t=e}this.isExcluded(n,a,t,!1)||(n[a]=t)}},mxObjectCodec.prototype.decodeChildren=function(e,t,n){for(t=t.firstChild;null!=t;){var a=t.nextSibling;t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n)&&this.decodeChild(e,t,n),t=a}},mxObjectCodec.prototype.decodeChild=function(e,t,n){var a=this.getFieldName(t.getAttribute("as"));if(null==a||!this.isExcluded(n,a,t,!1)){var i=this.getFieldTemplate(n,a,t),s=null;"add"==t.nodeName?null==(s=t.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(t))):s=e.decode(t,i),this.addObjectValue(n,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,t,n){return(e=e[t])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,t,n,a){null!=n&&n!=a&&(null!=t&&0<t.length?e[t]=n:e.push(n))},mxObjectCodec.prototype.processInclude=function(e,t,n){if("include"!=t.nodeName)return!1;if(null!=(t=t.getAttribute("name")))try{var a=mxUtils.load(t).getDocumentElement();null!=a&&e.decode(a,n)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,t,n){return t},mxObjectCodec.prototype.afterDecode=function(e,t,n){return n},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,t,n,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==t&&n.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,t,n){if(null!=t.value&&t.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=n;(n=mxClient.IS_IE?t.value.cloneNode(!0):e.document.importNode(t.value,!0)).appendChild(a),e=a.getAttribute("id"),n.setAttribute("id",e),a.removeAttribute("id")}return n},e.beforeDecode=function(e,t,n){var a=t,i=this.getName();if(t.nodeName!=i?(null!=(a=t.getElementsByTagName(i)[0])&&a.parentNode==t?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,n.value=t.cloneNode(!0),null!=(t=n.value.getAttribute("id"))&&(n.setId(t),n.value.removeAttribute("id"))):n.setId(t.getAttribute("id")),null!=a)for(t=0;t<this.idrefs.length;t++){i=this.idrefs[t];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),n[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,t,n){var a=e.document.createElement("root");e.encodeCell(t.getRoot(),a),n.appendChild(a)},e.decodeChild=function(e,t,n){"root"==t.nodeName?this.decodeRoot(e,t,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,t,n){var a=null;for(t=t.firstChild;null!=t;){var i=e.decodeCell(t);null!=i&&null==i.getParent()&&(a=i),t=t.nextSibling}null!=a&&n.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,t,n){return e.encodeCell(t.root,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.root=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;)n=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=n}return t},e.afterDecode=function(e,t,n){return n.previous=n.root,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,t,n,a){return!("child"!=t||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,t)},e.afterEncode=function(e,t,n){return this.isReference(t,"child",t.child,!0)?n.setAttribute("child",e.getId(t.child)):e.encodeCell(t.child,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.child=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;){if(n=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=n}}else a=t.getAttribute("child"),n.child=e.getObject(a);return t},e.afterDecode=function(e,t,n){return n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,t,n){return n.previous=n.terminal,n},e}());var mxGenericChangeCodec=function(e,a){var t=new mxObjectCodec(e,["model","previous"],["cell"]);return t.afterDecode=function(e,t,n){return mxUtils.isNode(n.cell)&&(n.cell=e.decodeCell(n.cell,!1)),n.previous=n[a],n},t};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,t){return this.encodeCell(e,t,t.graph.getModel().getRoot())},e.encodeCell=function(e,t,n){var a=t.graph.getModel(),i=t.getState(n),s=a.getParent(n);if(null==s||null!=i){var o=a.getChildCount(n),r=t.graph.getCellGeometry(n),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(n)?l="edge":0<o&&null!=r?l="group":a.isVertex(n)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=t.graph.getLabel(n)&&(d.setAttribute("label",t.graph.getLabel(n)),t.graph.isHtmlLabel(n)&&d.setAttribute("html",!0)),null==s){var c=t.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",t.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,t,a.getChildAt(n,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,t){var n,a=e.document.createElement(this.getName());for(n in t.styles){var i=t.styles[n],s=e.document.createElement("add");if(null!=n){for(var o in s.setAttribute("as",n),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,t){var n=typeof t;return"function"==n?t=mxStyleRegistry.getName(style[j]):"object"==n&&(t=null),t},e.decode=function(e,t,n){n=n||new this.template.constructor;var a=t.getAttribute("id");for(null!=a&&(e.objects[a]=n),t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName&&null!=(a=t.getAttribute("as"))){var i=t.getAttribute("extend"),s=null!=i?mxUtils.clone(n.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=t.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}n.putCellStyle(a,s)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n)for(t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName){var a=t.getAttribute("as"),i=t.getAttribute("action"),s=t.getAttribute("control");n.bindAction(a,i,s)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n){var a=n.editor;for(t=t.firstChild;null!=t;){if(t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n))if("separator"==t.nodeName)n.addSeparator();else if("br"==t.nodeName)n.toolbar.addBreak();else if("hr"==t.nodeName)n.toolbar.addLine();else if("add"==t.nodeName){var i=t.getAttribute("as"),s=(i=mxResources.get(i)||i,t.getAttribute("icon")),o=t.getAttribute("pressedIcon"),r=t.getAttribute("action"),l=t.getAttribute("mode"),d=t.getAttribute("template"),c="0"!=t.getAttribute("toggle"),m=mxUtils.getTextContent(t),u=null;if(null!=r)u=n.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=n.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=t.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=n.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(t)).length)if(null==s)for(d=n.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?n.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),n.addActionOption(d,s,c));else{var g=null,v=n.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),t=g.options[g.selectedIndex].cellStyle;return null!=t&&e.setStyle(t),e},null,null,c);g=n.addCombo();for(mxEvent.addListener(g,"change",function(){n.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),n.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?n.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),n.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=t.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}t=t.nextSibling}}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,t){return null},e.decode=function(e,t,n){var a=t.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,n):null!=n&&(n.config=t),n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,t,n){return null!=(e=t.getAttribute("defaultEdge"))&&(t.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[e]),null!=(e=t.getAttribute("defaultGroup"))&&(t.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[e]),n},e.decodeChild=function(e,t,n){if("Array"==t.nodeName){if("templates"==t.getAttribute("as"))return void this.decodeTemplates(e,t,n)}else if("ui"==t.nodeName)return void this.decodeUi(e,t,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,t,n){for(e=t.firstChild;null!=e;){if("add"==e.nodeName){t=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(t)||t,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==t?n.setGraphContainer(s):"toolbar"==t?n.setToolbarContainer(s):"title"==t?n.setTitleContainer(s):"status"==t?n.setStatusContainer(s):"map"==t&&n.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,t,n){null==n.templates&&(n.templates=[]),t=mxUtils.getChildNodes(t);for(var a=0;a<t.length;a++){for(var i=t[a].getAttribute("as"),s=t[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(n.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,t,n){this.projectDesignController=e,this.editor=t||new Editor,this.container=n||document.body;var a=t.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+t.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,t,n){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","awslex","sesteknda","sestekasr"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),mxEvent.isConsumed(e)||t.isConsumed()||(this.getModel().isEdge(n)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(n.source.value.tagName)&&this.startEditingAtCell(n):this.getModel().isVertex(n)&&i.projectDesignController.openDialog(n.getValue(),function(e){for(var t=0;t<e.length;t+=1)n.setAttribute(e[t].name,e[t].value);a.refresh(n)}),t.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){this.isEditingEnabled()&&this.menus.createPopupMenu(e,t,n)}),t.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(t):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),t=function(){e.setEnabled(!mxClipboard.isEmpty())},n=mxClipboard.cut;mxClipboard.cut=function(){n.apply(this,arguments),t()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),t()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var t=window.document.createElement("a");t.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),t.download=this.editor.filename+".xml",t.target="_self",t.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,t){try{var n=mxUtils.parseXml(e);this.editor.setGraphXml(n.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,t,n){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t),null!=n&&(this.editor.data=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,t){for(var n=this.editor.graph,a=(e=null!=e?e:n.model.getRoot(),t=null!=t?t:{},!0),i=n.model.getChildCount(e),s=0;s<i;s++){var o=n.model.getChildAt(e,s),r=t;n.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?n.setCellWarning(o,r.replace(/\n/g,"<br>")):n.setCellWarning(o,null),a=a&&null==r}if(i="",n.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n"}if(n.model.isEdge(e))switch(n.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return n.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(n.containsValidationErrorsResource)||n.containsValidationErrorsResource)+"\n"),i=n.model.isEdge(e)?i+(n.getEdgeValidationError(e,n.model.getTerminal(e,!0),n.model.getTerminal(e,!1))||""):i+(n.getCellValidationError(e)||""),null!=(s=n.validateCell(e,t))&&(i+=s),null==n.model.getParent(e)&&n.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(t){var n=this.editor.graph,e=n.getDefaultParent(),a=0;return e.children.forEach(function(e){n.model.isVertex(e)&&e.value.nodeName==t&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var t=null!=e?e:window.location.pathname,n=0<t.indexOf("?")?1:0;for(var a in urlParams)t+=0==n?"?":"&",t+=a+"="+urlParams[a],n++;return t},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),t=this.actions.get("redo"),n=this.editor.undoManager,a=function(){e.setEnabled(n.canUndo()),t.setEnabled(n.canRedo())};n.addListener(mxEvent.ADD,a),n.addListener(mxEvent.UNDO,a),n.addListener(mxEvent.REDO,a),n.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,t=!e.isSelectionEmpty(),n=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(n=!0),a&&n)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(t);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=n&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(t);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(n||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),t=this.container.clientWidth+390,n=this.container.clientHeight+190;this.container==document.body&&(t=document.body.clientWidth||document.documentElement.clientWidth,n=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,t-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,n-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=t+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=n-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=t-a-this.splitSize+"px";var r=n-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var t=document.createElement("div");return t.className=e,t},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var t=document.createElement("form");return t.className=e,t},EditorUi.prototype.addSplitHandler=function(t,n,a,i){var s=null,o=null;function r(e){if(null!=s){var t=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(n?t.x-s.x:s.y-t.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(t,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(n?t.style.left:t.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,t,n){var a=this.editor.graph,i=a.getSelectionCell();t=null!=this.animate?this.animate:t,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(t&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function t(e){if(!a.isSelectionEmpty()){var t=0,n=0;37==e?t=-1:38==e?n=-1:39==e?t=1:40==e&&(n=1),a.moveCells(a.getSelectionCells(),t,n),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var n=mxUtils.bind(this,function(e,t,n,a){var i=this.actions.get(n);if(null!=i){var s=function(){i.enabled&&i.funct()};t?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){t(37)}),o.bindKey(38,function(){t(38)}),o.bindKey(39,function(){t(39)}),o.bindKey(40,function(){t(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),n(46,!1,"delete"),n(82,!0,"tilt"),n(83,!0,"save"),n(83,!0,"saveAs",!0),n(107,!1,"zoomIn"),n(109,!1,"zoomOut"),n(65,!0,"selectAll"),n(86,!0,"selectVertices",!0),n(69,!0,"selectEdges",!0),n(69,!0,"export"),n(66,!0,"toBack"),n(70,!0,"toFront"),n(68,!0,"duplicate"),n(90,!0,"undo"),n(89,!0,"redo"),n(88,!0,"cut"),n(67,!0,"copy"),n(81,!0,"connect"),n(86,!0,"paste"),n(71,!0,"group"),n(71,!0,"grid",!0),n(85,!0,"ungroup"),n(112,!1,"about"),n(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,t,n,a){for(var i=0;i<t.length;i++)e.push(new mxMultiplicity(!0,t[i],null,null,n[i][0],n[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+n[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,t[i],null,null,a[i][0],a[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,t){this.editorUi=e,this.container=t,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var t=mxEvent.getSource(e);null!=t;){if(t==this.currentElt)return;t=t.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(t,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,t,n,a,i){mxEventSource.call(this),this.label=e,this.funct=t,this.enabled=null==n||n,this.iconCls=a,this.shortcut=i}function Menubar(e,t){this.editorUi=e,this.container=t,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,t){mxEventSource.call(this),this.funct=e,this.enabled=null==t||t}function Toolbar(e,t){this.editorUi=e,this.container=t,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var t=document.createElement("input");return t.setAttribute("type","checkbox"),e&&t.setAttribute("checked",!0),t}function createDropdownFromApi(e,n,a,i,t,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+t.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(t){r&&t[a]==r||((m=document.createElement("option")).text=t[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",t[e])}),m.selected=m.value==n):(m.value=t[i],m.selected=t[i]==n),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,t,n,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[n],d.value=e[a],d.selected=e[a]==t,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,t,n,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[n].toUpperCase(),d.value=e[a],d.selected=e[a]==t,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[n]),d.value=e[a],d.selected=e[a]==t,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,t){var n=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<t||""!=t)&&(i.selected=t===a),n.appendChild(i)}return n.className="form-control select2",n}function createDropdownFromTigerDialList(e){var t=document.createElement("select"),n=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)n[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in n){var l=document.createElement("option");l.text=n[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),t.appendChild(l)}return t.className="form-control select2",t}function Dialog(e,t,n,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),n+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-n)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(t),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var t=e.target.files[0];if(console.log(t),t)if("text/xml"===t.type){var n=new FileReader;n.onload=function(e){var t=e.target.result;mxUtils.write(d,t)},n.readAsText(t)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var t=mxUtils.parseXml(d.value);n.editor.setGraphXml(t.documentElement),n.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function SaveDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function NewDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function DescriptionDialog(e){console.log(e.editor.data);var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function VariableDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function OpenDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function RenameDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-4"),d=n.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=n.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var t=new XMLHttpRequest;t.open("PUT",SAVE_URL+n.editor.data.id,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.setRequestHeader("Authorization","Bearer "+n.editor.data.token),t.send("name="+u.value),t.onload=function(e){200===t.status?(n.editor.setStatus("Project successfully renamed"),n.editor.filename=u.value):(console.log(t.response),n.editor.setStatus(JSON.parse(t.response).errors[0].message))},t.onerror=function(e){mxUtils.alert(t.statusText)},n.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(t.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var t=e.dataTransfer.files[0],n=new FileReader;n.onload=function(e){d.value=e.target.result},n.readAsText(t)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);t.editor.setGraphXml(e.documentElement),t.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body form"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("form-horizontal form-row-seperated"),l=t.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",t.editor.getOrCreateFilename()),c.className="form-control";var m=t.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){t.save(!1);encodeURIComponent(mxUtils.getXml(t.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+t.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),t.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),t=i.createDiv("md-toolbar"),n=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",t.appendChild(l),t.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var E=i.createDiv("p");E.className="help-block",mxUtils.write(E,mxResources.get("help_"+p)),b.appendChild(E)}h.appendChild(b),c.appendChild(h)}n.appendChild(c);var A=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var t=0;t<s.value.attributes.length;t++){var n="_"+s.value.attributes[t].name,a=s.value.attributes[t].name;s.setAttribute(a,document.getElementById(n).value)}o.refresh(s),i.hideDialog()}));A.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(A),a.appendChild(y),e.appendChild(t),e.appendChild(n),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var t=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var n=e.getAttribute("pageScale");this.graph.pageScale=null!=n?n:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),t.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,t=this.outline;if(null!=e.container&&null!=t.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",t.outline.container.style.backgroundColor=e.container.style.backgroundColor,t.outline.pageVisible==e.pageVisible&&t.outline.pageScale==e.pageScale||(t.outline.pageScale=e.pageScale,t.outline.pageVisible=e.pageVisible,t.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var n=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":n,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=e.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(e,t){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),t=0<e.width?e.x/this.scale-this.translate.x:0,n=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,t)/r),c=Math.floor(Math.min(0,n)/l),m=Math.ceil(Math.max(1,t+a)/r)-d,u=Math.ceil(Math.max(1,n+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,t){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=t+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();t=r.width,n=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(t/l.width)-1:0,c=e?Math.ceil(n/l.height)-1:0,m=r.x+t,u=r.y+n;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){for(var a=0;a<t.length;a++)if(this.graph.getModel().isVertex(t[a])){var i=this.graph.getCellGeometry(t[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,t,n,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var t=this.graph.getModel(),n=t.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=t.getParent(a);if(null==n||n!=a&&n!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&t.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var t=l.apply(this,arguments),n=this.graph.getModel(),a=n.getParent(this.graph.getSelectionCell()),i=n.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!n.isVertex(i)||this.graph.isValidRoot(i)||(t=!0)),t},mxGraphHandler.prototype.selectDelayed=function(e){var t=e.getCell();null==t&&(t=this.cell);for(var n=this.graph.getModel(),a=n.getParent(t);this.graph.isCellSelected(t)&&n.isVertex(a)&&!this.graph.isValidRoot(a);)t=a,a=n.getParent(t);this.graph.selectCellForEvent(t,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var t=e.getCell(),n=this.graph.getModel(),a=n.getParent(t);n.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(t=a),a=n.getParent(a);return t}},Editor.prototype.createUndoManager=function(){var s=this.graph,n=new mxUndoManager,e=function(e,t){n.undoableEditHappened(t.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var t=function(e,t){for(var n=s.getSelectionCellsForChanges(t.getProperty("edit").changes),a=[],i=1;i<n.length;i++)null!=s.view.getState(n[i])&&a.push(n[i]);s.setSelectionCells(a)};return n.addListener(mxEvent.UNDO,t),n.addListener(mxEvent.REDO,t),n},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var t=mxStencilRegistry.stencils[e];if(null==t){var n=mxStencilRegistry.getBasenameForStencil(e);if(null!=n){var a=mxStencilRegistry.libraries[n];if(null!=a){if(null==mxStencilRegistry.packages[n]){mxStencilRegistry.packages[n]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);t=mxStencilRegistry.stencils[e]}}return t},mxStencilRegistry.getBasenameForStencil=function(e){var t=e.split("."),n=null;if(0<t.length&&"mxgraph"==t[0]){n=t[1];for(var a=2;a<t.length-1;a++)n+="/"+t[a]}return n},mxStencilRegistry.loadStencilSet=function(e,t,n){n=null!=n&&n;var a=mxStencilRegistry.packages[e];if(n||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,t,i)}},mxStencilRegistry.parseStencilSet=function(e,t,n){n=null==n||n;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(n&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=t){var l=i.getAttribute("w"),d=i.getAttribute("h");t(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,t){this.data=e,this.filename=t,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["tts","ispeechtts","awspolly","lumenvoxtts","sestektts"],["GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","awslex","sesteknda"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","AWSLex","SestekNDA"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),t=e.width+2*this.tooltipBorder+4,n=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(n+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=t+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;n+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(n-=6,this.tooltipTitle.style.top=n-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=n+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-n/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+n/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,t){if(null!=this.taglist&&null!=e&&0<e.length)for(var n=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<n.length;a++)if(n[a]=n[a].replace(/\.*\d*$/,""),1<n[a].length){var i=this.taglist[n[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[n[a]]=i),null==i.dict.get(t)&&(i.dict.put(t,t),i.entries.push(t))}return t},Sidebar.prototype.searchEntries=function(e,t,n,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(n+1)*t,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(n*t,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(n*t,(n+1)*t),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var t=e.split(" "),n=[],a={},i=0;i<t.length;i++)null==a[t[i]]&&(a[t[i]]="1",n.push(t[i]));return n.join(" ")},Sidebar.prototype.cloneCell=function(e,t){var n=e.clone();return null!=t&&(n.value=t),n},Sidebar.prototype.addSearchPalette=function(e){var t=document.createElement("div");t.style.visibility="hidden",this.container.appendChild(t);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.textOverflow="clip",n.style.paddingBottom="8px",n.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",n.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",n.appendChild(s),r.appendChild(n);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var t=e.nextSibling;e!=n&&e!=l&&e.parentNode.removeChild(e),e=t}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,t,n){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(n?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[t,o]},Sidebar.prototype.createTitle=function(e){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.setAttribute("title",mxResources.get("sidebarTooltip")),t.className="geTitle",mxUtils.write(t,e),t},Sidebar.prototype.createThumb=function(e,t,n,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((t-2*this.thumbBorder)/c.width,(n-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((t-c.width*m)/2/m-c.x),Math.floor((n-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=t+"px",u.style.height=n+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(t,n,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(t,this.thumbWidth,this.thumbHeight,r,n,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<t.length||t[0].vertex){var c=this.createDragSource(r,this.createDropHandler(t,!0,o,d),this.createDragPreview(i,s),t,d);this.addClickHandler(r,c,t),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=t[0]&&t[0].edge){c=this.createDragSource(r,this.createDropHandler(t,!1,o,d),this.createDragPreview(i,s),t,d);this.addClickHandler(r,c,t)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,t,d.width,d.height,n,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,t,n,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=n&&e.isValidDropTarget(n,g,t),o=null;if(null==n||s||(n=null),!e.isCellLocked(n||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(n,g,t)){var r=e.cloneCells(g);e.splitEdge(n,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,n));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(n);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(t)}})},Sidebar.prototype.createDragPreview=function(e,t){var n=document.createElement("div");return n.style.border="1px dashed black",n.style.width=e+"px",n.style.height=t+"px",n},Sidebar.prototype.createDragSource=function(e,t,n){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,t,n,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,t,n){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var t=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=t&&Math.abs(s.y-mxEvent.getClientY(e))<=t){var n=i.getGridSize();a.drop(i,e,null,n,n)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,t,n,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,t,n,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,t,n,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",t),n.forEach(function(e,t){i.setAttribute(e,a[t]?a[t]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,t,n,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,t,n),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,t,n,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,t,n,a,i,s,o){return this.createItem(e,a,i,s,t,n,o)},Sidebar.prototype.createEdgeTemplate=function(e,t,n,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,t,n),e);return r.geometry.setTerminalPoint(new mxPoint(0,n),!0),r.geometry.setTerminalPoint(new mxPoint(t,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],t,n,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,t,n,a,i,s){return this.createItem(e,a,i,!0,t,n,s)},Sidebar.prototype.addPaletteFunctions=function(e,t,n,a){this.addPalette(e,t,n,mxUtils.bind(this,function(e){for(var t=0;t<a.length;t++)e.appendChild(a[t](e))}))},Sidebar.prototype.addPalette=function(e,t,n,a){var i=this.createTitle(t);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),n?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(n,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){n.style.cursor="wait";var t=n.innerHTML;n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",n.style.cursor="",n.innerHTML=t},0)}else a.style.display="block";n.style.backgroundImage="url('"+this.expandedImage+"')"}else n.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,t,s,o,r,n,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,t,n){if(null==n){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");n=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],t,!1,!0,this.filterTags(n)))})(r[d],null!=n?n[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,t,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,t,n,a){mxGraph.call(this,e,t,n,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);return"1"==n.html||"wrap"==n.whiteSpace},this.cellRenderer.getLabelValue=function(e){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(t=mxUtils.htmlEntities(t,!1)),t},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,t){null==t?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(t.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(t.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);if(null!=n){var a=mxUtils.getValue(n,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var t=this.getModel().cloneCells([e])[0];null!=t.geometry&&(t.geometry.points=null);var n=t.getStyle();n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_Y,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_Y,null),t.setStyle(n),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(t)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([t])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var t="";return this.getModel().isVertex(e)?t+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(t=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),t},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,t,n){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",t),t=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,t){var n=null;null!=e.value&&"object"==typeof e.value?n=e.value.cloneNode(!0):(n=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=t&&0<t.length?n.setAttribute("link",t):n.removeAttribute("link"),this.model.setValue(e,n)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,t){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var t=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(t)&&(e.state=this.view.getState(t),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,t,n){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=t.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(t.getEvent()),i=mxEvent.getClientY(t.getEvent());this.panningHandler.popup(a+16,i,o,t.getEvent())}return s=!1,o=null,void t.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&t.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)});var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,t){n.apply(this,arguments),this.graph.isCellSelected(t.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,t){touchStyle&&null!=t?this.graph.setSelectionCell(t):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,t){if(null==t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.getCellAt(n.x,n.y)}a.call(this,e,t)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var t=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(t),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=t}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var t=this.editorUi,l=t.editor,d=l.graph;this.addAction("new",function(){t.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){t.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),t.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){t.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){t.editor.setStatus(""),null===t.validate()?(t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),t.editor.modified=!1):(t.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){t.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){t.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){t.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){t.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){t.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null==t&&(t=""),null!=(t=mxUtils.prompt(mxResources.get("enterValue"),t))&&d.setLinkForCell(e,t)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null!=t&&window.open(t)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];d.getModel().getChildCount(n)?d.updateGroupBounds([n],20):d.updateCellSize(n)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),t="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(t=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,t)}),this.addAction("rotation",function(){var e="0",t=d.getView().getState(d.getSelectionCell());null!=t&&(e=t.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];if(d.getModel().isVertex(n)&&0==d.getModel().getChildCount(n)){var a=d.getCellGeometry(n);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(n,a);var s=d.view.getState(n);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[n])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(n/e.width/t,a/e.height/t))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*t*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*t*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=Math.floor(100*n/e.width/t)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*t*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*t*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,t=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(t*d.view.scale)}else{var n=d.view.translate;d.view.setTranslate(n.x-d.container.scrollLeft/d.view.scale,n.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var n=mxUtils.bind(this,function(e,t){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,t)})});n("bold",mxConstants.FONT_BOLD),n("italic",mxConstants.FONT_ITALIC),n("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var t=d.getModel(),n=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",t.getStyle(e[0])||"");null!=n&&d.setCellStyle(n,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var t=l.graph.selectionCellsHandler.getHandler(e);if(t instanceof mxEdgeHandler){var n=d.view.translate,a=d.view.scale,i=n.x,s=n.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),t.addPointAt(t.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=t.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",t=d.getView().getState(d.getSelectionCell());if(null!=t&&(e=t.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var n=new Image;n.onload=function(){!function(e,t,n){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,t,n)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=t&&null!=n){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=t,r.height=n,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,n.width,n.height)},n.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},n.src=e}})},Actions.prototype.addAction=function(e,t,n,a,i){return this.put(e,new Action(mxResources.get(e),t,n,a,i))},Actions.prototype.put=function(e,t){return this.actions[e]=t},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,t){for(var n=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<n.length;a++){this.styleChange(e,n[a],[mxConstants.STYLE_FONTFAMILY],[n[a]],null,t).firstChild.nextSibling.style.fontFamily=n[a]}e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,t)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,t){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<n.length;a++)this.styleChange(e,n[a],[mxConstants.STYLE_FONTSIZE],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,t)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,t){for(var n=[1,2,3,4,8,12,16,24],a=0;a<n.length;a++)this.styleChange(e,n[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,t)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,t),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,t),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,t),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,t)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,t)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,t)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,t){var n=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(n||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,t,n),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,t,n),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,t,n),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,t,n),e.addSeparator(t),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,t,n),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,t,n)),(a||e.showDisabled)&&(e.addSeparator(t),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,t,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,t,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItem(e,"style",t)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,t){var n=this.get("text").enabled;e.addSeparator(t),this.addSubmenu("fontFamily",e,t),this.addSubmenu("fontSize",e,t),this.addMenuItems(e,["-","bold","italic","underline","-"],t),this.addSubmenu("alignment",e,t),this.addMenuItem(e,"wordWrap",t),e.addSeparator(t),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,t,n),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},t,null,n)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,t),e.addSeparator(t),this.addSubmenu("position",e,t),this.addSubmenu("spacing",e,t),e.addSeparator(t);var n=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},t,null,n)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,t)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},t),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},t),this.addMenuItems(e,["-","tilt","rotation"],t)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},t),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},t),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},t),e.addSeparator(t),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},t),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},t),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},t)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),t),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),t)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],t)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["toFront","toBack","-"],t),this.addSubmenu("layout",e,t),e.addSeparator(t),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],t)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,n){this.addMenuItems(t,["actualSize"],n),t.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){t.addItem(100*e+"%",null,function(){i.zoomTo(e)},n)}(e[a]);this.addMenuItems(t,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],t)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,t){this.menus[e]=t},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,t,n){var a=this.get(e).enabled;if(t.showDisabled||a){var i=t.addItem(mxResources.get(e),null,null,n,null,a);this.addMenu(e,t,i)}},Menus.prototype.addMenu=function(e,t,n){var a=this.get(e);null!=a&&(t.showDisabled||a.enabled)&&this.get(e).execute(t,n)},Menus.prototype.styleChange=function(e,t,n,a,i,s){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var t=0;t<n.length;t++)e.setCellStyles(n[t],a[t])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,t,a,i,s,n,o){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=i,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[s]||t),null!=(t=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),t))&&0<t.length&&e.setCellStyles(s,t)}),n,null,o)},Menus.prototype.addMenuItem=function(e,t,n){var a=this.editorUi.actions.get(t);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,n,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,t){if(null!=t.shortcut){var n=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,t.shortcut),n.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var t=e.firstChild.nextSibling;t.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,t,n){for(var a=0;a<t.length;a++)"-"==t[a]?e.addSeparator(n):this.addMenuItem(e,t[a],n)},Menus.prototype.createPopupMenu=function(e,t,n){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(t=a.getSelectionCell())&&a.getModel().isEdge(t)){var s=a.selectionCellsHandler.getHandler(t);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(n)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var t=new Menubar(this.editorUi,e),n=[];n=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<n.length;a++)t.addMenu(mxResources.get(n[a]),this.get(n[a]).funct);return t},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geItem",mxUtils.write(n,e),this.addMenuHandler(n,t),this.container.appendChild(n),n},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,t=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var t=new mxPopupMenu(s);t.div.className+=" geMenubarMenu",t.smartSeparators=!0,t.showDisabled=!0,t.autoExpand=!0,t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments),t.destroy(),this.currentMenu=null,this.currentElt=null});var n=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;t.popup(n,a,null,e),this.currentMenu=t,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),t(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",t)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,t){this.funct(e,t)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,t,n,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,t,n,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,t,n,a){var i=n?this.createLabel(e):this.createButton(e);return this.initElement(i,t),this.addMenuHandler(i,n,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var t=0;t<e.length;t++){var n=e[t];"-"==n?this.addSeparator():this.addItem("geSprite-"+n.toLowerCase(),n)}},Toolbar.prototype.addItem=function(e,t){var n=this.editorUi.actions.get(t),a=null;return null!=n&&((a=this.addButton(e,n.label,n.funct)).setEnabled(n.enabled),n.addListener("stateChanged",function(){a.setEnabled(n.enabled)})),a},Toolbar.prototype.addButton=function(e,t,n){var a=this.createButton(e);return this.initElement(a,t),this.addClickHandler(a,n),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(n){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),t=0;t<n.length;t++)n[t].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var t=i.getSelectionCells(),n=0;n<t.length;n++)if(i.getModel().isEdge(t[n])){e=!0;break}for(n=0;n<a.length;n++)a[n].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,t){e.setAttribute("tabindex","0"),null!=t&&e.setAttribute("title",t),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(t){var n=t.className;t.setEnabled=function(e){t.enabled=e,t.className=e?n:n+" geDisabled"},t.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(t,n){null!=n&&mxEvent.addListener(t,"click",function(e){t.enabled&&n(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var t=document.createElement("a");t.setAttribute("href","javascript:void(0);"),t.className="geButton";var n=document.createElement("div");return n.className="geSprite "+e,t.appendChild(n),t},Toolbar.prototype.createLabel=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geLabel",mxUtils.write(n,e),n},Toolbar.prototype.addMenuHandler=function(t,n,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){(null==t.enabled||t.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=n,o.autoExpand=!0,o.popup(t.offsetLeft,t.offsetTop+t.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-select ng-model="vm.name" placeholder="Select a telephone">\n <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n </md-select>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n <span translate="LOGIN.SELECT">SELECT</span>\n </md-button>\n \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="LOGIN.CANCEL">Cancel</span>\n </md-button> --\x3e\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()">{{target}}</span>\n\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix">{{prefix}}-</span>{{target}}\n </a>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n'+" {{'DASHBOARDS.TRANSFER_NUMBER' | translate}} ({{prefix ? prefix + '-' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>"),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="{{options.labelSearch || \'Search...\'}}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="options.readOnly ? \'read-only-mode\' : \'\'" ng-disabled="options.readOnly" ng-repeat="item in options.items | filter: query | orderBy: options.orderBy" ng-click="canTransfer(item, options, false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="options.line4">{{getLine(item, options.line4)}}\n </p>\n </div>\n <md-icon ng-show="!options.readOnly" md-font-icon="icon-arrow-right-bold" aria-label="swap"></md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{options.labelAll || \'All Items\'}} ({{options.items.length}})</span>\n <md-icon ng-show="options.showSelectAndDeselectAll && !options.readOnly" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="transfer(options.items, options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="{{options.labelSearch || \'Search...\'}}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="options.readOnly || !item.isValid ? \'read-only-mode\' : \'\'" ng-disabled="options.readOnly" ng-repeat="item in options.selectedItems | filter: selectedQuery | orderBy: options.orderBy" ng-click="canTransfer(item, options, true)">\n <md-icon ng-class="options.readOnly || !item.isValid ? \'hidden\' : \'\'" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="options.line4">{{getLine(item, options.line4)}}\n </p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-show="options.showSelectAndDeselectAll && !options.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" flex ng-click="transfer(options.selectedItems, options.items, -1, true)"></md-icon>\n <span class="h4">{{options.labelSelected || \'Selected Items\'}} ({{options.selectedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value" <span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors" ms-scroll>\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n ng-class="{\'has-children\': vm.hasChildren}"\n ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node"\n ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\x3c!-- Input Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n <timer ng-if="vm_pb.registered" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" />\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf(); $event.stopPropagation();">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\x3c!-- Input Area --\x3e\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">{{ (session.user == session.name) ? session.user : (session.name + \' \' + session.user) }}</span>\n <span class="session-info" layout="row" layout="start center">\n <timer interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-radio-group ng-model="vm.prefix">\n <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n </md-radio-group>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.prefix && vm.required">\n <span translate="TOOLBAR.CALL">CALL</span>\n </md-button>\n <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding" ms-scroll>\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label for="ms-search-bar-input">\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="MsSearchBar.expand()" ng-if="!MsSearchBar.resultsLoading || MsSearchBar.collapsed">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="MsSearchBar.resultsLoading && !MsSearchBar.collapsed">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input id="ms-search-bar-input" type="text" placeholder="Search" flex ng-model="MsSearchBar.query" ng-model-options="MsSearchBar.queryOptions" ng-blur="MsSearchBar.blurCollapse()" ng-keydown="MsSearchBar.handleKeydown($event)">\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="MsSearchBar.collapse()" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n\n <div class="ms-search-bar-results" ng-if="MsSearchBar.results" ms-scroll>\n <div class="no-results" ng-if="MsSearchBar.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsSearchBar.results" ng-click="MsSearchBar.handleResultClick(result)" ng-mouseenter="MsSearchBar.handleMouseenter($index)" ng-mousedown="MsSearchBar.absorbEvent($event)" ng-class="{\'selected\': $index == MsSearchBar.selectedResultIndex}" md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n <div class="description" ng-if="result.description">{{result.description}}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ms-scroll ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" ms-scroll>\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n </md-button>\n <div id="bar-container" layout="row" class="bar-container">\n <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n </div>\n </div>\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + widget.attrs[0].value | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground}" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit</md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ms-scroll ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column" ms-scroll>\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n <font color="red">{{vm.message}}</font>\n </b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="icon-google-plus" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="EXTRACTEDREPORTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="EXTRACTEDREPORTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(extractedReport, $event)" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(extractedReport, $event)" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event)" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'report_integration\'">Integration Report</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'cm_lists\'">Lists</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="METRICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="METRICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(metric, $event)" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(metric, $event)" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n </md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules track by $index">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical" class="s16">\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ODBC.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="ODBC.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(odbc, $event)" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestOdbc(odbc, $event)" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(odbc, $event)" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type" ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START URL INPUT --\x3e\n <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END URL INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/permissionadd/permissionadd.html",'<md-dialog class="projects-dialog" aria-label="projects">\n <form name="projectsForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CALLYSQUARE.PERMISSIONADD_PROJECTS">Add User Permissions</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SQUARERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="SQUARERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(squareRecording, $event)" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event)" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHATQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(chatQueue, $event)" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(chatQueue, $event)" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatQueue, $event)" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event)" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event)" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATWEBSITES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(chatWebsite, $event)" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event)" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event)" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatWebsite, $event)" translate="CHAT.AGENTADD_CHATWEBSITE">\n AgentAdd ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event)" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" ng-required="true">\n\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n <form name="chatWebsiteForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",'<md-dialog class="chatDisposition-dialog" aria-label="New ChatDisposition">\n <form name="chatDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatDisposition.name" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatDispositionForm[\'name\'].$error" ng-show="chatDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatDisposition" ng-click="vm.saveChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid || chatDispositionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatDisposition" ng-click="vm.addNewChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATDISPOSITION" translate-attr-aria-label="CHAT.ADD_CHATDISPOSITION">\n ADD CHATDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatDisposition" ng-click="vm.deleteChatDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre>{{vm.message.body}}</pre>\n </md-content>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n <form name="scriptForm" flex="100" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n </form>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'noteTitle\'].$error" ng-show="interactionForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="customerAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{customerAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="systemAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{systemAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CHAT.TYPE\' | translate }}</th>\n <th md-column md-order-by="selector">{{ \'CHAT.SELECTOR\' | translate }}</th>\n <th md-column md-order-by="timeout">{{ \'CHAT.TIMEOUT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.selector}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.timeout}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATDISPOSITIONS">ChatDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event)" aria-label="add chatDisposition" translate translate-attr-label="CHAT.ADD_CHATDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatDispositions.length}} {{vm_dc.selectedChatWebsiteChatDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatDisposition" md-select-id="id" ng-repeat="chatDisposition in vm_dc.chatWebsiteChatDispositions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" translate="CHAT.EDIT_CHATDISPOSITION">\n Edit ChatDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatDisposition, $event)" translate="CHAT.DELETE_CHATDISPOSITION">\n Delete ChatDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATDISPOSITION_AVAILABLE">No chatdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatDispositions.count}}" md-on-paginate="vm_dc.getChatWebsiteChatDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'CHAT.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'CHAT.CLOSEDAT\' | translate }}</th>\n <th md-column>{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column>{{ \'CHAT.AGENT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CHAT.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="ratingValue">{{ \'CHAT.RATING\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'CHAT.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'CHAT.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="interaction.ratingValue != null && (!interaction.ratingType || interaction.ratingType == \'star\')" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:interaction.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 0"></md-icon><span ng-show="interaction.ratingValue == null" translate="CHAT.NO_RATINGVALUE">No ratingValue</span>\n </td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="15">\n <span class="text-boxed-ligth" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>{{offlineMessage.id}}</td>\n <td md-cell>{{ (vm_dc.contacts | filter : {\'id\':offlineMessage.ContactId})[0].firstName }}</td>\n <td md-cell>{{offlineMessage.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'CHAT.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'CHAT.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'CHAT.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'CHAT.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'CHAT.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'CHAT.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'CHAT.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'CHAT.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'CHAT.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'CHAT.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'CHAT.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"CHAT.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"CHAT.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"CHAT.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"CHAT.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"CHAT.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'CHAT.PAGE' | translate}}:', rowsPerPage: '{{'CHAT.ROWSPERPAGE' | translate}}:', of: '{{'CHAT.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/chat/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n <th md-column>{{ \'CHAT.READY\' | translate }}</th>\n <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditChatQueue($event, vm.queues[value])" translate="CHAT.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="CHAT.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="COMPANIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="COMPANIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(company, $event)" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(company, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(company, $event)" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList">\n <md-optgroup label="Lists">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a companie" flex="100" ng-model="vm.selectedCompany">\n <md-optgroup label="Companies">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container ng-init="vm.getAssignedCompanies()">\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone">{{contact.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete"></md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-init="vm.getCustomFields(vm.contact.ListId)" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false"">{{company.name}}</md-option>\n <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions"></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="GLOBALCUSTOMFIELDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="GLOBALCUSTOMFIELDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(globalCustomField, $event)" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event)" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.id}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.alias}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{ vm_dc.arraytype[customField.type].option }}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListVoiceDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.VOICEDISPOSITIONS">VoiceDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListVoiceDisposition($event)" aria-label="add voiceDisposition" translate translate-attr-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListVoiceDispositions.length}} {{vm_dc.selectedListVoiceDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListVoiceDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListVoiceDispositions($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListVoiceDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListVoiceDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CONTACTMANAGER.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="voiceDisposition" md-select-id="id" ng-repeat="voiceDisposition in vm_dc.listVoiceDispositions.rows">\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" translate="CONTACTMANAGER.EDIT_VOICEDISPOSITION">\n Edit VoiceDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(voiceDisposition, $event)" translate="CONTACTMANAGER.DELETE_VOICEDISPOSITION">\n Delete VoiceDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listVoiceDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_VOICEDISPOSITION_AVAILABLE">No voicedisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listVoiceDispositions.count}}" md-on-paginate="vm_dc.getListVoiceDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",'<md-dialog class="voiceDisposition-dialog" aria-label="New VoiceDisposition">\n <form name="voiceDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="" name="name" ng-model="vm.voiceDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="voiceDispositionForm[\'name\'].$error" ng-show="voiceDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceDisposition" ng-click="vm.saveVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid || voiceDispositionForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceDisposition" ng-click="vm.addNewVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_VOICEDISPOSITION" translate-attr-aria-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n ADD VOICEDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceDisposition" ng-click="vm.deleteVoiceDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="LISTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(list, $event)" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(list, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event)" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(list, $event)" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(list, $event)" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.onChangeVoiceQueues()" ng-model="vm.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.voiceQueues.rows">{{ voiceQueue.name }}</md-option>\n </md-select>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <ms-tab-scroll style="overflow: hidden;">\n <div layout="column" ng-repeat="(key, tab) in vm.tabs" ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'"></md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n {{tab.title}} <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </ms-tab-scroll>\n </div>\n <div layout="row" class="agent-content" ng-if="vm.isActiveTab(0)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n <div ng-if="!vm.isActiveTab(0)" ng-repeat="(key, tab) in vm.tabs" ng-switch="tab.type">\n <div ng-switch-when="contact">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup">\n <div ng-if="vm.isActiveTab(tab.id)" ms-scroll ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="bot">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n <div ng-switch-when="interaction">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n <div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n </div>\n <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>\n </div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n <md-card flex="100" class="interaction">\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n \x3c!-- <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40"\n ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{ days > 0 ? days + \'d\' :\n \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div> --\x3e\n </div>\n </div>\n <div layout="row" layout-align="end center">\n\n </div>\n </div>\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages">\n \x3c!-- MESSAGES --\x3e\n <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-switch="message.direction">\n <div>\n <div ng-switch-when="in" class="time secondary-text">\n {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n System - {{message.createdAt | date: \'medium\'}}\n </div>\n <div>\n <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n </div>\n \x3c!-- / MESSAGES --\x3e\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row">\n \x3c!-- MS-CARD --\x3e\n <md-card class="template-7" layout="row" layout-align="space-between" ng-repeat="call in vm.tab.calls track by call.uniqueid">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div layout="row">\n <span ng-if="call.answeredAt" class="text-boxed indigo-100-bg">\n <timer start-time="call.answeredAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <div flex></div>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n <timer start-time="call.disposedAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n <div class="p-16">\n <div class="title h1">\n <md-icon ng-if="!call.routeId" md-font-icon="icon-phone-incoming"></md-icon>\n <md-icon ng-if="call.routeId" md-font-icon="icon-phone-outgoing"></md-icon>\n {{ call.routeId ? call.destcalleridnum : call.calleridnum }}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account"></md-icon>\n Name: {{ call.calleridname }}\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </div>\n </md-card>\n \x3c!-- / MS-CARD --\x3e\n <div flex layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event)" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.jscriptyProjects && vm.jscriptyProjects.rows.length" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon> {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.jscriptyProjects || !vm.jscriptyProjects.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon> No jscripty projects available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event)" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.smsAccounts && vm.smsAccounts.rows.length" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.smsAccounts || !vm.smsAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon> No sms accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event)" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.mailAccounts && vm.mailAccounts.rows.length" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.mailAccounts || !vm.mailAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon> No email accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event)" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.faxAccounts && vm.faxAccounts.rows.length" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.faxAccounts || !vm.faxAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon> No fax accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.tab.Tags" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <form name="vm.socialForm" novalidate></form>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100" layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block" ng-if="!vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.userLists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select ng-disabled="!vm.newContact" name="list" ng-model="vm.contact.ListId" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.choice" required>\n <md-option ng-value="g.name" ng-repeat="g in vm.dispositions.rows">{{ g.name }}</md-option>\n <md-option ng-value="gd.name" ng-repeat="gd in vm.globalDispositions.rows">{{ gd.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n\n <div ng-if="vm.isReschedule">\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n <md-input-container ng-if="!vm.dialerCall" class="md-block">\n <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">{{ queueCampaign.name }} ({{ queueCampaign.dialActive ? \'Active\' : \'Not Active\' }})</md-option>\n </md-select>\n <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n {{(vm.choice ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <div ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n <md-content ng-if="vm.selectedTab==0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <div ng-controller="AgentHomeAbandonedBullController as vm_bull">\n <md-content ng-if="vm.selectedTab==1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.query.filter = query" on-collapse="vm_bull.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_bull.pickerModel.dateStart" ng-click="vm_bull.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_bull.localizationMap" ng-model="vm_bull.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_bull.getAbandonedCalls()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.lastAssignedTo" ng-change="vm_bull.getAbandonedCalls()">\n <md-option ng-value="vm_bull.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_bull.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.queue" ng-change="vm_bull.getAbandonedCalls()">\n <md-option ng-value="vm_bull.defaultQueues" ng-if="vm_bull.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_bull.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName">{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n <td md-cell class="list">{{abandonedCall.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall, abandonedCall.disposition)"></md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm_bull.disposition.length" ng-repeat="disposition in vm_bull.disposition">\n <md-button ng-click="vm_bull.reserved(abandonedCall, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.query.filter = query" on-collapse="vm_voice.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_voice.pickerModel.dateStart" ng-click="vm_voice.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_voice.localizationMap" ng-model="vm_voice.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_voice.getAbandonedCalls()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.lastAssignedTo" ng-change="vm_voice.getAbandonedCalls()">\n <md-option ng-value="vm_voice.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_voice.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.queue" ng-change="vm_voice.getAbandonedCalls()">\n <md-option ng-value="vm_voice.defaultQueues" ng-if="vm_voice.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_voice.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName">{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall, abandonedCall.disposition)"></md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm_voice.disposition.length" ng-repeat="disposition in vm_voice.disposition">\n <md-button ng-click="vm_voice.reserved(abandonedCall, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="md-primary-bg width-50" ms-scroll>\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span></md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div ng-switch="vm_home.sidebar" style="overflow-y: auto" flex>\n <div ng-switch-when="contacts">\n <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="scheduled">\n <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="voice">\n <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="abandoned">\n <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="recordings">\n <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="plugin" layout-fill>\n <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getChatInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_WEBSITE">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getChatInteractions()">\n <md-option ng-value="chatAccount.id" ng-repeat="chatAccount in vm.chatAccounts.rows">{{chatAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getChatInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.WEBSITE\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="chatInteraction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': chatInteraction.unread}">\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{chatInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!chatInteraction.closed && chatInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in chatInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!chatInteraction.closed && chatInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'chat\')" layout-margin>{{chatInteraction.unread}}</span>\n <md-icon ng-if="chatInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(chatInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{chatInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" ng-if="chatInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{chatInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{chatInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!chatInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span ng-if="chatInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="chatInteraction.disposition">- {{chatInteraction.disposition}}</span></span>\n <md-tooltip ng-if="chatInteraction.closed">{{chatInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!chatInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="chatInteraction.substatus"> - {{chatInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(chatInteraction)}}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(chatInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="chatInteraction.Tags.length">\n <div ng-if="chatInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': chatInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{chatInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="chatInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in chatInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, chatInteraction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadChatInteraction($event, chatInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Chat\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card>\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getContacts()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button interaction-new" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact.id)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="Voice">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="Chat">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="Email">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="Sms">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="Open Channel">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="Fax">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getFaxInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.faxAccounts.rows">{{faxAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getFaxInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">{{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="faxInteraction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': faxInteraction.unread}">\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{faxInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!faxInteraction.closed && faxInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in faxInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!faxInteraction.closed && faxInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'fax\')" layout-margin>{{faxInteraction.unread}}</span>\n <md-icon ng-if="faxInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(faxInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{faxInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" ng-if="faxInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{faxInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{faxInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!faxInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span ng-if="faxInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="faxInteraction.disposition">- {{faxInteraction.disposition}}</span></span>\n <md-tooltip ng-if="faxInteraction.closed">{{faxInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!faxInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="faxInteraction.substatus"> - {{faxInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(faxInteraction)}}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(faxInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="faxInteraction.Tags.length">\n <div ng-if="faxInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': faxInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{faxInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="faxInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in faxInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Fax\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getMailInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column" ng-if="vm.query.closed == 0">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_SUBSTATUS">Select a sub status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.substatus" ng-change="vm.getMailInteractions()">\n <md-option ng-repeat="subStatus in vm.subStatuses.rows" ng-value="subStatus.name">{{subStatus.name}}</md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NONE"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getMailInteractions()">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.mailAccounts.rows">{{mailAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getMailInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">{{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject" style="width:200px">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="mailInteraction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': mailInteraction.unread}">\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{mailInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!mailInteraction.closed && mailInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in mailInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!mailInteraction.closed && mailInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'mail\')" layout-margin>{{mailInteraction.unread}}</span>\n <md-icon ng-if="mailInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(mailInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div ng-if="vm.setting.enableEmailPreview && mailInteraction.lastMsgBody" class="tooltip-preview">\n <span class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n <md-card class="tooltip-preview-text" ng-style="{top: \'-\' + ((($index % 10) + 1) * 18) + \'px\'}">\n <md-card-content>{{mailInteraction.lastMsgBody}}<br>...</md-card-content>\n </md-card>\n </div>\n <span ng-if="!mailInteraction.lastMsgBody || !vm.setting.enableEmailPreview" class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{mailInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" ng-if="mailInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{mailInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{mailInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!mailInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span ng-if="mailInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="mailInteraction.disposition">- {{mailInteraction.disposition}}</span></span>\n <md-tooltip ng-if="mailInteraction.closed">{{mailInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!mailInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="mailInteraction.substatus"> - {{mailInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(mailInteraction)}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(mailInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="mailInteraction.Tags.length">\n <div ng-if="mailInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': mailInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{mailInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="mailInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in mailInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, mailInteraction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMailInteraction($event, mailInteraction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMailInteraction($event, mailInteraction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n </md-select>\n </div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getContacts()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button interaction-new" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus "></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getOpenchannelInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">{{openchannelAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getOpenchannelInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)">{{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="openchannelInteraction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': openchannelInteraction.unread}">\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{openchannelInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!openchannelInteraction.closed && openchannelInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in openchannelInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!openchannelInteraction.closed && openchannelInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'openchannel\')" layout-margin>{{openchannelInteraction.unread}}</span>\n <md-icon ng-if="openchannelInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(openchannelInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{openchannelInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" ng-if="openchannelInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{openchannelInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{openchannelInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!openchannelInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span ng-if="openchannelInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="openchannelInteraction.disposition">- {{openchannelInteraction.disposition}}</span></span>\n <md-tooltip ng-if="openchannelInteraction.closed">{{openchannelInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!openchannelInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="openchannelInteraction.substatus"> - {{openchannelInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(openchannelInteraction)}}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(openchannelInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="openchannelInteraction.Tags.length">\n <div ng-if="openchannelInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': openchannelInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{openchannelInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="openchannelInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in openchannelInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Openchannel\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceRecordings()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound" translate="VOICE.INBOUND">Inbound</md-option>\n <md-option value="outbound" translate="VOICE.OUTBOUND">Outbound</md-option>\n <md-option value="dialer" translate="VOICE.DIALER">Dialer</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n \x3c!-- <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar> --\x3e\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getScheduledCalls()" placeholder="{{ \'MOTIONDIALER.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div ng-if="vm.queueCampaigns.count" layout="column">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.VoiceQueueId" ng-change="vm.getScheduledCalls()">\n <md-option ng-value="undefined"><em translate="MOTIONDIALER.ALL">All</em></md-option>\n <md-option ng-value="queueCampaign.id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">{{queueCampaign.name}}</md-option>\n </md-select>\n </div>\n \x3c!-- <div layout="column">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_TYPE">Select type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.recallme" ng-change="vm.getScheduledCalls()">\n <md-option ng-value="undefined"><em translate="MOTIONDIALER.ALL">All</em></md-option>\n <md-option ng-value="1" translate="MOTIONDIALER.RECALLME">Recall me</md-option>\n <md-option ng-value="0" translate="MOTIONDIALER.INQUEUE">Recall in queue</md-option>\n </md-select>\n </div> --\x3e\n <md-button class="md-icon-button" ng-click="vm.getScheduledCalls()" aria-label="refresh scheuled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n <td md-cell>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n <td md-cell>\n <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n </td>\n <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getSmsInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.smsAccounts.rows">{{smsAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getSmsInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">{{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="smsInteraction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': smsInteraction.unread}">\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{smsInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!smsInteraction.closed && smsInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in smsInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!smsInteraction.closed && smsInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'sms\')" layout-margin>{{smsInteraction.unread}}</span>\n <md-icon ng-if="smsInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(smsInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{smsInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" ng-if="smsInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{smsInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{smsInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!smsInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span ng-if="smsInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="smsInteraction.disposition">- {{smsInteraction.disposition}}</span></span>\n <md-tooltip ng-if="smsInteraction.closed">{{smsInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!smsInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="smsInteraction.substatus"> - {{smsInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(smsInteraction)}}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(smsInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="smsInteraction.Tags.length">\n <div ng-if="smsInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': smsInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{smsInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="smsInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in smsInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Sms\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceCalls()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceCalls()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound" translate="VOICE.INBOUND">Inbound</md-option>\n <md-option value="outbound" translate="VOICE.OUTBOUND">Outbound</md-option>\n <md-option value="dialer" translate="VOICE.DIALER">Dialer</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{voiceCall.type}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{voiceCall.userDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }} </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'"></md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'"></div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="!vm.interaction.closed && vm.tab.channel != \'mail\' && vm.tab.channel !== \'fax\' && (vm.tab.channel != \'sms\' || !vm.tab.spy)" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'"></div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'"></md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",'<md-dialog class="compose-dialog-fax" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n \x3c!-- <input ng-model="vm.message.subject" type="text"> --\x3e\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n \x3c!-- <md-icon md-font-icon="icon-close" class="s16"></md-icon> --\x3e\n </md-button>\n </div>\n </div>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-style="{\n \'max-width\': {true: \'620px\', false: \'90%\'}[ vm.secret ],\n \'width\': {true: \'620px\', false: \'100%\'}[ vm.secret ],\n \'max-height\': {true: undefined, false: \'97%\'}[ vm.secret ]\n }">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text">\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button ng-click="vm.deleteAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} - {{ item.value | htmlToPlaintext }}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeOpenchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="OPENCHANNEL.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="OPENCHANNEL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.interaction.disposition" required>\n \x3c!-- <md-select ng-disabled="vm.interaction.closed && vm.interaction.disposition" name="disposition" ng-model="vm.interaction.disposition" required> --\x3e\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-value="d.name" ng-repeat="d in vm.dispositions.rows">{{ d.name }}</md-option>\n <md-option ng-value="gd.name" ng-repeat="gd in vm.globalDispositions.rows">{{ gd.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n \x3c!-- <textarea ng-disabled="vm.interaction.closed && vm.interaction.disposition" ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea> --\x3e\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition(true)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && vm.interaction.disposition" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.interaction.disposition && !vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="vm.interaction.closed" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="transferForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.transfer.type" required>\n <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n </md-select>\n <div ng-messages="transferForm.type.$error" ng-show="transferForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n <label translate="DASHBOARDS.QUEUES">Queues</label>\n <md-select name="queue" ng-model="vm.transfer.id" required>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n <label translate="DASHBOARDS.AGENTS">Agents</label>\n <md-select name="agent" ng-model="vm.transfer.id" required>\n <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows" ng-if="vm.currentUser.id != agent.id">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n TRANSFER\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align "center center" flex>\n <div layout="row" layout-align="center center" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{item.browserName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{item.osName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{item.deviceModel}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{item.referer}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Customer IP</p>\n <h4>{{item.customerIp}}</h4>\n </div>\n </md-list-item>\n <md-divider></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{item.ratingMessage}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel != \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel == \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'"></div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{item.externalUrl}}" target="_blank">\n <h4>{{item.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{item.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-if="item.ChatWebsiteId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-if="item.MailAccountId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{item.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <md-list-item ng-if="item.Tags.length">\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<md-content layout="column" layout-align="end center">\n <div layout-margin>\n <md-input-container>\n <md-select ng-model="vm.channel" placeholder="Channel">\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL">All</md-option>\n <md-option ng-value="\'voice\'" translate="DASHBOARDS.VOICE">Voice</md-option>\n <md-option ng-value="\'chat\'">Chat</md-option>\n <md-option ng-value="\'mail\'">Mail</md-option>\n <md-option ng-value="\'sms\'">Sms</md-option>\n <md-option ng-value="\'fax\'">Fax</md-option>\n <md-option ng-value="\'openchannel\'">Openchannel</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div layout-margin layout="row" layout-align="space-between center">\n <div flex-gt-xs>\n <md-datepicker ng-model="vm.dateFrom" md-placeholder="Enter date"></md-datepicker>\n </div>\n\n <div flex-gt-xs>\n <md-datepicker ng-model="vm.dateTo" md-placeholder="Enter date"></md-datepicker>\n </div>\n </div>\n</md-content>\n\n<div id="timeline" ms-timeline="vm.timelineOptions" layout="column" ng-if="vm.journey && vm.journey.length">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey | getChannelByItem:vm.channel:vm.dateFrom:vm.dateTo | orderBy:\'-createdAt\'">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div class="header p-6" layout="row" layout-align="space-between center">\n\n <md-button class="md-fab md-mini" aria-label="icon-channel" ng-class="vm.getColorByItem(item) + \'-bg\'">\n <md-icon ng-if="item.FaxAccountId" md-font-icon="icon-deskphone"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-google-earth"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email"></md-icon>\n <md-icon ng-if="item.ChatWebsiteId" md-font-icon="icon-hangouts"></md-icon>\n <md-icon ng-if="item.amaflags" md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate">#{{item.id}} - {{ item.Account.key || item.destination }}</span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-hide="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.HIDE_DETAILS">\n Hide Details\n </a>\n </span>\n </div>\n\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n\n </div>\n\n <div ng-if="item.showMore">\n <div ng-if="!item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'"></div>\n <div ng-if="item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'"></div>\n </div>\n\n <md-divider></md-divider>\n\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && !amaflags" class="text-truncate white-fg">\n <span class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} ({{ item.disposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate)}})">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} ({{ item.disposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }})</span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && !item.amaflags" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}<span ng-if="item.substatus"> - {{ item.substatus }}</span></span>\n <span ng-if="item.amaflags" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}">{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate)}}</span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && vm.isMyAccount(item)" ng-disabled="item.amaflags" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction($event, item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</div>\n<div ng-if="!vm.journey || !vm.journey.length" layout="row" layout-align="center center">\n <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{item.type ? item.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4>{{item.source ? item.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4>{{item.destination ? item.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4>{{item.callerid ? item.callerid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{item.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n <h4>{{item.uniqueid ? item.uniqueid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{item.endtime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{item.duration ? item.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{item.note ? item.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{item.subject}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n <h4 ng-if="item.threadId" translate="DASHBOARDS.PUBLIC">Public</h4>\n <h4 ng-if="!item.threadId" translate="DASHBOARDS.PRIVATE">Private</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.timelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">[{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)"><strong>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate">{{ message.originTo || message.to }}</span></div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0"><em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are registered as a</span> <span class="blue-grey">CC</span></em></div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0"><em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are registered as a</span> <span class="red-fg">BCC</span></em></div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail">{{message.from}}</span>\n <span class="detail">{{message.originTo || message.to}}</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="detail" ng-if="message.direction === \'in\' && message.originCc">{{ message.originCc }}</span>\n <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">{{ message.cc }}</span>\n <span class="detail" ng-if="message.direction === \'out\' && message.cc">{{ message.cc }}</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="detail" ng-if="message.bcc">{{message.bcc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'">{{message.from.indexOf(vm.contact.email) >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n \x3c!-- <md-button class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button> --\x3e\n </div>\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!message.attach" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu ng-if="message.attach">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center" class="p-8">\n <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n </md-icon>\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> - {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'"></div>\n </div>\n </div>\n <md-button ng-if="vm.tab.channel !== \'mail\'" class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n Transfer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-menu class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n</md-menu>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n <timer start-time="vm.starttime" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n </md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex ms-scroll>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n \x3c!-- NOTE: aggoiungere nel controller ng-if="vm.hasPermission()" --\x3e\n <md-tabs ng-if="vm.hasPermission()" md-selected="vm.selectedTab" md-dynamic-height>\n <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n <div ui-view="chat"></div>\n </md-tab>\n <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n <div ui-view="mail"></div>\n </md-tab>\n <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n <div ui-view="sms"></div>\n </md-tab>\n <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n <div ui-view="openchannel"></div>\n </md-tab>\n <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n <div ui-view="fax"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasPermission()" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n <form name="faxAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",'<md-dialog class="faxDisposition-dialog" aria-label="New FaxDisposition">\n <form name="faxDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="" name="name" ng-model="vm.faxDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="faxDispositionForm[\'name\'].$error" ng-show="faxDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxDisposition" ng-click="vm.saveFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid || faxDispositionForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxDisposition" ng-click="vm.addNewFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXDISPOSITION" translate-attr-aria-label="FAX.ADD_FAXDISPOSITION">\n ADD FAXDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxDisposition" ng-click="vm.deleteFaxDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountFaxDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.FAXDISPOSITIONS">FaxDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event)" aria-label="add faxDisposition" translate translate-attr-label="FAX.ADD_FAXDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountFaxDispositions.length}} {{vm_dc.selectedFaxAccountFaxDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountFaxDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountFaxDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountFaxDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountFaxDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="faxDisposition" md-select-id="id" ng-repeat="faxDisposition in vm_dc.faxAccountFaxDispositions.rows">\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" translate="FAX.EDIT_FAXDISPOSITION">\n Edit FaxDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(faxDisposition, $event)" translate="FAX.DELETE_FAXDISPOSITION">\n Delete FaxDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountFaxDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="FAX.NO_FAXDISPOSITION_AVAILABLE">No faxdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountFaxDispositions.count}}" md-on-paginate="vm_dc.getFaxAccountFaxDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'FAX.CONTACT\' | translate }}</th>\n <th md-column>{{ \'FAX.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'FAX.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'FAX.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'FAX.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'FAX.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(faxAccount, $event)" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event)" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event)" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxAccount, $event)" translate="FAX.AGENTADD_FAXACCOUNT">\n AgentAdd FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event)" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAXQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(faxQueue, $event)" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(faxQueue, $event)" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxQueue, $event)" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event)" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event)" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.KEY\' | translate }}</th>\n <th md-column>{{ \'FAX.TOTAL\' | translate }}</th>\n <th md-column>{{ \'FAX.IN\' | translate }}</th>\n <th md-column>{{ \'FAX.OUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.faxAccounts[value].name}}</td>\n <td md-cell>{{vm.faxAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ? (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ? (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getfaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'FAX.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'FAX.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'FAX.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'FAX.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'FAX.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'FAX.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'FAX.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'FAX.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'FAX.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'FAX.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'FAX.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"FAX.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"FAX.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"FAX.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"FAX.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"FAX.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'FAX.PAGE' | translate}}:', rowsPerPage: '{{'FAX.ROWSPERPAGE' | translate}}:', of: '{{'FAX.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/fax/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n <th md-column>{{ \'FAX.READY\' | translate }}</th>\n <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditFaxQueue($event, vm.queues[value])" translate="FAX.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="FAX.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column" ms-scroll>\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="DESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(deskAccount, $event)" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event)" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event)" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.option.$error" ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n ADD DYNAMICS365ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dynamics365Accounts-count">\n <span>{{vm.selectedDynamics365Accounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DYNAMICS365ACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="DYNAMICS365ACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="username ">{{dynamics365Account.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="remoteUri ">{{dynamics365Account.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(dynamics365Account, $event)" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n Edit Dynamics365Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event)" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n Test Dynamics365Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event)" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n Delete Dynamics365Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n ADD DYNAMICS365CONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.option.$error" ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="dynamics365Account-image" hide-xs>\n <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.dynamics365Account.id}}\n <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n Delete Dynamics365Configuration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.option.$error" ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FRESHDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="FRESHDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(freshdeskAccount, $event)" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event)" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event)" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.option.$error" ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SALESFORCEACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="SALESFORCEACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(salesforceAccount, $event)" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event)" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event)" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n ADD SERVICENOWACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n ADD SERVICENOWCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.option.$error" ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="servicenowAccount-image" hide-xs>\n <img ng-src="assets/images/business/servicenowAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.servicenowAccount.id}}\n <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n Delete ServicenowConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-servicenowAccounts-count">\n <span>{{vm.selectedServicenowAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SERVICENOWACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="SERVICENOWACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(servicenowAccount, $event)" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n Edit ServicenowAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event)" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n Test ServicenowAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event)" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n Delete ServicenowAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.option.$error" ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SUGARCRMACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="SUGARCRMACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event)" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event)" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event)" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n ADD VTIGERACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n ADD VTIGERCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.option.$error" ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="vtigerAccount-image" hide-xs>\n <img ng-src="assets/images/business/vtigerAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.vtigerAccount.id}}\n <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n Delete VtigerConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-vtigerAccounts-count">\n <span>{{vm.selectedVtigerAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VTIGERACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="VTIGERACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VTIGERACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(vtigerAccount, $event)" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n Edit VtigerAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event)" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n Test VtigerAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event)" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n Delete VtigerAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.option.$error" ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZENDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZENDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(zendeskAccount, $event)" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event)" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event)" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n\n <div ng-messages="zohoAccountForm[\'authToken\'].$error" ng-show="zohoAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n <md-select name="customField" ng-model="vm.customField" required>\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}</md-option>\n </md-optgroup>\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- CUSTOM FIELD --\x3e\n <div ng-if="vm.customField && vm.customField.custom" ng-include="\'/subject.html\'"></div>\n \x3c!-- / CUSTOM FIELD --\x3e\n \x3c!-- STANDARD FIELD --\x3e\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.customField && !vm.customField.custom && !vm.customField.options.length">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <input type="text" name="option" ng-model="vm.item.content" required>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!-- / STANDARD FIELD --\x3e\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string" ng-if="vm.customField.options.length">Options</md-option>\n <md-option value="string" ng-if="!vm.customField.options.length">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>--\x3e\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.option.$error" ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n \n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n \n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}</md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n<\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZOHOACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZOHOACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(zohoAccount, $event)" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event)" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event)" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-ligth" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'JSCRIPTY.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'JSCRIPTY.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'JSCRIPTY.MEMBERNAME\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'JSCRIPTY.CALLERIDNUM\' | translate }}</th>\n <th md-column md-order-by="completed">{{ \'JSCRIPTY.COMPLETE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.calleridnum}}</td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project)">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS">Answers</div>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-ligth" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PROJECTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, $event)" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(project, $event)" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.sessionsgoto(project, $event)" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(project, $event)" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="cservice" ng-model="vm.mailAccount.cservice" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'cservice\'].$error" ng-show="mailAccountForm[\'cservice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.cservice !== undefined && vm.mailAccount.cservice == null && vm.newMailAccount" class="md-block">\n <md-switch ng-model="vm.mailAccount.cauthentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="cuser" ng-model="vm.mailAccount.cuser" ng-required="true">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'cuser\'].$error" ng-show="mailAccountForm[\'cuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="cpassword" ng-model="vm.mailAccount.cpassword" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'cpassword\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAILACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n <form name="mailAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",'<md-dialog class="mailDisposition-dialog" aria-label="New MailDisposition">\n <form name="mailDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.mailDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="mailDispositionForm[\'name\'].$error" ng-show="mailDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailDisposition" ng-click="vm.saveMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid || mailDispositionForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailDisposition" ng-click="vm.addNewMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILDISPOSITION" translate-attr-aria-label="MAIL.ADD_MAILDISPOSITION">\n ADD MAILDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailDisposition" ng-click="vm.deleteMailDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.gotoMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="generalForm[\'fontFamily\'].$error" ng-show="generalForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="generalForm[\'fontSize\'].$error" ng-show="generalForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Imap.service" ng-model="vm.mailAccount.Imap.service" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="imapForm[\'Imap.service\'].$error" ng-show="imapForm[\'Imap.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">connTimeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">connTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">connTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">authTimeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">authTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">authTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Smtp.service" ng-model="vm.mailAccount.Smtp.service" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILDISPOSITIONS">MailDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailDisposition($event)" aria-label="add mailDisposition" translate translate-attr-label="MAIL.ADD_MAILDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailDispositions.length}} {{vm_dc.selectedMailAccountMailDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailDisposition" md-select-id="id" ng-repeat="mailDisposition in vm_dc.mailAccountMailDispositions.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" translate="MAIL.EDIT_MAILDISPOSITION">\n Edit MailDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailDisposition, $event)" translate="MAIL.DELETE_MAILDISPOSITION">\n Delete MailDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILDISPOSITION_AVAILABLE">No maildisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailDispositions.count}}" md-on-paginate="vm_dc.getMailAccountMailDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'MAIL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'MAIL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'MAIL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'MAIL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MAIL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'MAIL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'MAIL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows">\n <td md-cell ng-if="mailAccount.userpic"><img class="avatar" alt="{{mailAccount.name}}" ng-src="api/users/{{mailAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!mailAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="id ">{{mailAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="name ">{{mailAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="key ">{{mailAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="email ">{{mailAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="active ">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifysmtpverifysmtp(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n verifysmtp MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Interactions MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailAccount, $event)" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n goToRealtime MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n AgentAdd MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete MailAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAILQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailQueue, $event)" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(mailQueue, $event)" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailQueue, $event)" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event)" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event)" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILSUBSTATUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAILSUBSTATUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(mailSubstatus, $event)" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event)" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column>{{ \'MAIL.TOTAL\' | translate }}</th>\n <th md-column>{{ \'MAIL.IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.OUT\' | translate }}</th>\n <th md-column>{{ \'MAIL.IMAP_STATUS\' | translate }}</th>\n <th md-column>{{ \'MAIL.SMTP_STATUS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.mailAccounts[value].name}}</td>\n <td md-cell>{{vm.mailAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ? (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ? (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n <div ng-switch="vm.mailAccounts[value].Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="vm.mailAccounts[value].active">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getmailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MAIL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MAIL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MAIL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MAIL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MAIL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'MAIL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MAIL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MAIL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'MAIL.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'MAIL.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MAIL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"MAIL.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"MAIL.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"MAIL.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"MAIL.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"MAIL.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'MAIL.PAGE' | translate}}:', rowsPerPage: '{{'MAIL.ROWSPERPAGE' | translate}}:', of: '{{'MAIL.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/mail/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MAIL.READY\' | translate }}</th>\n <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMailQueue($event, vm.queues[value])" translate="MAIL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MAIL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n <form name="pluginForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description">\n\n <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n ADD PLUGIN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="plugin-image" hide-xs>\n <img ng-src="assets/images/business/plugins.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.plugin.id}}\n <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MARKETPLACE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-plugins-count">\n <span>{{vm.selectedPlugins.length}}</span>\n <span translate="MARKETPLACE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PLUGINS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="PLUGINS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div ng-if="vm.installing">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n </div>\n </md-card>\n </div>\n\n \x3c!-- PLUGIN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.plugins.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n <md-button ng-click="vm.installplugin(plugin, $event)" translate="MARKETPLACE.INSTALL_PLUGIN">\n Install Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(plugin, $event)" translate="MARKETPLACE.EDIT_PLUGIN">\n Edit Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n <md-button ng-click="vm.stopplugin(plugin, $event)" translate="MARKETPLACE.STOP_PLUGIN">\n Stop Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n <md-button ng-click="vm.restartplugin(plugin, $event)" translate="MARKETPLACE.RESTART_PLUGIN">\n Restart Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(plugin, $event)" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n Download Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n <md-button ng-click="vm.uninstallplugin(plugin, $event)" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n Uninstall Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(plugin, $event)" translate="MARKETPLACE.DELETE_PLUGIN">\n Delete Plugin\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PLUGIN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n <span>{{vm.plugin.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n CLONE IVRCAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="10">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="IVRCAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="IVRCAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId})[0].name }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(ivrCampaign, $event)" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(ivrCampaign, $event)" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n clone IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event)" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n CLONE QUEUECAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLAGENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="12">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="QUEUECAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="QUEUECAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(queueCampaign, $event)" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(queueCampaign, $event)" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n clone QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(queueCampaign, $event)" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event)" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event)" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event)" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",' <md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.dispositions.length > 0" ng-repeat="disposition in vm.dispositions">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MOTIONDIALER.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MOTIONDIALER.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MOTIONDIALER.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MOTIONDIALER.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MOTIONDIALER.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'MOTIONDIALER.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'MOTIONDIALER.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MOTIONDIALER.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"MOTIONDIALER.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"MOTIONDIALER.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"MOTIONDIALER.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"MOTIONDIALER.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"MOTIONDIALER.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'MOTIONDIALER.PAGE' | translate}}:', rowsPerPage: '{{'MOTIONDIALER.ROWSPERPAGE' | translate}}:', of: '{{'MOTIONDIALER.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\'\n MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.READY\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ORIGINATED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) + (vm.queues[value].pTalking || 0)}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].message ? (\'MOTIONDIALER.\'+vm.queues[value].message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].dialMethod || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].Trunk ? vm.queues[value].Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{vm.queues[value].dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{vm.queues[value].dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMotionDialerQueue($event, vm.queues[value])" translate="MOTIONDIALER.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n <form name="openchannelAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",'<md-dialog class="openchannelDisposition-dialog" aria-label="New OpenchannelDisposition">\n <form name="openchannelDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.openchannelDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="openchannelDispositionForm[\'name\'].$error" ng-show="openchannelDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelDisposition" ng-click="vm.saveOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid || openchannelDispositionForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelDisposition" ng-click="vm.addNewOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n ADD OPENCHANNELDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelDisposition" ng-click="vm.deleteOpenchannelDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-optgroup label="standard">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="custom">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELDISPOSITIONS">OpenchannelDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event)" aria-label="add openchannelDisposition" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelDisposition" md-select-id="id" ng-repeat="openchannelDisposition in vm_dc.openchannelAccountOpenchannelDispositions.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" translate="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION">\n Edit OpenchannelDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelDisposition, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELDISPOSITION">\n Delete OpenchannelDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELDISPOSITION_AVAILABLE">No openchanneldisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelDispositions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'OPENCHANNEL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'OPENCHANNEL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'OPENCHANNEL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'OPENCHANNEL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'OPENCHANNEL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(openchannelAccount, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event)" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelAccount, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n AgentAdd OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(openchannelQueue, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event)" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'OPENCHANNEL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'OPENCHANNEL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'OPENCHANNEL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'OPENCHANNEL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'OPENCHANNEL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'OPENCHANNEL.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'OPENCHANNEL.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'OPENCHANNEL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"OPENCHANNEL.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"OPENCHANNEL.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"OPENCHANNEL.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"OPENCHANNEL.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"OPENCHANNEL.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'OPENCHANNEL.PAGE' | translate}}:', rowsPerPage: '{{'OPENCHANNEL.ROWSPERPAGE' | translate}}:', of: '{{'OPENCHANNEL.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.READY\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditOpenchannelQueue($event, vm.queues[value])" translate="OPENCHANNEL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n </div>\n <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="preferredimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{preferredimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" ng-required="true">\n\n <div ng-messages="generalForm[\'chatTimeout\'].$error" ng-show="generalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv">\n\n <div ng-messages="generalForm[\'splitSizeCsv\'].$error" ng-show="generalForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf">\n\n <div ng-messages="generalForm[\'splitSizePdf\'].$error" ng-show="generalForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx">\n\n <div ng-messages="generalForm[\'splitSizeXlsx\'].$error" ng-show="generalForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n\n <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" ng-required="true">\n\n <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n\n <div ng-messages="globalForm[\'stunaddr\'].$error" ng-show="globalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n\n <div ng-messages="globalForm[\'turnaddr\'].$error" ng-show="globalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n\n <div ng-messages="globalForm[\'turnusername\'].$error" ng-show="globalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n\n <div ng-messages="globalForm[\'turnpassword\'].$error" ng-show="globalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="motionbarForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" ng-required="vm.general.phoneBarAutoUpdater">\n\n <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n </div>\n <form name="reportForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv">\n\n <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf">\n\n <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx">\n\n <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n </div>\n <form name="agentOmniDesktopInterfaceForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n <md-option ng-value="\'alternate\'">Alternate</md-option>\n <md-option ng-value="\'left\'">Left</md-option>\n <md-option ng-value="\'right\'">Right</md-option>\n </md-select>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div>\n <a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.uuid}}</span></span>\n\n <div layout="column">\n <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.machineUuid}}</span></span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="session in vm.sessions" flex="33">\n <md-list-item class="md-2-line">\n <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n </div>\n </md-list-item>\n\n </div>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <div layout="row">\n <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-content layout="row">\n <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n </md-content>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" autofocus required>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="NETWORKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="NETWORKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(network, $event)" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(network, $event)" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/create/dialog.html",'<md-dialog class="smtp-dialog" aria-label="New Smtp">\n <form name="smtpForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmtp" ng-click="vm.saveSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid || smtpForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmtp" ng-click="vm.addNewSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_SMTP" translate-attr-aria-label="SETTINGS.ADD_SMTP">\n ADD SMTP\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmtp" ng-click="vm.deleteSmtp($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.smtp.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="generalForm[\'Smtp.service\'].$error" ng-show="generalForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n\n <div ng-messages="generalForm[\'Smtp.host\'].$error" ng-show="generalForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n\n <div ng-messages="generalForm[\'Smtp.port\'].$error" ng-show="generalForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="generalForm[\'Smtp.user\'].$error" ng-show="generalForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="generalForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'SMS.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'SMS.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'SMS.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'SMS.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'SMS.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'SMS.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'SMS.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'SMS.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'SMS.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'SMS.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'SMS.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"SMS.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"SMS.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"SMS.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"SMS.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"SMS.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'SMS.PAGE' | translate}}:', rowsPerPage: '{{'SMS.ROWSPERPAGE' | translate}}:', of: '{{'SMS.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/sms/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n <th md-column>{{ \'SMS.READY\' | translate }}</th>\n <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditSmsQueue($event, vm.queues[value])" translate="SMS.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="SMS.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n <form name="smsAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",'<md-dialog class="smsDisposition-dialog" aria-label="New SmsDisposition">\n <form name="smsDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.smsDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="smsDispositionForm[\'name\'].$error" ng-show="smsDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsDisposition" ng-click="vm.saveSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid || smsDispositionForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsDisposition" ng-click="vm.addNewSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSDISPOSITION" translate-attr-aria-label="SMS.ADD_SMSDISPOSITION">\n ADD SMSDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsDisposition" ng-click="vm.deleteSmsDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( (vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSDISPOSITIONS">SmsDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event)" aria-label="add smsDisposition" translate translate-attr-label="SMS.ADD_SMSDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsDispositions.length}} {{vm_dc.selectedSmsAccountSmsDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsDisposition" md-select-id="id" ng-repeat="smsDisposition in vm_dc.smsAccountSmsDispositions.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" translate="SMS.EDIT_SMSDISPOSITION">\n Edit SmsDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsDisposition, $event)" translate="SMS.DELETE_SMSDISPOSITION">\n Delete SmsDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSDISPOSITION_AVAILABLE">No smsdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsDispositions.count}}" md-on-paginate="vm_dc.getSmsAccountSmsDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SMS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'SMS.CONTACT\' | translate }}</th>\n <th md-column>{{ \'SMS.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'SMS.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'SMS.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'SMS.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'SMS.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(smsAccount, $event)" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event)" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsAccount, $event)" translate="SMS.AGENTADD_SMSACCOUNT">\n AgentAdd SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event)" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMSQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(smsQueue, $event)" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(smsQueue, $event)" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsQueue, $event)" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event)" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event)" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="AGENTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="AGENTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name ">{{agent.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar ">{{ vm.arrayshowWebBar[agent.showWebBar].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email ">{{agent.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone ">{{agent.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile ">{{agent.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal ">{{agent.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(agent, $event)" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event)" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(agent, $event)" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak>\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableVideoRecording" aria-label="EnableVideoRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEVIDEORECORDING">EnableVideoRecording</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEAMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="TEAMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(team, $event)" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(team, $event)" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(team, $event)" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TELEPHONES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="TELEPHONES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(telephone, $event)" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(telephone, $event)" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n ADD USERPROFILE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n CLONE USERPROFILE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n <form name="userProfileForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div layout="column" class="padding-bottom-10">\n <div layout="row" class="padding-bottom-10">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.SECTIONS">Sections</label>\n <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n </md-select>\n </md-input-container>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n </md-icon>\n <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <div>\n <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n </md-switch>\n <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n </div>\n <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.REPORT_TYPE">Report Type</label>\n <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n </div>\n </div>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center">\n <div>\n <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n </div>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="userProfile-image" hide-xs>\n <img ng-src="assets/images/business/userProfiles.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.userProfile.id}}\n <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n </div>\n <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="2:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="8px" gt-md-gutter="8px" gt-lg-gutter="16px">\n <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n <md-card-header>\n <md-card-avatar>\n <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n </md-icon>\n <md-tooltip>{{ father.status.info }}</md-tooltip>\n </md-icon>\n </md-card-avatar>\n <md-card-header-text layout-align="center start">\n <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n </md-card-header-text>\n <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-cog"></md-icon>\n </md-button>\n </md-card-actions>\n <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n </md-card-header-text>\n </md-card-header>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-userProfiles-count">\n <span>{{vm.selectedUserProfiles.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERPROFILES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="USERPROFILES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- USERPROFILE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.userProfiles.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(userProfile, $event)" translate="STAFF.EDIT_USERPROFILE">\n Edit UserProfile\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(userProfile, $event)" translate="STAFF.CLONE_USERPROFILE">\n clone UserProfile\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(userProfile, $event)" translate="STAFF.DELETE_USERPROFILE">\n Delete UserProfile\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USERPROFILE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USERPROFILE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.MANAGE_API_KEY\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="STAFF.GENERATE" translate-attr-aria-label="STAFF.GENERATE">\n Generate\n </md-button>\n <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n Delete\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(user, $event)" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(user, $event)" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CANNEDANSWERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CANNEDANSWERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(cannedAnswer, $event)" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event)" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CUSTOMDASHBOARDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="CUSTOMDASHBOARDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(customDashboard, $event)" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(customDashboard, $event)" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event)" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event)" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog class="disposition-dialog" aria-label="New Disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n ADD DISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDispositions =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dispositions-count">\n <span>{{vm.selectedDispositions.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DISPOSITIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="DISPOSITIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DISPOSITION TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dispositions.rows.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n <td md-cell ng-if="disposition.userpic"><img class="avatar" alt="{{disposition.name}}" ng-src="api/users/{{disposition.id}}/avatar" /></td>\n <td md-cell ng-if="!disposition.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{disposition.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">{{disposition.name}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(disposition, $event)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DISPOSITION TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DISPOSITION BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="interval">{{ \'TOOLS.INTERVAL\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.id}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.name}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.interval}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERVALS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(interval, $event)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PAUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="PAUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(pause, $event)" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(pause, $event)" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" ng-required="true">\n\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SCHEDULER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="SCHEDULER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(schedule, $event)" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.runconfirm(schedule, $event)" translate="TOOLS.RUN_SCHEDULE">\n Run Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(schedule, $event)" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SOUNDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="SOUNDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(sound, $event)" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(sound, $event)" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(sound, $event)" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD SOUND BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="TOOLS.UPLOADING">Uploading</span>\n <span>{{vm.sound.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TAGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TAGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(tag, $event)" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(tag, $event)" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEMPLATES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TEMPLATES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(template, $event)" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(template, $event)" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n\n <div ng-messages="triggerForm[\'description\'].$error" ng-show="triggerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" autofocus required ng-disabled="!vm.newAction">\n\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasModulePermissions.Integrations) || !vm.newAction)"> {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTION_BAR\' | translate }} </md-option>\n\n <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n\n <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">AutoCreateContact</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\' && vm.action.data1 == \'POST\'" class="md-block">\n <label translate="TOOLS.BODY">Body</label>\n <textarea name="data7" ng-model="vm.action.data7"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" required>\n <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1301])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zendeskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1306])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.deskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1307])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zohoAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1302])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.salesforceAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1305])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.sugarcrmAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1303])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.freshdeskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'vtiger\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1308])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.vtigerAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'dynamics365\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1309])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.dynamics365Accounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'servicenow\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1310])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.servicenowAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1301])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zendeskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1306])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.deskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1307])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zohoConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1302])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.salesforceConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1305])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.sugarcrmConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1303])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.freshdeskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'vtiger\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1308])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.vtigerConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'dynamics365\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1309])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.dynamics365Configurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'servicenow\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1310])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.servicenowConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" autofocus required>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }} </md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }} </md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }} </md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" autofocus required>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }} </md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }} </md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }} </md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trigger.id}}\n <span ng-if="vm.trigger.name">{{vm.trigger.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trigger.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">AllConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAllConditions.length}} {{vm_dc.selectedTriggerAllConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.triggerAllConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[allCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[allCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>{{allCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.chatAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.mailAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.smsAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.faxAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.openchannelAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>{{ (vm_dc.queues | filter : {\'name\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>{{ (vm_dc.outboundRoutes | filter : {\'id\':allCondition.value})[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAllConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No allcondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerAllConditions.count}}" md-on-paginate="vm_dc.getTriggerAllConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAnyConditions.length}} {{vm_dc.selectedTriggerAnyConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.triggerAnyConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[anyCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[anyCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>{{anyCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.chatAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.mailAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.smsAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.faxAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.openchannelAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>{{ (vm_dc.queues | filter : {\'name\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>{{ (vm_dc.outboundRoutes | filter : {\'id\':anyCondition.value})[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAnyConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerAnyConditions.count}}" md-on-paginate="vm_dc.getTriggerAnyConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerActions.length}} {{vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="action">{{ \'TOOLS.ACTION\' | translate }}</th>\n <th md-column md-order-by="data1">{{ \'TOOLS.TYPE\' | translate }}</th>\n <th md-column md-order-by="data2">{{ \'TOOLS.INFO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayaction[action.action].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>{{ (vm_dc.projects | filter : {\'id\':action.data1})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>{{ vm_dc.browserValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ (vm_dc.lists | filter : {\'id\':action.data1})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ \'TOOLS.\' + vm_dc.autoCreateContact[action.data2].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{ vm_dc.urlForwardValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>{{action.data1}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\' && action.data1 == \'POST\'" md-cell>{{action.data7}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>{{ vm_dc.integrationValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>{{ (vm_dc.zendeskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>{{ (vm_dc.deskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>{{ (vm_dc.zohoAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>{{ (vm_dc.salesforceAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>{{ (vm_dc.sugarcrmAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>{{ (vm_dc.freshdeskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>{{ (vm_dc.vtigerAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>{{ (vm_dc.dynamics365Accounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>{{ (vm_dc.servicenowAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>{{ vm_dc.motionbarValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'2\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'0\'" md-cell>{{ (vm_dc.templates | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'0\'" md-cell>{{ (vm_dc.templates | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\n Edit Action\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\n Delete Action\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\n <td md-cell colspan="44">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ACTION_AVAILABLE">No action available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerActions.count}}" md-on-paginate="vm_dc.getTriggerActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-triggers-count">\n <span>{{vm.selectedTriggers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRIGGERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td md-cell ng-if="trigger.userpic"><img class="avatar" alt="{{trigger.name}}" ng-src="api/users/{{trigger.id}}/avatar" /></td>\n <td md-cell ng-if="!trigger.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trigger.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{trigger.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{trigger.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">{{ \'TOOLS.\' + vm.arraychannel[trigger.channel].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trigger.status ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="description ">{{trigger.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(trigger, $event)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.triggers.count}}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n CLONE TRUNK\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRUNKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TRUNKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(trunk, $event)" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(trunk, $event)" translate="TOOLS.CLONE_TRUNK">\n clone Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event)" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trunk, $event)" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VARIABLES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="VARIABLES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(variable, $event)" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(variable, $event)" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHANSPIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="CHANSPIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(chanSpy, $event)" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event)" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTEXTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="CONTEXTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(context, $event)" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(context, $event)" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/create/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/agi/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'project\'].$error" ng-show="inboundrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'app\'].$error" ng-show="inboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/dial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'tech\'].$error" ng-show="inboundrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'trunk\'].$error" ng-show="inboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'phone\'].$error" ng-show="inboundrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/goto/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'context\'].$error" ng-show="inboundrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'extension\'].$error" ng-show="inboundrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'priority\'].$error" ng-show="inboundrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/hangup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }} </md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }} </md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }} </md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }} </md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }} </md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }} </md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }} </md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }} </md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }} </md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users" ng-disabled="user.canSelect === false">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'user\'].$error" ng-show="inboundrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/playback/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds" ng-disabled="appdata.canSelect === false">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/queue/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'queue\'].$error" ng-show="inboundrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'URL\'].$error" ng-show="inboundrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'sound\'].$error" ng-show="inboundrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'agi\'].$error" ng-show="inboundrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'macro\'].$error" ng-show="inboundrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'gosub\'].$error" ng-show="inboundrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'rule\'].$error" ng-show="inboundrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'position\'].$error" ng-show="inboundrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users" ng-disabled="multipleUsers.canSelect === false">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'multipleUsers\'].$error" ng-show="inboundrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/set/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="name.name" ng-repeat="name in vm.variables" ng-disabled="name.canSelect === false">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'name\'].$error" ng-show="inboundrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'value\'].$error" ng-show="inboundrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'voiceMail\'].$error" ng-show="inboundrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/view.html",'<div id="voice-inboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inboundroutes-button md-icon-button" aria-label="Go to inboundroutes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="inboundroute-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundroute.id}}\n <span ng-if="vm.inboundroute.name">{{vm.inboundroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.inboundroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInboundRouteApps.length}} {{vm_ac.selectedInboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedInboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.inboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.inboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/inboundroutes/inboundroutes.html",'<div id="inboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-inboundroutes-count">\n <span>{{vm.selectedInboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="INBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="inboundroute" md-select-id="id" ng-repeat="inboundroute in vm.inboundroutes.rows">\n <td md-cell ng-if="inboundroute.userpic"><img class="avatar" alt="{{inboundroute.name}}" ng-src="api/users/{{inboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!inboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{inboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="id ">{{inboundroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="exten ">{{inboundroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="description ">{{inboundroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(inboundroute, $event)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(inboundroute, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.inboundroutes.count}}" md-on-paginate="vm.getInboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INBOUNDROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inboundroute-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inboundroute" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalroutes/create/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/agi/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'project\'].$error" ng-show="internalrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/custom/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'app\'].$error" ng-show="internalrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/dial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'tech\'].$error" ng-show="internalrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'trunk\'].$error" ng-show="internalrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'phone\'].$error" ng-show="internalrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/goto/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'context\'].$error" ng-show="internalrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'extension\'].$error" ng-show="internalrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'priority\'].$error" ng-show="internalrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/hangup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }} </md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }} </md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }} </md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }} </md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }} </md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }} </md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }} </md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }} </md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }} </md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users" ng-disabled="user.canSelect === false">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'user\'].$error" ng-show="internalrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/playback/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds" ng-disabled="appdata.canSelect === false">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/queue/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'queue\'].$error" ng-show="internalrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'URL\'].$error" ng-show="internalrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'sound\'].$error" ng-show="internalrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'agi\'].$error" ng-show="internalrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'macro\'].$error" ng-show="internalrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'gosub\'].$error" ng-show="internalrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'rule\'].$error" ng-show="internalrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'position\'].$error" ng-show="internalrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users" ng-disabled="multipleUsers.canSelect === false">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'multipleUsers\'].$error" ng-show="internalrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/set/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="name.name" ng-repeat="name in vm.variables" ng-disabled="name.canSelect === false">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'name\'].$error" ng-show="internalrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'value\'].$error" ng-show="internalrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'voiceMail\'].$error" ng-show="internalrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/view.html",'<div id="voice-internalroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internalroutes-button md-icon-button" aria-label="Go to internalroutes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="internalroute-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalroute.id}}\n <span ng-if="vm.internalroute.name">{{vm.internalroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internalroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internalroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InternalRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.internalroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInternalRouteApps.length}} {{vm_ac.selectedInternalRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedInternalRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInternalRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.internalrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInternalRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.internalrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/internalroutes/internalroutes.html",'<div id="internalroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-internalroutes-count">\n <span>{{vm.selectedInternalRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERNALROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInternalRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInternalRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internalroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="INTERNALROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INTERNALROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="internalroute" md-select-id="id" ng-repeat="internalroute in vm.internalroutes.rows">\n <td md-cell ng-if="internalroute.userpic"><img class="avatar" alt="{{internalroute.name}}" ng-src="api/users/{{internalroute.id}}/avatar" /></td>\n <td md-cell ng-if="!internalroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{internalroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="id ">{{internalroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="exten ">{{internalroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="description ">{{internalroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(internalroute, $event)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(internalroute, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.internalroutes.count}}" md-on-paginate="vm.getInternalRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERNALROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERNALROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internalroute-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internalroute" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERNALROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>{{mohSound.id}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{mohSound.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMusicOnHoldDownload(mohSound, $event)" translate="VOICE.DOWNLOAD_MOHSOUND">\n Download MohSound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MUSICONHOLDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(musiconhold, $event)" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event)" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/create/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'app\'].$error" ng-show="outboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'appdata\'].$error" ng-show="outboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/outbounddial/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.outbounddial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'trunk\'].$error" ng-show="outboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.outbounddial.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n <div ng-messages="outboundrouteFormApp[\'callerID\'].$error" ng-show="outboundrouteFormApp[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.outbounddial.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'prefix\'].$error" ng-show="outboundrouteFormApp[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.outbounddial.tag" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'--\'">None</md-option>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'tag\'].$error" ng-show="outboundrouteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.outbounddial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'timeout\'].$error" ng-show="outboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.outbounddial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'options\'].$error" ng-show="outboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.outbounddial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'url\'].$error" ng-show="outboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/view.html",'<div id="voice-outboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outboundroutes-button md-icon-button" aria-label="Go to outboundroutes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="outboundroute-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundroute.id}}\n <span ng-if="vm.outboundroute.name">{{vm.outboundroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OutboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.outboundroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOutboundRouteApps.length}} {{vm_ac.selectedOutboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOutboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOutboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.outboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOutboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.outboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/outboundroutes.html",'<div id="outboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-outboundroutes-count">\n <span>{{vm.selectedOutboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OUTBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOutboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOutboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="OUTBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OUTBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="outboundroute" md-select-id="id" ng-repeat="outboundroute in vm.outboundroutes.rows">\n <td md-cell ng-if="outboundroute.userpic"><img class="avatar" alt="{{outboundroute.name}}" ng-src="api/users/{{outboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!outboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{outboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="id ">{{outboundroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="exten ">{{outboundroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="description ">{{outboundroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(outboundroute, $event)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(outboundroute, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.outboundroutes.count}}" md-on-paginate="vm.getOutboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OUTBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OUTBOUNDROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outboundroute-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outboundroute" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OUTBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",' <md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.dispositions.length > 0" ng-repeat="disposition in vm.dispositions">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"VOICE.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"VOICE.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"VOICE.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell>\n {{call.calleridname}}, {{call.calleridnum}} <span class="text-boxed" ng-if="call.answered">\n <timer ng-if="call.answertime" start-time="call.answertime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\'\n VOICE.NAME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n <th md-column>{{ \'VOICE.READY\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) }}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditVoiceQueue($event, vm.queues[value])" translate="VOICE.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="VOICE.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'VOICE.CALLER_ID\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="stamp">{{ \'VOICE.RECEIVED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>{{message.id}}</td>\n <td md-cell>{{message.callerid}}</td>\n <td md-cell>{{message.duration}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{message.stamp | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMailMessageDownload(message, $event)" translate="VOICE.DOWNLOAD_MESSAGE">\n Download Message\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEMAILS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(voicemail, $event)" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voicemail, $event)" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n <form name="voicePrefixForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n </md-select>\n <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/"(.*)"\\s<(.*?)>$/">\n\n <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/"(.*)"\\s<(.*?)>$/\' }">CallerIdAll must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n ADD VOICEPREFIX\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicePrefixes-count">\n <span>{{vm.selectedVoicePrefixes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEPREFIXES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICEPREFIXES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEPREFIX TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId})[0].exten }}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(voicePrefix, $event)" translate="VOICE.EDIT_VOICEPREFIX">\n Edit voicePrefix\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voicePrefix, $event)" translate="VOICE.AGENTADD_VOICEPREFIX">\n AgentAdd voicePrefix\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voicePrefix, $event)" translate="VOICE.DELETE_VOICEPREFIX">\n Delete voicePrefix\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEPREFIX TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknoww</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'FALSE\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Default</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICEQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(voiceQueue, $event)" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event)" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event)" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event)" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event)" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n \x3c!-- DATE FILTER --\x3e\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE_RANGE">Select Date Range</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearDateFilter()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.CLEAR\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n \x3c!-- /DATE FILTER --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum ">{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten ">{{voiceRecording.exten}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum ">{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername ">{{voiceRecording.membername}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event)" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main animate-slide-left" ng-hide="vm_ct.user">\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search" <md-option ng-value="undefined">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online\n </md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline\n </md-option>\n </md-select>\n </div>\n </md-subheader>\n \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n <option ng-value="undefined">All</option>\n <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n </select> --\x3e\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">\n {{vm_ct.unreadMessage[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n {{user.lastMessageAt | formatdate}}</p>\n </div>\n </div>\n </md-list-item>\n </md-list>\n</div>\n\n<div class="chat animate-slide-right" ng-show="vm_ct.user" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main animate-slide-left" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat animate-slide-right" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()" ms-scroll>\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() | uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32"></md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span translate="{{lang.translation}}">{{lang.title}}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">{{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">Preview</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div layout="row" ng-if="vm.preview">\n <div class="md-padding md-margin" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ID">ID</label>\n <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ vm.customFieldsMap[key] || key }}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n <md-button class="md-icon-button md-primary" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n <md-icon md-font-icon="icon-chevron-left"></md-icon>\n </md-button>\n <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n <md-icon md-font-icon="icon-chevron-right"></md-icon>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file
+!function(){"use strict";angular.module("app.auth",[])}(),function(){"use strict";angular.module("app.core",["ngAnimate","ngAria","ngCookies","ngMessages","ngResource","ngSanitize","ngMaterial","pascalprecht.translate","ui.router","gridster","ds.clock","angucomplete-alt"])}(),function(){"use strict";function e(e,t){e.state("app.errors_error-404",{url:"/errors/error-404",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-404":{templateUrl:"app/errors/404/error-404.html",controller:"Error404Controller as vm"}},params:{status:404,statusText:"",data:{},config:{}},bodyClass:"error-404"}),t.addPart("app/errors/404")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-404",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.errors_error-500",{url:"/errors/error-500",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.errors_error-500":{templateUrl:"app/errors/500/error-500.html",controller:"Error500Controller as vm"}},params:{status:500,statusText:"",data:{},config:{}},bodyClass:"error-500"}),t.addPart("app/errors/500")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.errors.error-500",[]).config(e)}(),function(){"use strict";angular.module("app.errors",["app.errors.error-404","app.errors.error-500"])}(),function(){"use strict";function e(e){e.addPart("app/footer")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.footer",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.forgot",{url:"/forgot",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.forgot":{templateUrl:"app/forgot/forgot.html",controller:"ForgotPasswordController as vm"}},bodyClass:"forgot"}),t.addPart("app/forgot")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.forgot",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/header")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.header",[]).config(e)}(),function(){"use strict";angular.module("motion",["angular-toasty","app.core","app.auth","app.navigation","app.toolbar","app.quick-panel","app.header","app.footer","app.dashboards","app.staff","app.contactmanager","app.voice","app.chat","app.mail","app.sms","app.openchannel","app.fax","app.tools","app.callysquare","app.analytics","app.integrations","app.settings","app.motiondialer","app.help","app.jscripty","app.marketplace","app.plugins","app.login","app.forgot","app.reset","app.errors"])}(),function(){"use strict";function e(e,t){e.state("app.login",{url:"/login?token&userId",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.login":{templateUrl:"app/login/login.html",controller:"LoginController as vm"}},bodyClass:"login"}),t.addPart("app/login")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.login",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.analytics",{abstract:!0,url:"/analytics"}).state("app.analytics.metrics",{url:"/metrics",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/metrics/metrics.html",controller:"MetricsController as vm"}},resolve:{metrics:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("analyticMetric@get",{fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Metrics",fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1201})}]},authenticate:!0,permissionId:1201,bodyClass:"analytics"}).state("app.analytics.extractedReports",{url:"/extractedReports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/extractedReports/extractedReports.html",controller:"ExtractedReportsController as vm"}},resolve:{extractedReports:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("analyticExtractedReport@get",{fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ExtractedReports",fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1202})}]},authenticate:!0,permissionId:1202,bodyClass:"analytics"}),t.addPart("app/main/apps/analytics")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.analytics",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.analytics.reports"]).config(e)}(),function(){"use strict";function e(e){e.state("app.analytics.reports",{url:"/reports",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/reports.html",controller:"ReportsController as vm"}},resolve:{treeReports:["apiResolver",function(e){return e.resolve("analyticTreeReport@get",{fields:"id,tree",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"}).state("app.analytics.reports.edit",{url:"/:id?tab",views:{"content@app":{templateUrl:"app/main/apps/analytics/views/reports/edit/view.html",controller:"ReportController as vm"}},resolve:{report:["apiResolver","$stateParams","$q","describeTable",function(e,t,a,i){var s;return e.resolve("analyticCustomReport@get",{fields:"createdAt,updatedAt,id,name,description,table,conditions,joins",id:t.id}).then(function(e){var t=[];if((s=e).joins)try{s.joins=JSON.parse(s.joins);for(var n=0;n<s.joins.length;n+=1)t.push(i.getColumns(s.joins[n].foreignTable))}catch(e){console.log(e)}return a.all(t)}).then(function(e){for(var t=0;t<e.length;t+=1)s.joins[t].foreignTableFields=_.difference(_.keys(e[t]),["$promise","$resolved"]);return s})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1203})}]},authenticate:!0,permissionId:1203,bodyClass:"analytics"})}e.$inject=["$stateProvider"],angular.module("app.analytics.reports",["ngJsTree"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.callysquare",{abstract:!0,url:"/callysquare"}).state("app.callysquare.odbcs",{url:"/odbcs",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/odbcs/odbcs.html",controller:"OdbcsController as vm"}},resolve:{odbcs:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ODBC",fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1101})}]},authenticate:!0,permissionId:1101,bodyClass:"callysquare"}).state("app.callysquare.squareRecordings",{url:"/squareRecordings",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",controller:"SquareRecordingsController as vm"}},resolve:{squareRecordings:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareRecording@get",{fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareRecordings",fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1102})}]},authenticate:!0,permissionId:1102,bodyClass:"callysquare"}),t.addPart("app/main/apps/callysquare")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.callysquare",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.callysquare.projects"]).config(e)}(),function(){"use strict";function e(e){e.state("app.callysquare.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/projects.html",controller:"ProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name,description,notes",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"}).state("app.callysquare.projects.edit",{url:"/:id",views:{"content@app":{templateUrl:"app/main/apps/callysquare/views/projects/edit/view.html",controller:"ProjectController as vm"}},params:{crudPermissions:void 0},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("squareProject@get",{id:t.id})}],users:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,role",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Users",mergeResources:!0,fields:"id,fullname,role",sort:"name",nolimit:!0})}],trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",sort:"name",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",type:"inbound",fields:"id,name",sort:"name",nolimit:!0})}],sounds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("sound@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Sounds",fields:"id,name",sort:"name",nolimit:!0})}],variables:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("variable@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Variables",fields:"id,name",sort:"name",nolimit:!0})}],databases:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareOdbc@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ODBC",fields:"id,name",sort:"name",nolimit:!0})}],projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("squareProject@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SquareProjects",fields:"id,name",sort:"name",nolimit:!0})}],contexts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceContext@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Contexts",fields:"id,name",sort:"name",nolimit:!0})}],intervals:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("interval@get",{fields:"id,name,IntervalId",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Intervals",fields:"id,name,IntervalId",sort:"name",nolimit:!0})}],mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"id,name",sort:"name",nolimit:!0})}],templates:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("template@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Templates",fields:"id,name",sort:"name",nolimit:!0})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"name",nolimit:!0})}],smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"id,name",sort:"name",nolimit:!0})}],pauses:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("pause@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Pauses",fields:"id,name",sort:"name",nolimit:!0})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1103})}]},authenticate:!0,permissionId:1103,bodyClass:"callysquare"})}e.$inject=["$stateProvider"],angular.module("app.callysquare.projects",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.chat",{abstract:!0,url:"/chat"}).state("app.chat.chatQueues",{url:"/chatQueues",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/chatQueues.html",controller:"ChatQueuesController as vm"}},resolve:{chatQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatQueues.edit",{url:"/:id?tab",params:{chatQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatQueues/edit/view.html",controller:"ChatQueueController as vm"}},resolve:{chatQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("chatQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}]},authenticate:!0,permissionId:501,bodyClass:"chat"}).state("app.chat.chatWebsites",{url:"/chatWebsites",views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/chatWebsites.html",controller:"ChatWebsitesController as vm"}},resolve:{chatWebsites:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}).state("app.chat.chatWebsites.edit",{url:"/:id?tab",params:{chatWebsite:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/chat/views/chatWebsites/edit/view.html",controller:"ChatWebsiteController as vm"}},resolve:{chatWebsite:["apiResolver","$stateParams",function(e,t){return e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:502})}]},authenticate:!0,permissionId:502,bodyClass:"chat"}),t.addPart("app/main/apps/chat")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.chat",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.chat.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.chat.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/chat/views/realtime/realtime.html",controller:"ChatRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:510})}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.agents",{url:"/agents",controller:"AgentsChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:510}).state("app.chat.realtime.queues",{url:"/queues",controller:"QueuesChatRealtimeController as vm",templateUrl:"app/main/apps/chat/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatQueues",channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getChatQueues")}]},authenticate:!0,permissionId:510})}e.$inject=["$stateProvider"],angular.module("app.chat.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.contactmanager",{abstract:!0,url:"/contactmanager"}).state("app.contactmanager.lists",{url:"/lists",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/lists.html",controller:"ListsController as vm"}},resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.lists.edit",{url:"/:id?tab",params:{list:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/lists/edit/view.html",controller:"ListController as vm"}},resolve:{list:["apiResolver","$stateParams",function(e,t){return e.resolve("cmList@get",{fields:"createdAt,updatedAt,id,name,description,dialPrefix",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:301})}]},authenticate:!0,permissionId:301,bodyClass:"contactmanager"}).state("app.contactmanager.companies",{url:"/companies",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/companies.html",controller:"CompaniesController as vm"}},resolve:{companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.companies.edit",{url:"/:id?tab",params:{company:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/companies/edit/view.html",controller:"CompanyController as vm"}},resolve:{company:["apiResolver","$stateParams",function(e,t){return e.resolve("cmCompany@get",{fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:302})}]},authenticate:!0,permissionId:302,bodyClass:"contactmanager"}).state("app.contactmanager.globalCustomFields",{url:"/globalCustomFields",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",controller:"GlobalCustomFieldsController as vm"}},resolve:{globalCustomFields:["apiResolver","Auth",function(e,t){return e.resolve("cmCustomField@get",{fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:304})}]},authenticate:!0,permissionId:304,bodyClass:"contactmanager"}),t.addPart("app/main/apps/contactmanager")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.contactmanager",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.contactmanager.contacts"]).config(e)}(),function(){"use strict";function e(e){e.state("app.contactmanager.contacts",{url:"/contacts?ListId&CompanyId",views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/contacts.html",controller:"ContactsController as vm"}},resolve:{contacts:["apiResolver","Auth","$stateParams",function(e,t,n){return t.hasRole("admin")?e.resolve("cmContact@get",_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0},n)):e.resolve("userProfile@getResources",_.merge({id:t.getCurrentUser().userProfileId,section:"Contacts",includeAll:!0,sort:"-updatedAt",limit:10,offset:0},n))}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",limit:10,offset:0})}],listsMap:["lists",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name",sort:"name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"id,name",sort:"name",nolimit:!0})}],companiesMap:["companies",function(e){for(var t={},n=0;n<e.rows.length;n++)t[e.rows[n].id]=e.rows[n].name;return t}],tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get",{fields:"id,name",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags",fields:"id,name",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"}).state("app.contactmanager.contacts.edit",{url:"/:id?tab",params:{crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/contactmanager/views/contacts/edit/view.html",controller:"ContactController as vm"}},resolve:{contact:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@get",{id:t.id}).then(function(e){return e.dateOfBirth&&(e.dateOfBirth=new Date(e.dateOfBirth)),e}).catch(function(e){console.error(e)})}],hoppers:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHoppers",{id:t.id,fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,offset:0})}],finals:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperFinals",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,offset:0})}],histories:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getHopperHistories",{id:t.id,fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,offset:0})}],jscriptySessions:["apiResolver","$stateParams",function(e,t){return e.resolve("cmContact@getJscriptySessions",{id:t.id,fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,offset:0})}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get"):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies"})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",sort:"-updatedAt",nolimit:!0})}],customFields:["apiResolver","contact",function(e,t){return t.ListId?e.resolve("cmList@getCustomFields",{id:t.ListId}):null}],tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get"):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags"})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:303})}]},authenticate:!0,permissionId:303,bodyClass:"contactmanager"})}e.$inject=["$stateProvider"],angular.module("app.contactmanager.contacts",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.dashboards",{abstract:!0,url:"/dashboards"}),t.addPart("app/main/apps/dashboards")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.dashboards",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.dashboards.general","app.dashboards.custom"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.custom",{url:"/custom/:id",views:{"content@app":{templateUrl:"app/main/apps/dashboards/views/custom/custom.html",controller:"DashboardCustomController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(t,e){var a;return(e.hasRole("admin")?t.resolve("voiceQueue@get",{fields:"id,name",nolimit:!0}):t.resolve("userProfile@getResources",{id:e.getCurrentUser().userProfileId,section:"VoiceQueues",mergeResources:!0,fields:"id,name",channel:"voice",nolimit:!0})).then(function(e){return a=e,t.resolve("rpc@getVoiceQueues")}).then(function(e){if(e)for(var t,n=0;n<e.rows.length;n+=1)(t=_.find(a.rows,{id:e.rows[n].id}))&&_.merge(t,_.pick(e.rows[n],["waiting","total","talking","answered","unmanaged","abandoned"]));return a})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:100})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.custom",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general",{url:"/general",data:{selectedTab:0},views:{"content@app":{templateProvider:["$stateParams","$templateFactory","Auth",function(e,t,n){var a=n.getCurrentUser();return a&&"agent"===a.role?t.fromUrl("app/main/apps/dashboards/views/general/agent/agent.general.html",e):t.fromUrl("app/main/apps/dashboards/views/general/user/user.general.html",e)}],controllerProvider:["Auth",function(e){var t=e.getCurrentUser();return t&&"agent"===t.role?"AgentDashboardGeneralController as vm":"UserDashboardGeneralController as vm"}]}},resolve:{globalUserLists:["apiResolver","Auth",function(e,t){return e.resolve("user@getLists",{id:t.getCurrentUser().id,sort:"name",nolimit:!0})}],globalLists:["apiResolver","Auth",function(e,t){return e.resolve("cmList@get",{sort:"name",nolimit:!0})}],globalTags:["apiResolver",function(e){return e.resolve("tag@get",{sort:"name",nolimit:!0})}],globalCompanies:["apiResolver",function(e){return e.resolve("cmCompany@get",{sort:"name",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general",["ngMaterialDateRangePicker","app.dashboards.general.user"]).config(e)}(),function(){"use strict";function e(e){e.state("app.dashboards.general.voice",{url:"/voice",data:{selectedTab:0},views:{voice:{templateUrl:"app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",controller:"UserVoiceDashboardGeneralController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],inboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"inbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"id,name",type:"inbound",channel:"voice",nolimit:!0})}],outbound:["apiResolver",function(e){return e.resolve("rpc@getOutbound")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.dialer",{url:"/dialer",data:{selectedTab:1},views:{dialer:{templateUrl:"app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",controller:"UserVoiceDashboardDialerController as vm"}},resolve:{rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}],outboundQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"id,name",type:"outbound",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"id,name",type:"outbound",channel:"voice",nolimit:!0})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.chat",{url:"/chat",data:{selectedTab:2},views:{chat:{templateUrl:"app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",controller:"UserChatDashboardGeneralController as vm"}},resolve:{chatInteractions:["apiResolver",function(e){return e.resolve("chatInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],chatWebsites:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("chatWebsite@get",{fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChatWebsites",fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,header_offline,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardTranscript,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.mail",{url:"/mail",data:{selectedTab:3},views:{mail:{templateUrl:"app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",controller:"UserMailDashboardGeneralController as vm"}},resolve:{mailInteractions:["apiResolver",function(e){return e.resolve("mailInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.sms",{url:"/sms",data:{selectedTab:4},views:{sms:{templateUrl:"app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",controller:"UserSmsDashboardGeneralController as vm"}},resolve:{smsInteractions:["apiResolver",function(e){return e.resolve("smsInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,phone,type,accountSid,authId,authToken,smsMethod,username,password,senderString,deliveryReport,waitForTheAssignedAgent,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.openchannel",{url:"/openchannel",data:{selectedTab:5},views:{openchannel:{templateUrl:"app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",controller:"UserOpenchannelDashboardGeneralController as vm"}},resolve:{openchannelInteractions:["apiResolver",function(e){return e.resolve("openchannelInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],openchannelAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,description,receiveUri,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",nolimit:!0})}]},authenticate:!0,bodyClass:"dashboards"}).state("app.dashboards.general.fax",{url:"/fax",data:{selectedTab:6},views:{fax:{templateUrl:"app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",controller:"UserFaxDashboardGeneralController as vm"}},resolve:{faxInteractions:["apiResolver",function(e){return e.resolve("faxInteraction@get",{dateStart:moment().startOf("day").toString(),dateEnd:moment().endOf("day").toString()})}],faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,acceptMethod,acceptUrl,rejectMethod,rejectUrl,closeMethod,closeUrl,notificationSound,notificationShake,notificationTemplate",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,bodyClass:"dashboards"})}e.$inject=["$stateProvider"],angular.module("app.dashboards.general.user",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.fax",{abstract:!0,url:"/fax"}).state("app.fax.faxQueues",{url:"/faxQueues",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/faxQueues.html",controller:"FaxQueuesController as vm"}},resolve:{faxQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxQueues.edit",{url:"/:id?tab",params:{faxQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxQueues/edit/view.html",controller:"FaxQueueController as vm"}},resolve:{faxQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("faxQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}]},authenticate:!0,permissionId:901,bodyClass:"fax"}).state("app.fax.faxAccounts",{url:"/faxAccounts",views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/faxAccounts.html",controller:"FaxAccountsController as vm"}},resolve:{faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}).state("app.fax.faxAccounts.edit",{url:"/:id?tab",params:{faxAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/fax/views/faxAccounts/edit/view.html",controller:"FaxAccountController as vm"}},resolve:{faxAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("faxAccount@get",{fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}]},authenticate:!0,permissionId:902,bodyClass:"fax"}),t.addPart("app/main/apps/fax")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.fax",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.fax.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.fax.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/fax/views/realtime/realtime.html",controller:"FaxRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:910})}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.agents",{url:"/agents",controller:"AgentsFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.trunks",{url:"/trunks",controller:"TrunksFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.queues",{url:"/queues",controller:"QueuesFaxRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxQueues",channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:901})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getFaxQueues")}]},authenticate:!0,permissionId:910}).state("app.fax.realtime.accounts",{url:"/accounts",controller:"FaxAccountsRealtimeController as vm",templateUrl:"app/main/apps/fax/views/realtime/accounts/view.html",resolve:{faxAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("faxAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FaxAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:902})}],rpcFaxAccounts:["apiResolver",function(e){return e.resolve("rpc@getFaxAccounts")}]},authenticate:!0,permissionId:910})}e.$inject=["$stateProvider"],angular.module("app.fax.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.help",{abstract:!0,url:"/help"}),t.addPart("app/main/apps/help")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.help",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.help.about"]).config(e)}(),function(){"use strict";function e(e){e.state("app.help.about",{url:"/about",views:{"content@app":{templateUrl:"app/main/apps/help/views/about/about.html",controller:"AboutController as vm"}},resolve:{info:["apiResolver",function(e){return e.resolve("version@get")}]},authenticate:!0,permissionId:1600,bodyClass:"help"})}e.$inject=["$stateProvider"],angular.module("app.help.about",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.integrations",{abstract:!0,url:"/integrations"}).state("app.integrations.zendeskAccounts",{url:"/zendeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",controller:"ZendeskAccountsController as vm"}},resolve:{zendeskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ZendeskAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.zendeskAccounts.edit",{url:"/:id?tab",params:{zendeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/view.html",controller:"ZendeskAccountController as vm"}},resolve:{zendeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZendeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1301})}]},authenticate:!0,permissionId:1301,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts",{url:"/salesforceAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",controller:"SalesforceAccountsController as vm"}},resolve:{salesforceAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SalesforceAccounts",fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.salesforceAccounts.edit",{url:"/:id?tab",params:{salesforceAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/view.html",controller:"SalesforceAccountController as vm"}},resolve:{salesforceAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSalesforceAccount@get",{fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1302})}]},authenticate:!0,permissionId:1302,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts",{url:"/freshdeskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",controller:"FreshdeskAccountsController as vm"}},resolve:{freshdeskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"FreshdeskAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.freshdeskAccounts.edit",{url:"/:id?tab",params:{freshdeskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",controller:"FreshdeskAccountController as vm"}},resolve:{freshdeskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intFreshdeskAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1303})}]},authenticate:!0,permissionId:1303,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts",{url:"/sugarcrmAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",controller:"SugarcrmAccountsController as vm"}},resolve:{sugarcrmAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SugarcrmAccounts",fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.sugarcrmAccounts.edit",{url:"/:id?tab",params:{sugarcrmAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",controller:"SugarcrmAccountController as vm"}},resolve:{sugarcrmAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intSugarcrmAccount@get",{fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1305})}]},authenticate:!0,permissionId:1305,bodyClass:"integrations"}).state("app.integrations.deskAccounts",{url:"/deskAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/deskAccounts.html",controller:"DeskAccountsController as vm"}},resolve:{deskAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"DeskAccounts",fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.deskAccounts.edit",{url:"/:id?tab",params:{deskAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/view.html",controller:"DeskAccountController as vm"}},resolve:{deskAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intDeskAccount@get",{fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1306})}]},authenticate:!0,permissionId:1306,bodyClass:"integrations"}).state("app.integrations.zohoAccounts",{url:"/zohoAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",controller:"ZohoAccountsController as vm"}},resolve:{zohoAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ZohoAccounts",fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.zohoAccounts.edit",{url:"/:id?tab",params:{zohoAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/view.html",controller:"ZohoAccountController as vm"}},resolve:{zohoAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intZohoAccount@get",{fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1307})}]},authenticate:!0,permissionId:1307,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts",{url:"/vtigerAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",controller:"VtigerAccountsController as vm"}},resolve:{vtigerAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VtigerAccounts",fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.vtigerAccounts.edit",{url:"/:id?tab",params:{vtigerAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/view.html",controller:"VtigerAccountController as vm"}},resolve:{vtigerAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intVtigerAccount@get",{fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1308})}]},authenticate:!0,permissionId:1308,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts",{url:"/dynamics365Accounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",controller:"Dynamics365AccountsController as vm"}},resolve:{dynamics365Accounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dynamics365Accounts",fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.dynamics365Accounts.edit",{url:"/:id?tab",params:{dynamics365Account:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",controller:"Dynamics365AccountController as vm"}},resolve:{dynamics365Account:["apiResolver","$stateParams",function(e,t){return e.resolve("intDynamics365Account@get",{fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1309})}]},authenticate:!0,permissionId:1309,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts",{url:"/servicenowAccounts",views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",controller:"ServicenowAccountsController as vm"}},resolve:{servicenowAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ServicenowAccounts",fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}).state("app.integrations.servicenowAccounts.edit",{url:"/:id?tab",params:{servicenowAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/view.html",controller:"ServicenowAccountController as vm"}},resolve:{servicenowAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("intServicenowAccount@get",{fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1310})}]},authenticate:!0,permissionId:1310,bodyClass:"integrations"}),t.addPart("app/main/apps/integrations")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.integrations",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.jscripty",{abstract:!0,url:"/jscripty"}).state("app.jscripty.projects",{url:"/projects",views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/projects.html",controller:"JscriptyProjectsController as vm"}},resolve:{projects:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Projects",fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}).state("app.jscripty.projects.edit",{url:"/:id?tab",params:{project:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/jscripty/views/projects/edit/view.html",controller:"JscriptyProjectController as vm"}},resolve:{project:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptyProject@get",{fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1701})}]},authenticate:!0,permissionId:1701,bodyClass:"jscripty"}),t.addPart("app/main/apps/jscripty")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.jscripty",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.mail",{abstract:!0,url:"/mail"}).state("app.mail.mailQueues",{url:"/mailQueues",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/mailQueues.html",controller:"MailQueuesController as vm"}},resolve:{mailQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailQueues.edit",{url:"/:id?tab",params:{mailQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailQueues/edit/view.html",controller:"MailQueueController as vm"}},resolve:{mailQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("mailQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}]},authenticate:!0,permissionId:601,bodyClass:"mail"}).state("app.mail.mailAccounts",{url:"/mailAccounts",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/mailAccounts.html",controller:"MailAccountsController as vm"}},resolve:{mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailAccounts.edit",{url:"/:id?tab",params:{mailAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailAccounts/edit/view.html",controller:"MailAccountController as vm"}},resolve:{mailAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}]},authenticate:!0,permissionId:602,bodyClass:"mail"}).state("app.mail.mailSubtatuses",{url:"/mailSubtatuses",views:{"content@app":{templateUrl:"app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",controller:"MailSubstatusesController as vm"}},resolve:{mailSubtatuses:["apiResolver","Auth",function(e,t){return e.resolve("mailSubstatus@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:603})}]},authenticate:!0,permissionId:603,bodyClass:"mail"}),t.addPart("app/main/apps/mail")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.mail",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.mail.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.mail.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/mail/views/realtime/realtime.html",controller:"MailRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:610})}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.agents",{url:"/agents",controller:"AgentsMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.queues",{url:"/queues",controller:"QueuesMailRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailQueues",channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:601})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getMailQueues")}]},authenticate:!0,permissionId:610}).state("app.mail.realtime.accounts",{url:"/accounts",controller:"MailAccountsRealtimeController as vm",templateUrl:"app/main/apps/mail/views/realtime/accounts/view.html",resolve:{mailAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("mailAccount@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MailAccounts",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:602})}],rpcMailAccounts:["apiResolver",function(e){return e.resolve("rpc@getMailAccounts")}]},authenticate:!0,permissionId:610})}e.$inject=["$stateProvider"],angular.module("app.mail.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.marketplace",{abstract:!0,url:"/marketplace"}).state("app.marketplace.plugins",{url:"/plugins",views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/plugins.html",controller:"MarketplacePluginsController as vm"}},resolve:{plugins:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Plugins",fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}).state("app.marketplace.plugins.edit",{url:"/:id?tab",params:{plugin:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/marketplace/views/plugins/edit/view.html",controller:"MarketplacePluginController as vm"}},resolve:{plugin:["apiResolver","$stateParams",function(e,t){return e.resolve("plugin@get",{fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1801})}]},authenticate:!0,permissionId:1801,bodyClass:"marketplace"}),t.addPart("app/main/apps/marketplace")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.marketplace",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.motiondialer",{abstract:!0,url:"/motiondialer"}).state("app.motiondialer.queueCampaigns",{url:"/queueCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",controller:"QueueCampaignsController as vm"}},resolve:{queueCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.queueCampaigns.edit",{url:"/:id?tab",params:{queueCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",controller:"QueueCampaignController as vm"}},resolve:{queueCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1501,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns",{url:"/ivrCampaigns",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",controller:"IvrCampaignsController as vm"}},resolve:{ivrCampaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"IvrCampaigns",fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}).state("app.motiondialer.ivrCampaigns.edit",{url:"/:id?tab",params:{ivrCampaign:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",controller:"IvrCampaignController as vm"}},resolve:{ivrCampaign:["apiResolver","$stateParams",function(e,t){return e.resolve("campaign@get",{fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}]},authenticate:!0,permissionId:1502,bodyClass:"motiondialer"}),t.addPart("app/main/apps/motiondialer")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.motiondialer",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.motiondialer.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.motiondialer.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/motiondialer/views/realtime/realtime.html",controller:"MotionDialerRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1510})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.agents",{url:"/agents",controller:"AgentsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queues",{url:"/queues",controller:"QueuesMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1501})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:1510}).state("app.motiondialer.realtime.ivr_campaigns",{url:"/ivr_campaigns",controller:"IvrCampaignsMotionDialerRealtimeController as vm",templateUrl:"app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",resolve:{campaigns:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("campaign@get",{sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"IvrCampaigns",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1502})}],rpcCampaigns:["apiResolver",function(e){return e.resolve("rpc@getCampaigns")}]},authenticate:!0,permissionId:1510})}e.$inject=["$stateProvider"],angular.module("app.motiondialer.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.openchannel",{abstract:!0,url:"/openchannel"}).state("app.openchannel.openchannelQueues",{url:"/openchannelQueues",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",controller:"OpenchannelQueuesController as vm"}},resolve:{openchannelQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelQueues.edit",{url:"/:id?tab",params:{openchannelQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/view.html",controller:"OpenchannelQueueController as vm"}},resolve:{openchannelQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}]},authenticate:!0,permissionId:801,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts",{url:"/openchannelAccounts",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",controller:"OpenchannelAccountsController as vm"}},resolve:{openchannelAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelAccounts",fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}).state("app.openchannel.openchannelAccounts.edit",{url:"/:id?tab",params:{openchannelAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",controller:"OpenchannelAccountController as vm"}},resolve:{openchannelAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("openchannelAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:802})}]},authenticate:!0,permissionId:802,bodyClass:"openchannel"}),t.addPart("app/main/apps/openchannel")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.openchannel",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.openchannel.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.openchannel.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/openchannel/views/realtime/realtime.html",controller:"OpenchannelRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:810})}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.agents",{url:"/agents",controller:"AgentsOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:810}).state("app.openchannel.realtime.queues",{url:"/queues",controller:"QueuesOpenchannelRealtimeController as vm",templateUrl:"app/main/apps/openchannel/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("openchannelQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OpenchannelQueues",channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:801})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getOpenchannelQueues")}]},authenticate:!0,permissionId:810})}e.$inject=["$stateProvider"],angular.module("app.openchannel.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.plugins",{abstract:!0,url:"/plugins"}),t.addPart("app/main/apps/plugins")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.plugins",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.plugins.plugin"]).config(e)}(),function(){"use strict";function e(e){e.state("app.plugins.plugin",{url:"/plugin/:id",views:{"content@app":{templateUrl:"app/main/apps/plugins/views/plugin/plugin.html",controller:"PluginController as vm"}},resolve:{},authenticate:!0,bodyClass:"plugins"})}e.$inject=["$stateProvider"],angular.module("app.plugins.plugin",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.settings",{abstract:!0,url:"/settings"}).state("app.settings.generals",{url:"/generals",views:{"content@app":{templateUrl:"app/main/apps/settings/views/generals/generals.html",controller:"GeneralsController as vm"}},resolve:{generals:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,min_internal,securePassword,callRecordingEncryption,chatTimeout,stunaddr,turnaddr,turnusername,turnpassword,phoneBarAutoUpdater,phoneBarAutoUpdaterUrl,enableEmailPreview,split,splitSizeCsv,splitSizePdf,splitSizeXlsx,messagesAlignment,phoneBarRememberMeEnabled,rtlSupport",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.smtps",{url:"/smtps",views:{"content@app":{templateUrl:"app/main/apps/settings/views/smtps/smtps.html",controller:"SmtpController as vm"}},resolve:{smtps:["apiResolver",function(e){return e.resolve("mailAccount@get",{fields:"createdAt,updatedAt,id,service,name,email,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,description",service:"1",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.networks",{url:"/networks",views:{"content@app":{templateUrl:"app/main/apps/settings/views/networks/networks.html",controller:"NetworksController as vm"}},resolve:{networks:["apiResolver",function(e){return e.resolve("network@get",{fields:"createdAt,updatedAt,id,type,value",sort:"-updatedAt",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}).state("app.settings.customizations",{url:"/customizations",views:{"content@app":{templateUrl:"app/main/apps/settings/views/customizations/customizations.html",controller:"CustomizationsController as vm"}},resolve:{customizations:["apiResolver",function(e){return e.resolve("setting@get",{fields:"createdAt,updatedAt,id,defaultLogo,defaultLoginLogo,defaultHeaderWhiteLabel,headerWhiteLabel,defaultPageTitle,pageTitle,defaultPreferred",limit:10,offset:0})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"}),t.addPart("app/main/apps/settings")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.settings",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.settings.updates","app.settings.license","app.settings.system"]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.license",{url:"/license",views:{"content@app":{templateUrl:"app/main/apps/settings/views/license/license.html",controller:"LicenseController as vm"}},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.license",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.system",{url:"/system?tab",views:{"content@app":{templateUrl:"app/main/apps/settings/views/system/system.html",controller:"SystemController as vm"}},resolve:{system:["apiResolver",function(e){return e.resolve("system@get")}],processes:["apiResolver",function(e){return e.resolve("pm2@get")}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.system",[]).config(e)}(),function(){"use strict";function e(e){e.state("app.settings.updates",{url:"/updates",views:{"content@app":{templateUrl:"app/main/apps/settings/views/updates/updates.html",controller:"UpdatesController as vm"}},resolve:{version:["apiResolver",function(e){return e.resolve("version@get",{latest:!0})}],userProfile:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1400})}]},authenticate:!0,permissionId:1400,bodyClass:"settings"})}e.$inject=["$stateProvider"],angular.module("app.settings.updates",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.sms",{abstract:!0,url:"/sms"}).state("app.sms.smsQueues",{url:"/smsQueues",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/smsQueues.html",controller:"SmsQueuesController as vm"}},resolve:{smsQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsQueues",fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsQueues.edit",{url:"/:id?tab",params:{smsQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsQueues/edit/view.html",controller:"SmsQueueController as vm"}},resolve:{smsQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("smsQueue@get",{fields:"createdAt,updatedAt,id,name,strategy,timeout,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}]},authenticate:!0,permissionId:701,bodyClass:"sms"}).state("app.sms.smsAccounts",{url:"/smsAccounts",views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/smsAccounts.html",controller:"SmsAccountsController as vm"}},resolve:{smsAccounts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsAccounts",fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}).state("app.sms.smsAccounts.edit",{url:"/:id?tab",params:{smsAccount:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/sms/views/smsAccounts/edit/view.html",controller:"SmsAccountController as vm"}},resolve:{smsAccount:["apiResolver","$stateParams",function(e,t){return e.resolve("smsAccount@get",{fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:702})}]},authenticate:!0,permissionId:702,bodyClass:"sms"}),t.addPart("app/main/apps/sms")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.sms",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.sms.realtime"]).config(e)}(),function(){"use strict";function e(e){e.state("app.sms.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/sms/views/realtime/realtime.html",controller:"SmsRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:710})}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.agents",{url:"/agents",controller:"AgentsSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:710}).state("app.sms.realtime.queues",{url:"/queues",controller:"QueuesSmsRealtimeController as vm",templateUrl:"app/main/apps/sms/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("smsQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"SmsQueues",channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:701})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getSmsQueues")}]},authenticate:!0,permissionId:710})}e.$inject=["$stateProvider"],angular.module("app.sms.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.staff",{abstract:!0,url:"/staff"}).state("app.staff.users",{url:"/users",views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/users.html",controller:"UsersController as vm"}},resolve:{users:["apiResolver","Auth",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",role:"admin,user",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.users.edit",{url:"/:id?tab",params:{user:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/users/edit/view.html",controller:"UserController as vm"}},resolve:{user:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:201})}]},authenticate:!0,permissionId:201,bodyClass:"staff"}).state("app.staff.agents",{url:"/agents",views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/agents.html",controller:"AgentsController as vm"}},resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.agents.edit",{url:"/:id?tab",params:{agent:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/agents/edit/view.html",controller:"AgentController as vm"}},resolve:{agent:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}]},authenticate:!0,permissionId:202,bodyClass:"staff"}).state("app.staff.telephones",{url:"/telephones",views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/telephones.html",controller:"TelephonesController as vm"}},resolve:{telephones:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Telephones",fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.telephones.edit",{url:"/:id?tab",params:{telephone:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/telephones/edit/view.html",controller:"TelephoneController as vm"}},resolve:{telephone:["apiResolver","$stateParams",function(e,t){return e.resolve("user@get",{fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}]},authenticate:!0,permissionId:203,bodyClass:"staff"}).state("app.staff.teams",{url:"/teams",views:{"content@app":{templateUrl:"app/main/apps/staff/views/teams/teams.html",controller:"TeamsController as vm"}},resolve:{teams:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("team@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Teams",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:204})}]},authenticate:!0,permissionId:204,bodyClass:"staff"}).state("app.staff.userProfiles",{url:"/userProfiles",views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/userProfiles.html",controller:"UserProfilesController as vm"}},resolve:{userProfiles:["apiResolver","Auth",function(e,t){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}).state("app.staff.userProfiles.edit",{url:"/:id?tab",params:{userProfile:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/staff/views/userProfiles/edit/view.html",controller:"UserProfileController as vm"}},resolve:{userProfile:["apiResolver","$stateParams",function(e,t){return e.resolve("userProfile@get",{fields:"createdAt,updatedAt,id,name,description,crudPermissions",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:205})}]},authenticate:!0,permissionId:205,bodyClass:"staff"}),t.addPart("app/main/apps/staff")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.staff",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.tools",{abstract:!0,url:"/tools"}).state("app.tools.cannedAnswers",{url:"/cannedAnswers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",controller:"CannedAnswersController as vm"}},resolve:{cannedAnswers:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cannedAnswer@get",{fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"CannedAnswers",fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1001})}]},authenticate:!0,permissionId:1001,bodyClass:"tools"}).state("app.tools.dispositions",{url:"/dispositions",views:{"content@app":{templateUrl:"app/main/apps/tools/views/dispositions/dispositions.html",controller:"DispositionsController as vm"}},resolve:{dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1002})}]},authenticate:!0,permissionId:1002,bodyClass:"tools"}).state("app.tools.customDashboards",{url:"/customDashboards",views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/customDashboards.html",controller:"CustomDashboardsController as vm"}},resolve:{customDashboards:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"CustomDashboards",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.customDashboards.edit",{url:"/:id?tab",params:{customDashboard:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/customDashboards/edit/view.html",controller:"CustomDashboardController as vm"}},resolve:{customDashboard:["apiResolver","$stateParams",function(e,t){return e.resolve("dashboard@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1003})}]},authenticate:!0,permissionId:1003,bodyClass:"tools"}).state("app.tools.intervals",{url:"/intervals",views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/intervals.html",controller:"IntervalsController as vm"}},resolve:{intervals:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Intervals",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.intervals.edit",{url:"/:id?tab",params:{interval:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/intervals/edit/view.html",controller:"IntervalController as vm"}},resolve:{interval:["apiResolver","$stateParams",function(e,t){return e.resolve("interval@get",{fields:"createdAt,updatedAt,id,name,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1004})}]},authenticate:!0,permissionId:1004,bodyClass:"tools"}).state("app.tools.pauses",{url:"/pauses",views:{"content@app":{templateUrl:"app/main/apps/tools/views/pauses/pauses.html",controller:"PausesController as vm"}},resolve:{pauses:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("pause@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Pauses",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1005})}]},authenticate:!0,permissionId:1005,bodyClass:"tools"}).state("app.tools.schedules",{url:"/schedules",views:{"content@app":{templateUrl:"app/main/apps/tools/views/schedules/schedules.html",controller:"SchedulesController as vm"}},resolve:{schedules:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("schedule@get",{fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Scheduler",fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1006})}]},authenticate:!0,permissionId:1006,bodyClass:"tools"}).state("app.tools.sounds",{url:"/sounds",views:{"content@app":{templateUrl:"app/main/apps/tools/views/sounds/sounds.html",controller:"SoundsController as vm"}},resolve:{sounds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("sound@get",{fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Sounds",fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1007})}]},authenticate:!0,permissionId:1007,bodyClass:"tools"}).state("app.tools.tags",{url:"/tags",views:{"content@app":{templateUrl:"app/main/apps/tools/views/tags/tags.html",controller:"TagsController as vm"}},resolve:{tags:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("tag@get",{fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Tags",fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1008})}]},authenticate:!0,permissionId:1008,bodyClass:"tools"}).state("app.tools.templates",{url:"/templates",views:{"content@app":{templateUrl:"app/main/apps/tools/views/templates/templates.html",controller:"TemplatesController as vm"}},resolve:{templates:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("template@get",{fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Templates",fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1009})}]},authenticate:!0,permissionId:1009,bodyClass:"tools"}).state("app.tools.triggers",{url:"/triggers",views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/triggers.html",controller:"TriggersController as vm"}},resolve:{triggers:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Triggers",fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.triggers.edit",{url:"/:id?tab",params:{trigger:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/triggers/edit/view.html",controller:"TriggerController as vm"}},resolve:{trigger:["apiResolver","$stateParams",function(e,t){return e.resolve("trigger@get",{fields:"createdAt,updatedAt,id,name,channel,status,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1010})}]},authenticate:!0,permissionId:1010,bodyClass:"tools"}).state("app.tools.trunks",{url:"/trunks",views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/trunks.html",controller:"TrunksController as vm"}},resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.trunks.edit",{url:"/:id?tab",params:{trunk:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/tools/views/trunks/edit/view.html",controller:"TrunkController as vm"}},resolve:{trunk:["apiResolver","$stateParams",function(e,t){return e.resolve("trunk@get",{fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}]},authenticate:!0,permissionId:1011,bodyClass:"tools"}).state("app.tools.variables",{url:"/variables",views:{"content@app":{templateUrl:"app/main/apps/tools/views/variables/variables.html",controller:"VariablesController as vm"}},resolve:{variables:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("variable@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Variables",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1012})}]},authenticate:!0,permissionId:1012,bodyClass:"tools"}),t.addPart("app/main/apps/tools")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.tools",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter"]).config(e)}(),function(){"use strict";function e(e){e.state("app.voice.realtime",{url:"/realtime",views:{"content@app":{templateUrl:"app/main/apps/voice/views/realtime/realtime.html",controller:"VoiceRealtimeController as vm"}},resolve:{userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:411})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.agents",{url:"/agents",controller:"AgentsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/agents/view.html",resolve:{pauses:["apiResolver",function(e){return e.resolve("pause@get",{nolimit:!0})}],agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastPauseAt,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,fullname,role,userpic,internal,online,voicePause,openchannelPause,faxPause,chatPause,smsPause,mailPause,pauseType,lastLoginAt,lastPauseAt,chatCapacity,mailCapacity,openchannelCapacity,faxCapacity,smsCapacity",role:"agent",sort:"fullname",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:202})}],rpcAgents:["apiResolver",function(e){return e.resolve("rpc@getAgents")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.telephones",{url:"/telephones",controller:"TelephonesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/telephones/view.html",resolve:{telephones:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Telephones",fields:"id,fullname,userpic,internal",role:"telephone",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:203})}],rpcTelephones:["apiResolver",function(e){return e.resolve("rpc@getTelephones")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.trunks",{url:"/trunks",controller:"TrunksVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/trunks/view.html",resolve:{trunks:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("trunk@get",{fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Trunks",fields:"id,name",active:!0,sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:1011})}],rpcTrunks:["apiResolver",function(e){return e.resolve("rpc@getTrunks")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queues",{url:"/queues",controller:"QueuesVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queues/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_calls",{url:"/queue_calls",controller:"QueueCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_calls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcVoiceQueuesChannels:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueuesChannels")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.abandonedcalls",{url:"/abandonedcalls",controller:"AbandonedCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/abandonedcalls/view.html",resolve:{agents:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("user@get",{fields:"id,name,role,context",role:"agent",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Agents",fields:"id,name,role,context",role:"agent",nolimit:!0})}],queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",sort:"-updatedAt",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],dispositions:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("disposition@get",{fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Dispositions",fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.queue_params",{url:"/queue_params",controller:"QueueParamsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/queue_params/view.html",resolve:{queues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}],rpcQueues:["apiResolver",function(e){return e.resolve("rpc@getVoiceQueues")}]},authenticate:!0,permissionId:411}).state("app.voice.realtime.outbound_calls",{url:"/outbound_calls",controller:"OutboundCallsVoiceRealtimeController as vm",templateUrl:"app/main/apps/voice/views/realtime/outbound_calls/view.html",resolve:{rpcCalls:["apiResolver",function(e){return e.resolve("rpc@getOutboundChannels")}]},authenticate:!0,permissionId:411})}e.$inject=["$stateProvider"],angular.module("app.voice.realtime",[]).config(e)}(),function(){"use strict";function e(e,t,n,a){e.state("app.voice",{abstract:!0,url:"/voice"}).state("app.voice.voiceQueues",{url:"/voiceQueues",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/voiceQueues.html",controller:"VoiceQueuesController as vm"}},resolve:{voiceQueues:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceQueues",fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.voiceQueues.edit",{url:"/:id?tab",params:{voiceQueue:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceQueues/edit/view.html",controller:"VoiceQueueController as vm"}},resolve:{voiceQueue:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceQueue@get",{fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:401})}]},authenticate:!0,permissionId:401,bodyClass:"voice"}).state("app.voice.inboundroutes",{url:"/inboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/inboundroutes.html",controller:"InboundRoutesController as vm"}},resolve:{inboundroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"InboundRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.inboundroutes.edit",{url:"/:id?tab",params:{inboundroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/inboundroutes/edit/view.html",controller:"InboundRouteController as vm"}},resolve:{inboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:402})}]},authenticate:!0,permissionId:402,bodyClass:"voice"}).state("app.voice.outboundroutes",{url:"/outboundroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/outboundroutes.html",controller:"OutboundRoutesController as vm"}},resolve:{outboundroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"OutboundRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.outboundroutes.edit",{url:"/:id?tab",params:{outboundroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/outboundroutes/edit/view.html",controller:"OutboundRouteController as vm"}},resolve:{outboundroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:403})}]},authenticate:!0,permissionId:403,bodyClass:"voice"}).state("app.voice.internalroutes",{url:"/internalroutes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/internalroutes.html",controller:"InternalRoutesController as vm"}},resolve:{internalroutes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"InternalRoutes",fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.internalroutes.edit",{url:"/:id?tab",params:{internalroute:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/internalroutes/edit/view.html",controller:"InternalRouteController as vm"}},resolve:{internalroute:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceExtension@get",{fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:404})}]},authenticate:!0,permissionId:404,bodyClass:"voice"}).state("app.voice.contexts",{url:"/contexts",views:{"content@app":{templateUrl:"app/main/apps/voice/views/contexts/contexts.html",controller:"ContextsController as vm"}},resolve:{contexts:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceContext@get",{fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Contexts",fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:405})}]},authenticate:!0,permissionId:405,bodyClass:"voice"}).state("app.voice.voicemails",{url:"/voicemails",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/voicemails.html",controller:"VoicemailsController as vm"}},resolve:{voicemails:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Voicemails",fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.voicemails.edit",{url:"/:id?tab",params:{voicemail:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicemails/edit/view.html",controller:"VoicemailController as vm"}},resolve:{voicemail:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMail@get",{fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:406})}]},authenticate:!0,permissionId:406,bodyClass:"voice"}).state("app.voice.musiconholds",{url:"/musiconholds",views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/musiconholds.html",controller:"MusicOnHoldsController as vm"}},resolve:{musiconholds:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"MusicOnHolds",fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.musiconholds.edit",{url:"/:id?tab",params:{musiconhold:void 0,crudPermissions:void 0},views:{"content@app":{templateUrl:"app/main/apps/voice/views/musiconholds/edit/view.html",controller:"MusicOnHoldController as vm"}},resolve:{musiconhold:["apiResolver","$stateParams",function(e,t){return e.resolve("voiceMusicOnHold@get",{fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",id:t.id})}],userProfileSection:["apiResolver","Auth",function(e,t){return e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:407})}]},authenticate:!0,permissionId:407,bodyClass:"voice"}).state("app.voice.voiceRecordings",{url:"/voiceRecordings",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",controller:"VoiceRecordingsController as vm"}},resolve:{voiceRecordings:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceRecording@get",{fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoiceRecordings",fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:408})}]},authenticate:!0,permissionId:408,bodyClass:"voice"}).state("app.voice.chanSpies",{url:"/chanSpies",views:{"content@app":{templateUrl:"app/main/apps/voice/views/chanSpies/chanSpies.html",controller:"ChanSpiesController as vm"}},resolve:{chanSpies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voiceChanSpy@get",{fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"ChanSpies",fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:409})}]},authenticate:!0,permissionId:409,bodyClass:"voice"}).state("app.voice.voicePrefixes",{url:"/voicePrefixes",views:{"content@app":{templateUrl:"app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",controller:"VoicePrefixesController as vm"}},resolve:{voicePrefixes:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("voicePrefix@get",{fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,offset:0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"VoicePrefixes",fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,offset:0})}],userProfile:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfile@get",{fields:"id,name,crudPermissions",id:t.getCurrentUser().userProfileId})}],userProfileSection:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?null:e.resolve("userProfileSection@get",{fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:t.getCurrentUser().userProfileId,sectionId:410})}]},authenticate:!0,permissionId:410,bodyClass:"voice"}),t.addPart("app/main/apps/voice")}e.$inject=["$stateProvider","$translatePartialLoaderProvider","msApiProvider","msNavigationServiceProvider"],angular.module("app.voice",["ngCsv","ngPassword","md.data.table","flow","mdColorPicker","ckeditor","ng-sortable","ngAria","ngAnimate","mdPickers","mwFormBuilder","mwFormViewer","mwFormUtils","ngclipboard","angular-cron-jobs","ngEmbed","angularMaterialFormBuilder","material.components.expansionPanels","chart.js","angular.filter","app.voice.realtime"]).config(e)}(),function(){"use strict";angular.module("app.navigation",[]).config(function(){})}(),function(){"use strict";function e(e,t){e.addPart("app/quick-panel")}e.$inject=["$translatePartialLoaderProvider","msApiProvider"],angular.module("app.quick-panel",[]).config(e)}(),function(){"use strict";function e(e,t){e.state("app.reset",{url:"/reset/:token",views:{"main@":{templateUrl:"app/core/layouts/content-only.html",controller:"MainController as vm"},"content@app.reset":{templateUrl:"app/reset/reset.html",controller:"ResetPasswordController as vm"}},bodyClass:"reset"}),t.addPart("app/reset")}e.$inject=["$stateProvider","$translatePartialLoaderProvider"],angular.module("app.reset",[]).config(e)}(),function(){"use strict";function e(e){e.addPart("app/toolbar")}e.$inject=["$translatePartialLoaderProvider"],angular.module("app.toolbar",[]).config(e)}(),function(){"use strict";function e(e){e.interceptors.push("authInterceptor")}e.$inject=["$httpProvider"],angular.module("app.auth").config(e)}(),function(){"use strict";function e(e,n,t,a){e.$on("$stateChangeStart",function(e,t){return t.hasOwnProperty("authenticate")&&t.authenticate&&!a.isLoggedIn()?(e.preventDefault(),n.go("app.login",{},{reload:!0,notify:!0})):a.isLoggedIn()&&t.hasOwnProperty("permissionId")&&t.permissionId&&!a.hasRole("admin")?a.reloadPermissions().then(function(){if(!a.hasPermission(t.permissionId))return e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})}).catch(function(){return e.preventDefault(),n.go("app.dashboards.general",{},{reload:!0,notify:!0})}):void 0})}e.$inject=["$rootScope","$state","$window","Auth"],angular.module("app.auth").run(e)}(),function(){"use strict";function e(a,i,s,o,t,r){var l,d=["id","role","fullname","name","internal","email","userpic","permissions","md5secret","phoneBarAutoAnswer","phoneBarAutoAnswerDelay","phoneBarEnableRecording","phoneBarEnableDtmfTone","voicePause","chatPause","mailPause","faxPause","smsPause","openchannelPause","phoneBarEnableSettings","phoneBarExpires","pauseType","showWebBar","phoneBarRemoteControlPort","phoneBarRemoteControl","lastLoginAt","lastPauseAt","crudPermissions","allowmessenger","passwordResetAt","alias","phoneBarPrefixRequired","hotdesk","userProfileId"];function c(e){var t=s.defer();return m("agent")&&0!==l.showWebBar?o.user.login({id:l.id,device:"web",intrf:e}).$promise.then(function(){console.log("AGENT LOGGED IN"),t.resolve()}).catch(function(e){console.error(e),t.reject(e)}):m("admin")||m("user")?o.user.update({id:l.id},{online:!0,lastLoginAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise}function n(){if(i.remove("motion.user"),i.remove("motion.token"),l&&l.id){var e=l.id;l=null,t.localStorage.removeItem("motion.user:"+e)}}function m(e){return!!l&&l.role===e}function u(e){return!!l&&_.includes(l.permissions,e)}function e(){return i.get("motion.token")}function p(e){return l=_.assign(l,_.pick(e,d)),i.put("motion.user",JSON.stringify(l)),m("user")&&g().then(function(e){l.permissions=e}),l}function g(){var i=[];return s(function(t,n){var a=[];return l||t(a),o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){return i=e&&e.rows?e.rows:[],_.isEmpty(i)||(a=_.map(_.filter(i,function(e){return e.enabled}),function(e){return e.sectionId})),a}).then(function(t){if(_.includes(t,100)){var e=_.find(i,{sectionId:100});return e.autoAssociation?(t.push(101),t):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)&&t.push(101),t})}return t}).then(function(t){if(_.includes(t,1003)||_.some(i,{enabled:!1,sectionId:1003})){var e=_.find(i,{sectionId:1003});return e.autoAssociation?o.dashboard.get().$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.id+99999)}),t}):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.resourceId+99999)}),t})}return t}).then(function(t){if(_.includes(t,1801)||_.some(i,{enabled:!1,sectionId:1801})){var e=_.find(i,{sectionId:1801});return e.autoAssociation?o.plugin.get().$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.id+88888)}),t}):o.userProfileResource.get({sectionId:e.id}).$promise.then(function(e){return(e&&e.rows?e.rows:[]).forEach(function(e){t.push(e.resourceId+88888)}),t})}return t}).then(function(e){t(e)}).catch(function(e){n("Error retrieving user profile permissions",e)})})}function v(){return s(function(t,n){g().then(function(e){l.permissions=e,t()}).catch(function(e){n(e)})})}return function(){if(i.get("motion.user"))l=JSON.parse(i.get("motion.user")),o.user.get({id:l.id,fields:d.join(",")}).$promise.then(function(e){if(e)return p(e)}).catch(function(e){console.log("Error retrieving user",e)})}(),{login:function(e){var t,n=s.defer();return o.auth.local(e).$promise.then(function(e){return t=e,i.put("motion.token",e.token),o.user.get({id:e.id,fields:d.join(",")}).$promise}).then(function(e){(l=e).lastLoginAt=moment(),i.put("motion.user",JSON.stringify(e))}).then(function(){if(m("agent")&&1==l.showWebBar&&l.hotdesk)return a.show({controller:"HotDeskDialogController",controllerAs:"vm",templateUrl:"app/auth/services/hotdesk/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,resolve:{telephones:["apiResolver","Auth",function(e,t){return e.resolve("user@get",{fields:"id,fullname,name,internal",role:"telephone",nolimit:!0})}]}})}).then(function(e){return c(e)}).catch(function(e){n.reject(e.data)}).finally(function(){o.user.get({id:t.id,fields:d.join(",")}).$promise.then(function(e){l=e,m("user")&&g().then(function(e){l.permissions=e}),n.resolve()}).catch(function(e){console.log("Error update user login",e),n.reject(e.data)})}),n.promise},logout:function(e){var t;return s.defer(),e?(n(),s.resolve()):(t=s.defer(),m("agent")&&0!==l.showWebBar?o.user.logout({id:l.id,device:"web"}).$promise.then(function(){console.log("AGENT LOGGED OUT")}).catch(function(e){console.error(e)}).finally(function(){t.resolve()}):m("admin")||m("user")?o.user.update({id:l.id},{online:!1}).$promise.catch(function(e){console.error(e)}).finally(function(){t.resolve()}):t.resolve(),t.promise).then(n).catch(function(e){console.error(e)})},queueLogin:c,isLoggedIn:function(){return!(!l||!e())},getPermissions:g,reloadPermissions:v,hasChildrenPermissions:function(e){return!!e&&_.some(e,function(e){return u(e)})},hasModulePermissions:function(i){return s(function(a,t){m("admin")?a(!0):o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(_.isEmpty(t))a(!1);else{var n=_.filter(t,function(e){return e.enabled});a(_.some(n,["category",i]))}}).catch(function(e){t(e)})})},hasModulesPermissions:function(i){return s(function(n,t){var a={};m("admin")?(i.forEach(function(e){a[e]=!0}),n(a)):o.userProfileSection.get({userProfileId:l.userProfileId}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];_.isEmpty(t)?n({}):(_(t).filter(function(e){return e.enabled&&_.includes(i,e.category)}).uniqBy(function(e){return e.category}).map(function(e){return e.category}).value().forEach(function(e){a[e]=!0}),n(a))}).catch(function(e){t(e)})})},hasRole:m,hasPermission:u,hasSectionPermissions:function(a){return s(function(e,t){var n={};return v().then(function(){_.includes(l.permissions,a)&&(n[a]=!0),e(n)}).catch(function(e){t(e)})})},hasSectionsPermissions:function(a){return s(function(e,t){var n={};if(!m("admin"))return v().then(function(){a.forEach(function(e){_.includes(l.permissions,e)&&(n[e]=!0)}),e(n)}).catch(function(e){t(e)});a.forEach(function(e){n[e]=!0}),e(n)})},getToken:e,getCurrentUser:function(){return l},parseCrudPermissions:function(e){return m("admin")?{readOnly:!1,canEdit:!0,canDelete:!0}:e?{readOnly:!(!_.includes(e,"r")||1!==e.length),canEdit:!!_.includes(e,"e"),canDelete:!!_.includes(e,"d")}:{readOnly:!0,canEdit:!1,canDelete:!1}},updateCurrentUser:p,removeCookies:n}}e.$inject=["$mdDialog","$cookies","$q","api","$window","$document"],angular.module("app.auth").factory("Auth",e)}(),function(){"use strict";function e(t,e){this.telephones=e,this.closeDialog=function(e){t.hide(e)},e.count&&(this.name=e.rows[0].name)}e.$inject=["$mdDialog","telephones"],angular.module("app.auth").controller("HotDeskDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s;return{request:function(e){var t=n.get("motion.token");return e.headers=e.headers||{},i.isSameOrigin(e.url)&&t&&(e.headers.Authorization="Bearer "+t),e},responseError:function(e){switch(e.status){case 401:n.remove("motion.user"),n.remove("motion.token"),(s||(s=a.get("$state"))).go("app.login")}return t.reject(e)}}}e.$inject=["$rootScope","$q","$cookies","$injector","Util"],angular.module("app.auth").factory("authInterceptor",e)}(),function(){"use strict";function e(t){var n={safeCb:function(e){return angular.isFunction(e)?e:angular.noop},urlParse:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t},isSameOrigin:function(i,e){return i=n.urlParse(i),(e=(e=e&&[].concat(e)||[]).map(n.urlParse)).push(t.location),1<=(e=e.filter(function(e){var t=i.hostname===e.hostname,n=i.protocol===e.protocol,a=i.port===e.port||""===e.port&&("80"===i.port||"443"===i.port);return t&&n&&a})).length}};return n}e.$inject=["$window"],angular.module("app.auth").factory("Util",e)}(),function(){"use strict";angular.module("app.core").provider("motionConfig",function(){var n={disableCustomScrollbars:!1,disableMdInkRippleOnMobile:!0,disableCustomScrollbarsOnMobile:!0};this.config=function(e){n=angular.extend({},n,e)},this.$get=function(){var e={getConfig:function(e){if(angular.isUndefined(n[e]))return!1;return n[e]},setConfig:function(e,t){n[e]=t}};return e}})}(),function(){"use strict";function e(e,t,n,a){t.debugEnabled(!0),e.config({tabindex:!1}),a.config({disableCustomScrollbars:!1,disableCustomScrollbarsOnMobile:!0,disableMdInkRippleOnMobile:!0}),n.config({wheelPropagation:!0})}e.$inject=["$ariaProvider","$logProvider","msScrollConfigProvider","motionConfigProvider"],angular.module("app.core").config(e)}(),function(){"use strict";function e(e,t,n){(t.generate(),n.getConfig("disableMdInkRippleOnMobile")&&e.isMobile())&&angular.element("body").attr("md-no-ink",!0);e.isMobile()&&angular.element("html").addClass("is-mobile");var a=e.detectBrowser();if(a){var i=a.browser+" "+a.version+" "+a.os;angular.element("html").addClass(i)}}e.$inject=["msUtils","motionGenerator","motionConfig"],angular.module("app.core").run(e)}(),function(){"use strict";function e(o,l,d){return{restrict:"E",compile:function(e,t){var s;return t.code||(s=e.html(),e.empty()),function(n,a,r){r.code&&(s=n.$eval(r.code));var i=n.$eval(r.shouldInterpolate);l.when(s).then(function(e){if(e){i&&(e=d(e)(n));var t=angular.element('<pre><code class="highlight" ng-non-bindable></code></pre>');a.append(t),o(function(){!function(e,t){var n=t.find("code"),a=e.split("\n"),i=(a=a.filter(function(e){return e.trim().length}))[0].match(/^\s*/)[0],s=new RegExp("^"+i);a=a.map(function(e){return e.replace(s,"").replace(/\s+$/,"")});var o=hljs.highlight(r.language||r.lang,a.join("\n"),!0);o.value=o.value.replace(/=<span class="hljs-value">""<\/span>/gi,"").replace("<head>","").replace("<head/>",""),n.append(o.value).addClass("highlight")}(e,t)},34,!1)}})}}}}e.$inject=["$timeout","$q","$interpolate"],angular.module("app.core").directive("hljs",e)}(),function(){"use strict";angular.module("app.core").directive("msCard",function(){return{restrict:"E",scope:{templatePath:"=template",card:"=ngModel",vm:"=viewModel"},template:'<div class="ms-card-content-wrapper" ng-include="templatePath" onload="cardTemplateLoaded()"></div>',compile:function(e){return e.addClass("ms-card"),function(e,t){e.cardTemplateLoaded=function(){e.$emit("msCard::cardTemplateLoaded",t)}}}}})}(),function(){"use strict";angular.module("app.core").directive("msClickToCall",function(){return{restrict:"E",scope:{type:"=",disabled:"=",target:"=",prefix:"=",license:"="},controller:["$scope","$rootScope","$http","$translate","$document","$mdDialog","Auth","toasty","api",function(n,t,a,i,s,o,e,r,l){function d(e){switch(n.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(n.currentUser.phoneBarRemoteControlPort||"9888")+"/api/originate/"+c(e));case 2:return t.$broadcast("webrtc::call",{target:c(e)})}}function c(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function m(e){return a.get(e).success(function(){r.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){r.error({title:"PhoneBar API Error",msg:i.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}n.currentUser=e.getCurrentUser(),n.showMenu=function(){return n.target&&n.target.indexOf("@")<0&&n.target!=n.currentUser.internal&&n.target!=n.currentUser.name&&(0==n.currentUser.showWebBar&&n.currentUser.phoneBarRemoteControl||2==n.currentUser.showWebBar&&n.license.webrtc)&&!n.disabled},n.call=function(e){return 2!==n.currentUser.showWebBar?(t=e,l.user.getVoicePrefixes({id:n.currentUser.id}).$promise.then(function(e){if(e.count)return o.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{prefixes:e,required:n.currentUser.phoneBarPrefixRequired}})}).then(function(e){n.currentUser.phoneBarPrefixRequired?e&&-1!==e&&d(e+t):e&&-1!==e?d(e+t):e||d(t)})):d(e);var t},n.transfer=function(e){switch(n.currentUser.showWebBar){case 0:return m("http://127.0.0.1:"+(n.currentUser.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+c(e));case 2:t.$broadcast("webrtc::transfer",{target:c(e)})}}}],templateUrl:"app/core/directives/ms-click-to-call/ms-click-to-call.html"}})}(),function(){"use strict";function e(i){return{require:"ngModel",priority:1,link:function(e,t,n,a){a.$formatters.push(i.formatter),a.$parsers.push(i.parser)}}}e.$inject=["msDatepickerFixConfig"],angular.module("app.core").provider("msDatepickerFixConfig",function(){var t={formatter:function(e){return e?""===e?e:new Date(e):""},parser:function(e){return e?moment(e).add(moment(e).utcOffset(),"m").toDate():""}};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){return t}}).directive("msDatepickerFix",e)}(),function(){"use strict";angular.module("app.core").directive("msDualMultiselect",function(){return{restrict:"E",scope:{options:"="},controller:["$scope",function(o){o.canTransfer=function(e,t,n){if(!t.readOnly)return void 0!==e.isValid&&e.isValid?n?o.transfer(t.selectedItems,t.items,t.selectedItems.indexOf(e),n):o.transfer(t.items,t.selectedItems,t.items.indexOf(e),n):void 0},o.transfer=function(e,t,n,a){var i=[];if(0<=n)i.push(e[n]),t.push(e[n]),e.splice(n,1);else{for(var s=0;s<e.length;s++)void 0!==e[s].isValid&&e[s].isValid&&t.push(e[s]);for(var s=e.length-1;0<=s;s--)e[s].isValid&&e.splice(s,1);i=t}o.options.transferCallback&&o.options.transferCallback(i,a)},o.getLine=function(e,t){var n="";if(_.isNil(t))return n;if(_.isArray(t)){for(var a=0;a<t.length;a++)n+=" "+(e[t[a]]?e[t[a]]:"");return n}return e[t]?e[t]:""}}],templateUrl:"app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html"}})}(),function(){"use strict";function e(a){return{restrict:"E",replace:!0,scope:{onReply:"&",ngModel:"=",ctrlMethods:"=",pickerPosition:"=",search:"=",recentEmojis:"=",placeholder:"="},template:'<textarea class="emojionearea"></textarea>',link:function(n,e){var t=e.emojioneArea({pickerPosition:n.pickerPosition,search:n.search,recentEmojis:n.recentEmojis,placeholder:a.instant(n.placeholder||"Type a message"),attributes:{spellcheck:!0},events:{keyup:function(e,t){n.ngModel=this.getText(),n.onReply({event:t,body:this.getText()})},emojibtn_click:function(){n.ngModel=this.getText()}}});n.ngModel&&t[0].emojioneArea.setText(n.ngModel),n.internalControl=n.ctrlMethods||{},n.internalControl.setText=function(e){t[0].emojioneArea.setText(e)},n.internalControl.getText=function(){return t[0].emojioneArea.getText()},n.$watch("ngModel",function(e){e||t[0].emojioneArea.setText("")})}}}e.$inject=["$translate"],angular.module("app.core").directive("msEmojiArea",e)}(),function(){"use strict";angular.module("app.core").directive("msFontFamily",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.fonts=[{option:"Arial",value:"Arial,Helvetica,sans-serif"},{option:"Comic Sans MS",value:"Comic Sans MS,cursive"},{option:"Courier New",value:"Courier New,Courier,monospace"},{option:"Georgia",value:"Georgia,serif"},{option:"Lucida Sans Unicode",value:"Lucida Sans Unicode,Lucida Grande,sans-serif"},{option:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{option:"Times New Roman",value:"Times New Roman,Times,serif"},{option:"Trebuchet MS",value:"Trebuchet MS,Helvetica,sans-serif"},{option:"Verdana",value:"Verdana,Geneva,sans-serif"}]}],templateUrl:"app/core/directives/ms-font-family/ms-font-family.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsFormWizardController",function(){var t=this;function e(){return t.forms.length}function n(){return 0===t.selectedIndex}function a(){return t.selectedIndex===e()-1}t.forms=[],t.selectedIndex=0,t.registerForm=function(e){t.forms.push(e)},t.previousStep=function(){if(n())return;t.selectedIndex--},t.nextStep=function(){if(a())return;t.selectedIndex++},t.firstStep=function(){t.selectedIndex=0},t.lastStep=function(){t.selectedIndex=e()-1},t.totalSteps=e,t.isFirstStep=n,t.isLastStep=a,t.currentStepInvalid=function(){return angular.isDefined(t.forms[t.selectedIndex])&&t.forms[t.selectedIndex].$invalid},t.previousStepInvalid=function(){return 0<t.selectedIndex&&angular.isDefined(t.forms[t.selectedIndex-1])&&t.forms[t.selectedIndex-1].$invalid},t.formsIncomplete=function(){for(var e=0;e<t.forms.length;e++)if(t.forms[e].$invalid)return!0;return!1},t.resetForm=function(){for(var e=t.selectedIndex=0;e<t.forms.length;e++)t.forms[e].$setPristine(),t.forms[e].$setUntouched()}}).directive("msFormWizard",function(){return{restrict:"E",scope:!0,controller:"MsFormWizardController as msWizard",compile:function(e){return e.addClass("ms-form-wizard"),function(){}}}}).directive("msFormWizardForm",function(){return{restrict:"A",require:["form","^msFormWizard"],compile:function(e){return e.addClass("ms-form-wizard-form"),function(e,t,n,a){var i=a[0],s=a[1];s.registerForm(i)}}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{onClose:"&"},transclude:!0,templateUrl:"app/core/directives/ms-info-bar/ms-info-bar.html",link:function(e,t){var n=i.find("ms-info-bar-active"),a="ms-info-bar-active";n.addClass(a),e.removeInfoBar=function(){n.removeClass(a),t.remove(),e.onClose&&e.onClose(),e.$destroy()}}}}e.$inject=["$document"],angular.module("app.core").directive("msInfoBar",e)}(),function(){"use strict";function e(r,a,l,e){var d=this,t={columnCount:5,respectItemOrder:!1,reLayoutDebounce:400,responsive:{md:3,sm:2,xs:1}},n=!0;function i(){n&&e.cancel(n),n=e(function(){!function(){d.containerPos=d.container[0].getBoundingClientRect(),function(){d.columnCount=d.options.columnCount,l("gt-md")?d.columnCount=d.options.columnCount:l("md")?d.columnCount=d.columnCount>d.options.responsive.md?d.options.responsive.md:d.columnCount:l("sm")?d.columnCount=d.columnCount>d.options.responsive.sm?d.options.responsive.sm:d.columnCount:d.columnCount=d.options.responsive.xs;d.columnWidth=d.containerPos.width/d.columnCount}(),r.$broadcast("msMasonry:relayoutStarted"),d.items=d.container.find("ms-masonry-item");for(var e=Array.apply(null,new Array(d.columnCount)).map(function(){return 0}),t=0;t<d.items.length;t++){var n,a,i,s,o=d.items[t];(o=angular.element(o)).scope()&&o.scope().$broadcast("msMasonryItem:startReLayout"),o.css({width:d.columnWidth}),d.options.respectItemOrder?(i=t%d.columnCount,s=e[i]):(s=Math.min.apply(Math,e),i=e.indexOf(s)),e[i]=s+o[0].getBoundingClientRect().height,n=Math.round(i*d.columnWidth),a=s,o.css({transform:"translate3d("+n+"px,"+a+"px,0px)"}),o.addClass("placed"),o.scope()&&o.scope().$broadcast("msMasonryItem:finishReLayout")}}(),r.$broadcast("msMasonry:relayoutFinished")},d.options.reLayoutDebounce)}d.options=null,d.container=[],d.containerPos="",d.columnWidth="",d.items=[],d.reLayout=i,d.initialize=function(){d.options=d.options?angular.extend(t,d.options):t,r.$watch(function(){return d.container.width()},function(e,t){e!==t&&i()})},d.waitImagesLoaded=function(e,t){if("undefined"!=typeof imagesLoaded){var n=a.imagesLoaded(e);n.on("done",function(){t()})}else t()},r.$on("msMasonry:relayout",function(){i()})}function t(o){return{restrict:"AEC",controller:"msMasonryController",compile:function(i,s){return{pre:function(e,t,n,a){a.options=angular.fromJson(s.options||"{}"),a.container=i},post:function(e,t,n,a){o(function(){a.initialize()})}}}}}e.$inject=["$scope","$window","$mdMedia","$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("msMasonryController",e).directive("msMasonry",t).directive("msMasonryItem",function(){return{restrict:"AEC",require:"^msMasonry",priority:1,link:function(e,t,n,a){a.waitImagesLoaded(t,function(){a.reLayout()}),e.$on("msMasonryItem:finishReLayout",function(){e.$watch(function(){return t.height()},function(e,t){e!==t&&a.reLayout()})}),t.on("$destroy",function(){a.reLayout()})}}})}(),function(){"use strict";function e(n,e,a,i){var s=this;function o(e,t){s.selectedPalette=e,s.selectedHues=t}function r(){o(!(s.selectedColor={palette:"",hue:"",class:""}),!1),d()}function l(e,t){s.selectedColor={palette:e,hue:t,class:"md-"+e+"-"+t+"-bg",bgColorValue:i.rgba(s.palettes[e][t].value),fgColorValue:i.rgba(s.palettes[e][t].contrast)},"obj"!==s.msModelType||angular.equals(s.selectedColor,s.modelCtrl.$viewValue)||d(),o(e,s.palettes[e]),n.$selectedColor=s.selectedColor}function d(){"class"===s.msModelType?s.modelCtrl.$setViewValue(s.selectedColor.class):"obj"===s.msModelType&&s.modelCtrl.$setViewValue(s.selectedColor)}s.palettes=e,s.selectedPalette=!1,s.selectedHues=!1,n.$selectedColor={},s.activateHueSelection=o,s.selectColor=function(e,t){l(e,t),d(),a.hide()},s.removeColor=r,n.$watch("ngModel",function(){if(!s.modelCtrl.$viewValue||""===s.modelCtrl.$viewValue)return void r();var e,t;if("class"===s.msModelType){var n=s.modelCtrl.$viewValue.split("-");t=5<=n.length?(e=n[1]+"-"+n[2],n[3]):(e=n[1],n[2])}else"obj"===s.msModelType&&(e=s.modelCtrl.$viewValue.palette,t=s.modelCtrl.$viewValue.hue||500);l(e,t)})}e.$inject=["$scope","$mdColorPalette","$mdMenu","motionGenerator"],angular.module("app.core").controller("msMaterialColorPickerController",e).directive("msMaterialColorPicker",function(){return{require:["msMaterialColorPicker","ngModel"],restrict:"E",scope:{ngModel:"=",msModelType:"@?"},controller:"msMaterialColorPickerController as vm",transclude:!0,templateUrl:"app/core/directives/ms-material-color-picker/ms-material-color-picker.html",link:function(e,t,n,a,i){var s=a[0];s.modelCtrl=a[1],s.msModelType=e.msModelType||"class",i(e,function(e){(e=e.filter(function(e,t){return 1===t.nodeType})).length&&t.find("ms-color-picker-button").replaceWith(e)})}}})}(),function(){"use strict";function e(p,g,v){return{restrict:"A",link:function(e,t,n){var a="true"===n.msNavIsFolded,i=!1,s=angular.element(p[0].body),o=angular.element('<div id="ms-nav-fold-open-overlay"></div>'),r=angular.element('<div id="ms-nav-fold-close-overlay"></div>'),l=t.parent();function d(){s.addClass("ms-nav-folded"),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function c(e){angular.isDefined(e)&&e.preventDefault(),s.addClass("ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),l.find(o).remove(),l.parent().append(r),r.on("mouseenter touchstart",function(e){m(e),i=!1})}function m(e){angular.isDefined(e)&&e.preventDefault(),g.$broadcast("msNav::forceCollapse"),t.scrollTop(0),s.removeClass("ms-nav-folded-open"),l.parent().find(r).remove(),l.append(o),o.on("mouseenter touchstart",function(e){c(e),i=!0})}function u(){s.removeClass("ms-nav-folded ms-nav-folded-open"),g.$broadcast("msNav::expandMatchingToggles"),t.off("mouseenter mouseleave")}v.setFoldable(e,t,a),a?d():u(),e.toggleFold=function(){(a=!a)?d():u()},e.openFolded=c,e.closeFolded=m,e.isNavFoldedOpen=function(){return i},e.$on("$destroy",function(){o.off("mouseenter touchstart"),r.off("mouseenter touchstart"),t.off("mouseenter mouseleave")})}}}function t(n,a,i){return{restrict:"E",scope:{},controller:"MsNavController",compile:function(e){return e.addClass("ms-nav"),function(e){n.$broadcast("msNav::expandMatchingToggles");var t=n.$on("$stateChangeSuccess",function(){n.$broadcast("msNav::expandMatchingToggles"),a.when("navigation").then(function(e){e.close(),i.isNavFoldedOpen()&&i.closeFolded()})});e.$on("$destroy",function(){t()})}}}}function n(m,u,p,g){return{restrict:"A",require:"^msNav",scope:!0,compile:function(e,t){return e.addClass("ms-nav-toggle"),angular.isUndefined(t.collapsed)&&(t.collapsed=!0),e.attr("collapsed",t.collapsed),function(a,i,e,n){var s={expanded:"expanded",expandAnimation:"expand-animation",collapseAnimation:"collapse-animation"},t=i.find("a"),o=[],r=/\(.*\)/g;function l(){return"true"===i.attr("collapsed")}function d(){var e=u.defer();if(!l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!1);var t=angular.element(i.find("ms-nav-toggle-items")[0]);t.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var n=t[0].offsetHeight;return t.css({position:"",visibility:"",display:"",height:""}),a.$evalAsync(function(){p.animate(t,{display:"block",height:"0px"},{height:n+"px"},s.expandAnimation).then(function(){t.addClass(s.expanded),t.css({height:""}),e.resolve({success:!0})})}),e.promise}function c(){var e=u.defer();if(l())return e.reject({error:!0}),e.promise;i.attr("collapsed",!0);var t=angular.element(i.find("ms-nav-toggle-items")[0]),n=t[0].offsetHeight;return a.$evalAsync(function(){p.animate(t,{height:n+"px"},{height:"0px"},s.collapseAnimation).then(function(){t.removeClass(s.expanded),t.css({display:"",height:""}),e.resolve({success:!0})})}),e.promise}angular.forEach(t,function(e){var t=angular.element(e).attr("ui-sref");angular.isUndefined(t)||(t=t.replace(r,""),o.push(t))}),n.setToggleItem(i,a),i.children(".ms-nav-button").on("click",function(){if(n.isDisabled())return;n.disable(),l()?(n.clearLockedItems(),a.$emit("msNav::pushToLockedList"),m.$broadcast("msNav::collapse"),d().then(function(){n.enable()})):a.$broadcast("msNav::forceCollapse")}),a.$on("$destroy",function(){i.children(".ms-nav-button").off("click")}),a.$on("msNav::collapse",function(){var e=n.getLockedItems(),t=!1;angular.forEach(e,function(e){angular.equals(e.scope,a)&&(t=!0)}),t||c().then(function(){n.enable()})}),a.$on("msNav::forceCollapse",function(){c().then(function(){n.enable()})}),a.$on("msNav::expandMatchingToggles",function(){var t=g.current.name,n=!1;angular.forEach(o,function(e){t===e&&(n=!0)}),n?d():c()}),a.$on("msNav::pushToLockedList",function(){n.setLockedItem(i,a)})}}}}e.$inject=["$document","$rootScope","msNavFoldService"],t.$inject=["$rootScope","$mdComponentRegistry","msNavFoldService"],n.$inject=["$rootScope","$q","$animate","$state"],angular.module("app.core").factory("msNavFoldService",function(){var n={};return{setFoldable:function(e,t){n={scope:e,element:t}},isNavFoldedOpen:function(){return n.scope.isNavFoldedOpen()},toggleFold:function(){n.scope.toggleFold()},openFolded:function(){n.scope.openFolded()},closeFolded:function(){n.scope.closeFolded()}}}).directive("msNavIsFolded",e).controller("MsNavController",function(){var e=this,t=!1,n=[],a=[];e.isDisabled=function(){return t},e.enable=function(){t=!1},e.disable=function(){t=!0},e.setToggleItem=function(e,t){n.push({element:e,scope:t})},e.getLockedItems=function(){return a},e.setLockedItem=function(e,t){a.push({element:e,scope:t})},e.clearLockedItems=function(){a=[]}}).directive("msNav",t).directive("msNavTitle",function(){return{restrict:"A",compile:function(e){return e.addClass("ms-nav-title"),function(){}}}}).directive("msNavButton",function(){return{restrict:"AE",compile:function(e){return e.addClass("ms-nav-button"),function(){}}}}).directive("msNavToggle",n)}(),function(){"use strict";function e(e,t){e.root?this.navigation=t.getNavigation(e.root):this.navigation=t.getNavigation(),this.toggleHorizontalMobileMenu=function(){angular.element("body").toggleClass("ms-navigation-horizontal-mobile-menu-active")},t.sort()}function t(c,m,u,p){return{restrict:"E",scope:{folded:"=",root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/vertical.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation"),function(e,t){var n=angular.element("body"),a=angular.element('<div id="ms-navigation-fold-expander"></div>'),i=angular.element('<div id="ms-navigation-fold-collapser"></div>'),s=u("navigation");function o(e){if(p.setFolded(e),e)c.$broadcast("msNavigation::collapse"),n.addClass("ms-navigation-folded"),r();else{var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.removeClass("ms-navigation-folded ms-navigation-folded-open"),i.remove()}}function r(){t.parent().append(a),m(function(){a.on("mouseenter touchstart",l)})}function l(e){e&&e.preventDefault(),p.setFoldedOpen(!0);var t=p.getActiveItem();t&&t.scope.$emit("msNavigation::stateMatched"),n.addClass("ms-navigation-folded-open"),a.remove(),n.find("#main").append(i),i.on("mouseenter touchstart",d)}function d(e){e&&e.preventDefault(),p.setFoldedOpen(!1),c.$broadcast("msNavigation::collapse"),n.removeClass("ms-navigation-folded-open"),i.remove(),r()}p.setNavigationScope(e),function(){null===p.getFolded()&&p.setFolded(e.folded);p.getFolded()&&(m(function(){c.$broadcast("msNavigation::collapse")}),n.addClass("ms-navigation-folded"),r())}(),e.$watch(function(){return s.isLockedOpen()},function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&p.getFolded())if(e)c.$broadcast("msNavigation::collapse");else{var n=p.getActiveItem();n&&n.scope.$emit("msNavigation::stateMatched")}}),e.$watch("folded",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||o(e)}),e.toggleFolded=function(){o(!p.getFolded())},e.$on("$stateChangeStart",function(){s.close()}),e.$on("$destroy",function(){i.off("mouseenter touchstart"),a.off("mouseenter touchstart")})}}}}function n(n,e,a,i,t,s){var o=this;o.element=e,o.node=n.node,o.hasChildren=void 0,o.collapsed=void 0,o.collapsable=void 0,o.group=void 0,o.animateHeightClass="animate-height",o.toggleCollapsed=function(){o.collapsed?o.expand():o.collapse()},o.collapse=function(){var e=o.element.children("ul"),t=e[0].offsetHeight;n.$evalAsync(function(){o.collapsed=!0,o.element.addClass("collapsing"),i.animate(e,{display:"block",height:t+"px"},{height:"0px"},o.animateHeightClass).then(function(){e.css({display:"",height:""}),o.element.removeClass("collapsing")}),n.$broadcast("msNavigation::collapse")})},o.expand=function(){var e=o.element.children("ul");e.css({position:"absolute",visibility:"hidden",display:"block",height:"auto"});var t=e[0].offsetHeight;e.css({position:"",visibility:"",display:"",height:""}),n.$evalAsync(function(){o.collapsed=!1,o.element.addClass("expanding"),i.animate(e,{display:"block",height:"0px"},{height:t+"px"},o.animateHeightClass).then(function(){e.css({height:""}),o.element.removeClass("expanding")}),a.$broadcast("msNavigation::collapse",o.node._path)})},o.getClass=function(){return o.node.class},o.isHidden=function(){if(angular.isDefined(o.node.hidden)&&angular.isFunction(o.node.hidden))return o.node.hidden();return!1},function(){o.hasChildren=0<o.node.children.length,o.group=!(!angular.isDefined(o.node.group)||!0!==o.node.group),!o.hasChildren||o.group?o.collapsable=!1:o.collapsable=!(!angular.isUndefined(o.node.collapsable)&&"boolean"==typeof o.node.collapsable&&!0!==o.node.collapsable);o.collapsable?o.collapsed=!(!angular.isUndefined(o.node.collapsed)&&"boolean"==typeof o.node.collapsed&&!0!==o.node.collapsed):o.collapsed=!1;if(o.node.state===t.current.name||t.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched"),s.setActiveItem(o.node,n)}n.$on("msNavigation::stateMatched",function(){o.collapsable&&o.collapsed&&n.$evalAsync(function(){o.collapsed=!1})}),n.$on("msNavigation::collapse",function(e,t){if(!o.collapsed&&o.collapsable)if(angular.isUndefined(t))o.collapse();else{var n=t.split("."),a=[],i=s.getActiveItem();if(i&&(a=i.node._path.split(".")),-1<n.indexOf(o.node._id))return;if(-1<a.indexOf(o.node._id))return;o.collapse()}}),n.$on("$stateChangeSuccess",function(){if(o.node.state===t.current.name){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;s.setActiveItem(o.node,n),a.$broadcast("msNavigation::collapse",o.node._path)}if(t.includes(o.node.state)){if(angular.isDefined(o.node.stateParams)&&angular.isDefined(t.params)&&!angular.equals(o.node.stateParams,t.params))return;n.$emit("msNavigation::stateMatched")}})}()}function a(t){return{restrict:"E",scope:{root:"@"},controller:"MsNavigationController as vm",templateUrl:"app/core/directives/ms-navigation/templates/horizontal.html",transclude:!0,compile:function(e){return e.addClass("ms-navigation-horizontal"),function(e){t.setNavigationScope(e)}}}}function i(n,e,t,a,i){var s=this;s.element=e,s.node=n.node,s.hasChildren=void 0,s.group=void 0,s.getClass=function(){return s.node.class},function(){if(s.isActive=!1,s.hasChildren=0<s.node.children.length,s.group=!(!angular.isDefined(s.node.group)||!0!==s.node.group),s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;n.$emit("msNavigation::stateMatched"),i.setActiveItem(s.node,n)}n.$on("msNavigation::stateMatched",function(){s.hasChildren&&n.$evalAsync(function(){s.isActive=!0})}),n.$on("msNavigation::clearActive",function(){if(s.hasChildren){var e=[],t=i.getActiveItem();t&&(e=t.node._path.split(".")),-1<e.indexOf(s.node._id)?n.$evalAsync(function(){s.isActive=!0}):n.$evalAsync(function(){s.isActive=!1})}}),n.$on("$stateChangeSuccess",function(){if(s.node.state===a.current.name||a.includes(s.node.state)){if(angular.isDefined(s.node.stateParams)&&angular.isDefined(a.params)&&!angular.equals(s.node.stateParams,a.params))return;i.setActiveItem(s.node,n),t.$broadcast("msNavigation::clearActive")}})}()}function s(i){return{restrict:"A",require:"^msNavigationHorizontalNode",compile:function(e){return e.addClass("ms-navigation-horizontal-item"),function(e,t,n,a){t.on("click",function(){if(!a.hasChildren||i("gt-md"))return;t.toggleClass("expanded")}),e.$on("$destroy",function(){t.off("click")})}}}}e.$inject=["$scope","msNavigationService"],t.$inject=["$rootScope","$timeout","$mdSidenav","msNavigationService"],n.$inject=["$scope","$element","$rootScope","$animate","$state","msNavigationService"],a.$inject=["msNavigationService"],i.$inject=["$scope","$element","$rootScope","$state","msNavigationService"],s.$inject=["$mdMedia"],angular.module("app.core").provider("msNavigationService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function o(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,s=0;s<t.length;s++)if(t[s]._id===a){t=t[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(o),t=o.children}}return t}(n),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,t),s.uisref=m(s)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=m(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){if(angular.isString(e)){for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],s=0;s<t.length;s++)if(t[s]._id===i){if(t[s]._path===e)return t.splice(s,1),!0;t=t[s].children;break}return!1}r.error("path must be a string (eg. `dashboard.project`)")}function c(e){e||(e=l).sort(a);for(var t=0;t<e.length;t++){var n=e[t].children;1<n.length&&n.sort(a),0<n.length&&c(n)}}function a(e,t){return parseInt(e.weight)-parseInt(t.weight)}function m(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=o,this.deleteItem=d,this.sortByWeight=c,this.$get=function(){var n=null,t=null,a=null,i=null,e={saveItem:o,deleteItem:d,sort:c,clearNavigation:function(){l=[],t&&(t.vm.navigation=l)},setActiveItem:function(e,t){n={node:e,scope:t}},getActiveItem:function(){return n},getNavigation:s,getFlatNavigation:function(e){return function e(t){var n=[];for(var a=0;a<t.length;a++){var i=angular.copy(t[a]);i.children=[],n.push(i),0<t[a].children.length&&(n=n.concat(e(t[a].children)))}return n}(s(e))},setNavigationScope:function(e){t=e},setFolded:function(e){a=e},getFolded:function(){return a},setFoldedOpen:function(e){i=e},getFoldedOpen:function(){return i},toggleFolded:function(){t.toggleFolded()}};return e;function s(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}}}).controller("MsNavigationController",e).directive("msNavigation",t).controller("MsNavigationNodeController",n).directive("msNavigationNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationNode"},controller:"MsNavigationNodeController as vm",compile:function(e){return e.addClass("ms-navigation-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationItem",function(){return{restrict:"A",require:"^msNavigationNode",compile:function(e){return e.addClass("ms-navigation-item"),function(e,t,n,a){a.collapsable&&t.on("click",a.toggleCollapsed),e.$on("$destroy",function(){t.off("click")})}}}}).directive("msNavigationHorizontal",a).controller("MsNavigationHorizontalNodeController",i).directive("msNavigationHorizontalNode",function(){return{restrict:"A",bindToController:{node:"=msNavigationHorizontalNode"},controller:"MsNavigationHorizontalNodeController as vm",compile:function(e){return e.addClass("ms-navigation-horizontal-node"),function(e,t,n,a){t.addClass(a.getClass()),a.group&&t.addClass("group")}}}}).directive("msNavigationHorizontalItem",s)}(),function(){"use strict";function e(i,n,s,e,a,o,t,r,l,d,c){var m=this,u=["ringingId","speakerId","microphoneId","ringingVolume","speakerVolume","microphoneVolume","ringingMute","speakerMute","microphoneMute"],p=JSON.parse(t.localStorage.getItem("motion2.user:"+m.conf.id))||{webrtc:{ringingVolume:.5,speakerVolume:.5,microphoneVolume:1,ringingMute:!1,speakerMute:!1,microphoneMute:!1}};function g(e){switch(e){case"ringing":m.conf.ringingMute?m.soundPlayer.muted=!0:m.soundPlayer.muted=!1,m.conf.ringingId&&m.soundPlayer.setSinkId(m.conf.ringingId).then(function(){m.soundPlayer.volume=m.conf.ringingVolume}).then(f).catch(function(e){console.info(e.message,m.conf.ringingId)});break;case"speaker":m.conf.speakerMute?m.remotePlayer.muted=!0:m.remotePlayer.muted=!1,m.conf.speakerId&&m.remotePlayer.setSinkId(m.conf.speakerId).then(function(){m.remotePlayer.volume=m.conf.speakerVolume}).then(f).catch(function(e){console.info(e.message,m.conf.speakerId)});break;case"microphone":for(var t=0;t<m.sessions.length;t+=1)m.conf.microphoneMute?m.sessions[t].mute():m.sessions[t].unmute();f();break;default:console.log("unknown device")}}function v(e,t,n){m.calls.unshift({target:e,fullname:n||e,inbound:t,time:moment().format("HH:mm")}),50<m.calls.length&&m.calls.pop()}function h(){return m.conf.license&&m.conf.isWebRTCSupported&&m.conf.hasMicrophone&&m.conf.hasSpeakers&&"https"===m.conf.protocol&&("chrome"===m.conf.browserName.toLowerCase()||"opera"===m.conf.browserName.toLowerCase()||"safari"===m.conf.browserName.toLowerCase())}function f(){p.webrtc=_.pick(m.conf,u),t.localStorage.setItem("motion2.user:"+m.conf.id,JSON.stringify(p))}function b(e){this.remotePlayer.srcObject=e.stream}function E(e){var t,n,a=e.session;switch(e.originator){case"local":a.outgoing=!0,a.name=e.request.ruri.user,a.user=e.request.ruri.user,v(a.user,!1);break;case"remote":a.incoming=!0,a.name=e.request.from.display_name,a.user=e.request.from.uri.user,t=e.session,n=t.name?t.name+" <"+t.user+">":t.user,c.create("Incoming call from: ",n,null,function(){t.answer(m.sessionConf)},function(){t.terminate()}).then(function(e){t.notification=e}).catch(function(e){console.error(e)}),v(e.session.user,!0),m.conf.autoAnswer&&s(function(){a.isInProgress()&&(a.autoAnswer=!0,m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,a.answer(m.sessionConf))},m.conf.autoAnswerDelay?1e3*m.conf.autoAnswerDelay:0)}a.call_id=e.request.call_id,a.connection&&(a.connection.onaddstream=b.bind(this)),a.on("progress",function(e,t){var n=!1;switch(t.originator){case"local":this.conf.ringingMute||(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/incoming-call.ogg"),n=!0);break;case"remote":this.putOtherCallsOnHold(e),this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/outgoing-call.ogg"),n=!0}n&&(this.soundPlayer.loop="loop",this.soundPlayer.play().catch(function(e){console.log(e.message)}))}.bind(this,a)),a.on("confirmed",function(n,e){return n.confirmed=!0,"remote"===e.originator&&n.connection&&(n.connection.onaddstream=b.bind(this),_.head(n.connection.getRemoteStreams())&&(this.remotePlayer.srcObject=_.head(n.connection.getRemoteStreams()))),this.soundPlayer.pause(),this.soundPlayer.loop=null,this.putOtherCallsOnHold(n),g("speaker"),g("microphone"),n.autoAnswer&&(this.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/beep.ogg"),this.soundPlayer.play().catch(function(e){console.log(e.message)})),2==m.sessions.length?m.canGoInConference=!0:m.canGoInConference=!1,d.rpc.getVoiceChannels().$promise.then(function(e){var t=_.find(e.rows,function(e){return e.sipcalllinkedid===n.call_id?e:e.sipcalluniqueid===n.call_id?e:null});t&&(n.monitor=t.monitor,n.uniqueid=t.uniqueid,n.monitors=t.monitors)}).catch(function(e){console.error(e)})}.bind(this,a)),a.on("hold",function(e,t){"local"===t.originator&&(e.localHold=!0)}.bind(this,a)),a.on("unhold",function(e,t){"local"===t.originator&&(e.localHold=!1)}.bind(this,a)),a.on("ended",function(e,t){_.includes(m.currentConferenceSessions,e.id)&&T(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),a.on("failed",function(e,t){this.soundPlayer.pause(),this.soundPlayer.loop=null,e.notification&&e.notification.close(),_.includes(m.currentConferenceSessions,e.id)&&T(),_.remove(this.sessions,{id:e.id})}.bind(this,a)),this.sessions.push(a)}function A(){m.target="",document.getElementById("ms-target").blur(),document.getElementById("ms-target").value="",i.$broadcast("angucomplete-alt:clearInput","ms-target-wrap")}function y(e,t,n,a){return function(){o.show(o.simple().textContent(t).position(n).hideDelay(a)),e.terminate()}}function S(t){return d.user.getVoicePrefixes({id:m.conf.id}).$promise.then(function(e){if(e.count)return a.show({controller:"PrefixDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/prefix/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{prefixes:e,required:m.conf.phoneBarPrefixRequired}})}).then(function(e){if(m.conf.phoneBarPrefixRequired){if(e&&-1!==e)return e+t}else{if(e&&-1!==e)return e+t;if(!e)return t}})}function T(){m.canGoInConference=!1,m.isInConference=!1,m.currentconferenceSessions=[]}e(function(){},999),m.direction="right",m.selectedMode="md-scale",m.target="",m.showDialpad=!1,m.soundPlayer=document.createElement("audio"),m.remotePlayer=document.getElementById(m.conf.remotePlayerId),m.soundPlayer.volume=1,m.sessionConf={mediaConstraints:{audio:!0,video:!1}},m.sessions=[],m.calls=[],m.canGoInConference=!1,m.isInConference=!1,m.currentConferenceSessions=[],m.ua=new JsSIP.UA({sockets:[new JsSIP.WebSocketInterface("wss://"+m.conf.host+":8089/ws")],uri:new JsSIP.URI("sip",m.conf.name,m.conf.host,5060,null,null).toString(),authorization_user:m.conf.name,ha1:m.conf.ha1,realm:m.conf.realm,user_agent:m.conf.ua,session_timers_refresh_method:"invite",register_expires:m.conf.phoneBarExpires||60,register:!0}),m.conf=_.merge(p.webrtc,m.conf),n.bind("keyup",function(e){switch(e.keyCode){case 27:s(function(){m.showDialpad=!1})}}),m.$onInit=function(){g("ringing"),g("speaker"),this.ua.on("registered",function(){console.log("registered"),this.registered=!0}.bind(this)),this.ua.on("unregistered",function(){console.log("unregistered"),this.registered=!1}.bind(this)),this.ua.on("newRTCSession",E.bind(this)),DetectRTC.load(function(){this.conf.hasMicrophone=DetectRTC.hasMicrophone,this.conf.hasSpeakers="Chrome"!==DetectRTC.browser.name&&"Edge"!==DetectRTC.browser.name&&"Opera"!==DetectRTC.browser.name||DetectRTC.hasSpeakers,this.conf.isWebRTCSupported=DetectRTC.isWebRTCSupported,this.conf.osName=DetectRTC.osName,this.conf.osVersion=DetectRTC.osVersion,this.conf.browserName=DetectRTC.browser.name,this.conf.browserVersion=DetectRTC.browser.version,h()?this.ua.start():this.conf.license||l.warning({title:r.instant("TOOLBAR.WARNING"),msg:r.instant("TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"),clickToClose:!0,showClose:!0,shake:!1,timeout:!1,position:"bottom-right"})}.bind(this))}.bind(this),m.type=function(e,t){var n=e;switch(m.target||(m.target=""),t&&(m.target+=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)),e){case"*":n="asterisk";break;case"#":n="pound"}m.conf.enableDtmfTone&&(m.soundPlayer.setAttribute("src","assets/ms-phonebar/sounds/dialpad/"+n+".ogg"),m.soundPlayer.play().catch(function(e){console.log(e.message)}));for(var a=0;a<m.sessions.length;a+=1)m.sessions[a].isEstablished()&&!m.sessions[a].isOnHold().local&&m.sessions[a].sendDTMF(e)},m.call=function(){if(m.target&&m.target!==m.conf.name&&m.target!==m.conf.internal){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0;var e=m.target.replace(/ /g,"");return S(e=(e=e.replace(/\(/g,"")).replace(/\)/g,"")).then(function(e){e&&m.ua.call(e,m.sessionConf)}).then(function(){A()})}},m.hold=function(e){e.hold({useUpdate:!1})},m.refer=function(t){var e=a.prompt().title("Transfer").textContent("Type the target").placeholder("Target").ariaLabel("Target").ok("Transfer").cancel("Cancel");a.show(e).then(function(e){return S(e)}).then(function(e){t.refer(e,{eventHandlers:{requestSucceeded:y(t,"requestSucceeded","top right",3e3),requestFailed:y(t,"requestFailed","top right",3e3)}})})},m.record=function(e){a.show({controller:"RecordDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/record/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{session:e,sessions:m.sessions}})},m.unhold=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.answer=function(e){m.conf.microphoneId?m.sessionConf.mediaConstraints.audio={deviceId:m.conf.microphoneId}:m.sessionConf.mediaConstraints.audio=!0,e.answer(m.sessionConf)},m.terminate=function(e){e.terminate()},m.selectSession=function(e){e.unhold({useUpdate:!1}),m.putOtherCallsOnHold(e)},m.typeWrapper=function(e){switch(e.key.toLowerCase()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"*":case"#":m.type(e.key);break;case"enter":m.call()}},m.toggleDialpad=function(){m.showDialpad=!m.showDialpad},m.referAttended=function(e){a.show({controller:"ReferAttendedDialogController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/referAttended/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{session:e,sessions:_.reject(m.sessions,{id:e.id})}})},m.closeDialpad=function(){m.showDialpad=!1},m.initDevice=g,m.putOtherCallsOnHold=function(e){if(1<m.sessions.length)for(var t=0;t<m.sessions.length;t+=1)m.sessions[t].id===e.id||m.sessions[t].isOnHold().remote||m.sessions[t].hold({useUpdate:!1})},m.targetChanged=function(e){e?/^(\w|\.|\+|#|\*|\(|\)|\s|\-)*$/.test(e)?(m.target=e,i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target)):m.target?i.$broadcast("angucomplete-alt:changeInput","ms-target-wrap",m.target):A():A()},m.targetSelected=function(e){e&&(m.target=e.originalObject.target,m.call(),A())},m.start3WayConf=function(){m.isInConference=!0,m.canGoInConference=!1,m.confSessions=[];var a=[];m.sessions.forEach(function(e){m.currentConferenceSessions.push(e.id),e.unhold({useUpdate:!1}),null!=e&&e.connection.getReceivers().forEach(function(e){a.push(e.track)})});var i=new AudioContext,s=new MediaStream;m.sessions.forEach(function(e){if(null!=e){var n=i.createMediaStreamDestination();e.connection.getReceivers().forEach(function(t){a.forEach(function(e){s.addTrack(t.track),t.track.id!==e.id&&i.createMediaStreamSource(new MediaStream([e])).connect(n)})}),e.connection.getSenders().forEach(function(e){i.createMediaStreamSource(new MediaStream([e.track])).connect(n)}),e.connection.getSenders()[0].replaceTrack(n.stream.getTracks()[0])}});var e=document.getElementById("remote-audio");e.srcObject=s;var t=e.play();void 0!==t&&t.then(function(){}).catch(function(e){console.log(e)})},i.$on("webrtc::settings",function(e){a.show({controller:"SettingsController",controllerAs:"vm",templateUrl:"assets/ms-phonebar/settings/settings.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{devices:function(){return navigator.mediaDevices.enumerateDevices()}},locals:{conf:m.conf}}).then(function(e){e&&(m.conf=e,g("ringing"),g("speaker"))})}),i.$on("webrtc::logout",function(){m.ua.stop()}),i.$on("webrtc::call",function(e,t){t.target&&(m.target=t.target,m.call())}),i.$on("webrtc::transfer",function(e,t){if(t.target)for(var n=0;n<m.sessions.length;n+=1)if(m.sessions[n].isEstablished()&&!m.sessions[n].isOnHold().local)return S(t.target).then(function(e){e&&m.sessions[n].refer(e,{eventHandlers:{requestSucceeded:y(m.sessions[n],"requestSucceeded","top right",3e3),requestFailed:y(m.sessions[n],"requestFailed","top right",3e3)}})})})}e.$inject=["$scope","$document","$timeout","$interval","$mdDialog","$mdToast","$window","$translate","toasty","api","motNotification"],angular.module("app.core").controller("MsPhonebarController",e).directive("msPhonebar",function(){return{restrict:"E",scope:{conf:"="},require:"msPhonebar",controller:"MsPhonebarController",controllerAs:"vm_pb",bindToController:!0,templateUrl:"assets/ms-phonebar/ms-phonebar.html"}})}(),function(){"use strict";function e(t,e,n){var a=this;a.prefixes=e,a.required=n,a.closeDialog=function(e){t.hide(e)},a.call=function(){t.hide(a.prefix)}}e.$inject=["$mdDialog","prefixes","required"],angular.module("app.core").controller("PrefixDialogController",e)}(),function(){"use strict";function e(i){return{restrict:"C",controller:["$scope","$element",function(e,t){function n(){t.css("display","inline"),i(a,1e3)}function a(){t.css("display","none"),i(n,1e3)}n()}],replace:!0}}function t(t,i,s,e,n){var o=this;function a(t,e){console.log("startMonitor");var n=i.defer(),a=(e||t.filename.replace(/^.*[\\\/]/,"")).split(".")[0];return s.rpc.startMonitor({uniqueid:o.session.uniqueid,filename:a,format:"wav"}).$promise.then(function(e){t.filename=a+".wav",t.mixmonitorid=e.mixmonitorid,t.status="rec",o.session.monitor=!0,n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise}o.title="Record",o.sessions=e,o.session=n,o.closeDialog=function(){t.hide()},o.addRecording=function(){var e=t.prompt({skipHide:!0}).title("Start new recording").textContent("Type the file name.").placeholder("File name").ariaLabel("File name").initialValue(function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}()).ok("Start").cancel("Cancel");t.show(e).then(function(e){return a({},e)}).then(function(e){o.session.monitors.push(e)})},o.stop=function(t){return console.log("stopMonitor"),s.rpc.stopMonitor({uniqueid:o.session.uniqueid,mixmonitorid:t.mixmonitorid}).$promise.then(function(e){t.status="pause",o.session.monitor=_.includes(o.session.monitors,{status:"rec"})}).catch(function(e){console.error(e)})},o.start=a}e.$inject=["$timeout"],t.$inject=["$mdDialog","$q","api","sessions","session"],angular.module("app.core").directive("msBlink",e).controller("RecordDialogController",t)}(),function(){"use strict";function e(t,a,i,e){var s=this;function o(e){t.hide(e)}s.title="Refer Attended",s.sessions=i,s.session=e,s.sessionTarget=null,i.length&&(s.target=i[0].user),s.closeDialog=o,s.transfer=function(){var e,t,n=_.find(i,function(e){if(e.user===s.target)return e});t=n.outgoing?(e=n,s.session):(e=s.session,n);t.refer(e.user,{replaces:e,eventHandlers:{requestSucceeded:function(e){a.show(a.simple().textContent("requestSucceeded").position("top right").hideDelay(3e3)),o(),t.terminate()},requestFailed:function(e){a.show(a.simple().textContent("requestFailed").position("top right").hideDelay(3e3)),o(),t.terminate()}}})}}e.$inject=["$mdDialog","$mdToast","sessions","session"],angular.module("app.core").controller("ReferAttendedDialogController",e)}(),function(){"use strict";function e(e,s,t){var n=this;function a(e,t,n){var a;if(s[n]){if(a=_.find(e,function(e){return e.deviceId===s[n]}))return a.deviceId;var i=_.findIndex(e,function(e){return e.kind===t});if(0<=i)return e[i].deviceId}else(a=_.find(e,function(e){return e.kind===t}))&&(s[n]=a.deviceId);return s[n]||null}s.ringingId=a(t,"audiooutput","ringingId"),s.speakerId=a(t,"audiooutput","speakerId"),s.microphoneId=a(t,"audioinput","microphoneId"),s.ringingVolume=s.ringingVolume||.5,s.speakerVolume=s.speakerVolume||.5,s.microphoneVolume=s.microphoneVolume||1,s.ringingMute=s.ringingMute||!1,s.speakerMute=s.speakerMute||!1,s.microphoneMute=s.microphoneMute||!1,n.conf=angular.copy(s),n.devices=t,n.saveSettings=function(){e.hide(n.conf)},n.closeDialog=function(){e.hide()},n.isCompatibleBrowser=function(){return"chrome"===n.conf.browserName.toLowerCase()||"opera"===n.conf.browserName.toLowerCase()||"safari"===n.conf.browserName.toLowerCase()}}e.$inject=["$mdDialog","conf","devices"],angular.module("app.toolbar").controller("SettingsController",e)}(),function(){"use strict";angular.module("app.core").directive("msRandomClass",function(){return{restrict:"A",scope:{msRandomClass:"="},link:function(e,t){var n=e.msRandomClass[Math.floor(Math.random()*e.msRandomClass.length)];t.addClass(n)}}})}(),function(){"use strict";function e(i){return{restrict:"E",scope:{id:"=",model:"=",download:"="},replace:!0,link:function(t,e){var n=!1,a=document.createElement("audio");t.download||a.setAttribute("controlsList","nodownload"),a.setAttribute("preload","none"),a.setAttribute("controls",""),a.setAttribute("style","width: 265px;"),a.setAttribute("src"," "),a.onplay=function(e){n||(n=!0,e.preventDefault(),i[t.model||"voiceRecording"].download({id:t.id}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type});a.setAttribute("type",e.type),a.setAttribute("src",URL.createObjectURL(n)),a.play()}).catch(function(e){console.error(e)}))},e.append(a)}}}e.$inject=["api"],angular.module("app.core").directive("msRecording",e)}(),function(){"use strict";angular.module("app.core").directive("msResponsiveTable",function(){return{restrict:"A",link:function(e,t){var n=angular.element('<div class="ms-responsive-table-wrapper"></div>');t.after(n),n.append(t)}}})}(),function(){"use strict";function e(s,o,t,n){return{restrict:"AE",compile:function(e){if(!(n.getConfig("disableCustomScrollbars")||n.getConfig("disableCustomScrollbarsOnMobile")&&t.isMobile()))return e.addClass("ms-scroll"),function(e,t,n){var a={};function i(){PerfectScrollbar.update(t[0])}n.msScroll&&(a=e.$eval(n.msScroll)),a=angular.extend({},o.getConfig(),a),s(function(){PerfectScrollbar.initialize(t[0],a)},0),t.on("mouseenter",i),e.$watch(function(){return t.prop("scrollHeight")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$watch(function(){return t.prop("scrollWidth")},function(e,t){angular.isUndefined(e)||angular.equals(e,t)||i()}),e.$on("$destroy",function(){t.off("mouseenter"),PerfectScrollbar.destroy(t[0])})}}}}e.$inject=["$timeout","msScrollConfig","msUtils","motionConfig"],angular.module("app.core").provider("msScrollConfig",function(){var t={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,stopPropagationOnClick:!0};this.config=function(e){t=angular.extend({},t,e)},this.$get=function(){var e={getConfig:function(){return t}};return e}}).directive("msScroll",e)}(),function(){"use strict";function e(s,i,e){var o=this;o.collapsed=!0,o.query="",o.queryOptions={debounce:o.debounce||0};var t=!(!o.collapseOnBlur||"true"!=o.collapseOnBlur);o.resultsLoading=!1,o.results=null,o.selectedResultIndex=0,o.ignoreMouseEvents=!1,o.populateResults=function(e){if(o.collapsed)return;var t=angular.isArray(e),n=null===e;if(!t&&!n)return;o.selectedResultIndex=0,o.results=e},o.expand=function(){o.collapsed=!1,s.expand(),o.onExpand&&angular.isFunction(o.onExpand)&&o.onExpand()},o.collapse=function(){o.query="",o.populateResults(null),o.collapsed=!0,s.collapse(),o.onCollapse&&angular.isFunction(o.onCollapse)&&o.onCollapse()},o.blurCollapse=function(){if(!t)return;o.collapse()},o.absorbEvent=function(e){e.preventDefault()},o.handleKeydown=function(e){var t=e.keyCode;-1<[27,38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:if(!o.results)return;o.handleResultClick(o.results[o.selectedResultIndex]);break;case 27:o.collapse();break;case 38:0<=o.selectedResultIndex-1&&(o.selectedResultIndex--,o.ensureSelectedResultIsVisible());break;case 40:if(!o.results)return;o.selectedResultIndex+1<o.results.length&&(o.selectedResultIndex++,o.ensureSelectedResultIsVisible())}},o.handleMouseenter=function(e){if(o.ignoreMouseEvents)return;o.selectedResultIndex=e},o.temporarilyIgnoreMouseEvents=function(){o.ignoreMouseEvents=!0,e.cancel(o.mouseEventIgnoreTimeout),o.mouseEventIgnoreTimeout=e(function(){o.ignoreMouseEvents=!1},250)},o.handleResultClick=function(e){o.onResultClick&&o.onResultClick({item:e});o.collapse()},o.ensureSelectedResultIsVisible=function(){var e=i.find(".ms-search-bar-results"),t=angular.element(e.find(".result")[o.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;o.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},s.$watch("MsSearchBar.query",function(e,t){if(!angular.isUndefined(e)&&!angular.equals(e,t)&&!o.collapsed){var n=s.$parent.$eval(o.onSearch,{query:e}),a=angular.isArray(n),i=n&&!!n.then;a&&o.populateResults(n),i&&(o.resultsLoading=!0,n.then(function(e){o.populateResults(e)},function(){o.populateResults([])}).finally(function(){o.resultsLoading=!1}))}})}function t(i){return{restrict:"E",scope:{},require:"msSearchBar",controller:"MsSearchBarController as MsSearchBar",bindToController:{debounce:"=?",onSearch:"@",onResultClick:"&?",onExpand:"&?",onCollapse:"&?",collapseOnBlur:"@"},templateUrl:"app/core/directives/ms-search-bar/ms-search-bar.html",compile:function(e){return e.addClass("ms-search-bar"),function(e,t){var n,a=i.find("body");e.collapse=function(){t.removeClass("expanded"),a.removeClass("ms-search-bar-expanded")},e.expand=function(){t.addClass("expanded"),a.addClass("ms-search-bar-expanded"),n.focus()},n=t.find("#ms-search-bar-input")}}}}e.$inject=["$scope","$element","$timeout"],t.$inject=["$document"],angular.module("app.core").controller("MsSearchBarController",e).directive("msSearchBar",t)}(),function(){"use strict";function e(e,n,i,o,r,l){var d=this;d.query="",d.queryOptions={debounce:300},d.resultsLoading=!1,d.selectedResultIndex=0,d.ignoreMouseEvents=!1,d.mobileBarActive=!1,d.results=null,d.shortcuts=[],d.sortableOptions={ghostClass:"ghost",forceFallback:!0,fallbackClass:"dragging",onSort:function(){d.saveShortcuts()}},d.populateResults=function(){for(var e=[],t=l.getFlatNavigation(),n=r.defer(),a=0;a<t.length;a++)t[a].uisref&&e.push(t[a]);if(d.query){e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(d.query)))return!0});for(var i=0;i<e.length;i++){e[i].hasShortcut=!1;for(var s=0;s<d.shortcuts.length;s++)if(d.shortcuts[s]._id===e[i]._id){e[i].hasShortcut=!0;break}}}else 0<d.shortcuts.length&&(e=d.shortcuts);return d.selectedResultIndex=0,o(function(){n.resolve(e)},250),n.promise},d.loadShortcuts=function(){var e=r.defer(),t=angular.fromJson(n.get("motion.shortcuts"));angular.isUndefined(t)&&(t=[{title:"Agents",icon:"icon-account-multiple",state:"app.staff.agents",weight:5,children:[],uisref:"app.staff.agents",hasShortcut:!0},{title:"License",icon:"icon-cog",state:"app.settings.license",weight:10,children:[],uisref:"app.settings.license",hasShortcut:!0}],n.put("motion.shortcuts",angular.toJson(t)));return e.resolve(t),e.promise},d.saveShortcuts=function(){var e=r.defer();return n.put("motion.shortcuts",angular.toJson(d.shortcuts)),o(function(){e.resolve({success:!0})},250),e.promise},d.addShortcut=function(e){e.hasShortcut=!0,d.shortcuts.push(e),d.saveShortcuts()},d.removeShortcut=function(e){e.hasShortcut=!1;for(var t=0;t<d.shortcuts.length;t++)d.shortcuts[t]._id===e._id&&(d.shortcuts.splice(t,1),d.query||(0===d.shortcuts.length?d.results=null:t>=d.shortcuts.length&&(d.selectedResultIndex=d.shortcuts.length-1)));d.saveShortcuts()},d.handleResultClick=function(e){e.hasShortcut?d.removeShortcut(e):d.addShortcut(e)},d.absorbEvent=function(e){e.preventDefault()},d.handleKeydown=function(e){var t=e.keyCode;-1<[38,40].indexOf(t)&&e.preventDefault();switch(t){case 13:d.handleResultClick(d.results[d.selectedResultIndex]);break;case 38:0<=d.selectedResultIndex-1&&(d.selectedResultIndex--,d.ensureSelectedResultIsVisible());break;case 40:d.selectedResultIndex+1<d.results.length&&(d.selectedResultIndex++,d.ensureSelectedResultIsVisible())}},d.handleMouseenter=function(e){if(d.ignoreMouseEvents)return;d.selectedResultIndex=e},d.temporarilyIgnoreMouseEvents=function(){d.ignoreMouseEvents=!0,o.cancel(d.mouseEventIgnoreTimeout),d.mouseEventIgnoreTimeout=o(function(){d.ignoreMouseEvents=!1},250)},d.ensureSelectedResultIsVisible=function(){var e=i.find("#ms-shortcut-add-menu").find(".results"),t=angular.element(e.find(".result")[d.selectedResultIndex]);if(e&&t){var n=t.position().top-8,a=t.position().top+t.outerHeight()+8;d.temporarilyIgnoreMouseEvents(),e.scrollTop()>n&&e.scrollTop(n),a>e.height()+e.scrollTop()&&e.scrollTop(a-e.height())}},d.toggleMobileBar=function(){d.mobileBarActive=!d.mobileBarActive},d.loadShortcuts().then(function(e){d.shortcuts=e,0<d.shortcuts.length&&(d.results=e)}),e.$watch("MsShortcuts.query",function(e,t){angular.isUndefined(e)||angular.equals(e,t)||(d.resultsLoading=!0,d.populateResults().then(function(e){d.results=e},function(){d.results=[]}).finally(function(){d.resultsLoading=!1}))})}e.$inject=["$scope","$cookies","$document","$timeout","$q","msNavigationService"],angular.module("app.core").controller("MsShortcutsController",e).directive("msShortcuts",function(){return{restrict:"E",scope:{},require:"msShortcuts",controller:"MsShortcutsController as MsShortcuts",bindToController:{},templateUrl:"app/core/directives/ms-shortcuts/ms-shortcuts.html",compile:function(e){return e.addClass("ms-shortcuts"),function(e,t){}}}})}(),function(){"use strict";angular.module("app.core").directive("msSidenavHelper",function(){return{restrict:"A",require:"^mdSidenav",link:function(e,t,n,a){e.$watch(function(){return a.isOpen()&&!a.isLockedOpen()},function(e){angular.isUndefined(e)||(t.parent().toggleClass("full-height",e),angular.element("html").toggleClass("sidenav-open",e))})}}})}(),function(){"use strict";function e(a){return{restrict:"E",link:function(e,t){var n=e.$on("msSplashScreen::remove",function(){a.leave(t).then(function(){n(),e=t=null})})}}}e.$inject=["$animate"],angular.module("app.core").directive("msSplashScreen",e)}(),function(){"use strict";function e(e){var i=this;function t(){i.setCurrentStep(1)}function n(e){return o(e)?i.steps[e-1].scope.optionalStep:null}function a(e){return o(e)?!!i.steps[e-1].scope.hideStep:null}function s(e){return o(e)?!!n(e)||i.steps[e-1].form.$valid:null}function o(e){return!(angular.isUndefined(e)||e<1||e>i.steps.length)}i.mainForm=void 0,i.orientation="horizontal",i.steps=[],i.currentStep=void 0,i.currentStepNumber=1,i.setOrientation=function(e){i.orientation=e||"horizontal"},i.registerMainForm=function(e){i.mainForm=e},i.registerStep=function(e,t,n){var a={element:e,scope:t,form:n,stepNumber:t.step||i.steps.length+1,stepTitle:t.stepTitle,stepTitleTranslate:t.stepTitleTranslate};return i.steps.push(a),i.steps.sort(function(e,t){return e.stepNumber-t.stepNumber}),a},i.setupSteps=function(){i.setCurrentStep(i.currentStepNumber)},i.resetForm=function(){e(function(){for(var e=0;e<i.steps.length;e++)i.steps[e].form.$setPristine(),i.steps[e].form.$setUntouched();i.mainForm.$setPristine(),i.mainForm.$setUntouched(),t()})},i.setCurrentStep=function(e){if(!o(e))return;if(i.currentStepNumber=e,"horizontal"===i.orientation){for(var t=0;t<i.steps.length;t++)i.steps[t].element.hide();i.steps[i.currentStepNumber-1].element.show()}else if("vertical"===i.orientation){for(var n=0;n<i.steps.length;n++)i.steps[n].element.find(".ms-stepper-step-content").hide();i.steps[i.currentStepNumber-1].element.find(".ms-stepper-step-content").show()}},i.gotoStep=function(e){if(a(e))return;i.setCurrentStep(e)},i.gotoPreviousStep=function(){for(var e=i.currentStepNumber-1,t=e;1<=t;t--)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoNextStep=function(){for(var e=i.currentStepNumber+1,t=e;t<=i.steps.length;t++)if(!a(t)){e=t;break}i.setCurrentStep(e)},i.gotoFirstStep=t,i.gotoLastStep=function(){i.setCurrentStep(i.steps.length)},i.isFirstStep=function(){return 1===i.currentStepNumber},i.isLastStep=function(){return i.currentStepNumber===i.steps.length},i.isStepCurrent=function(e){return o(e)?i.currentStepNumber===e:null},i.isStepDisabled=function(e){if(!o(e))return null;for(var t=!1,n=1;n<e;n++)if(!s(n)){t=!0;break}return t},i.isStepOptional=n,i.isStepHidden=a,i.filterHiddenStep=function(e){return!a(e.stepNumber)},i.isStepValid=s,i.isStepNumberValid=o,i.isFormValid=function(){return i.mainForm.$valid}}function t(o){return{restrict:"A",scope:{},require:["form","msVerticalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/vertical.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],s=a[1];o(function(){s.setOrientation("vertical"),s.registerMainForm(i),s.setupSteps()})}}}}e.$inject=["$timeout"],t.$inject=["$timeout"],angular.module("app.core").controller("MsStepperController",e).directive("msHorizontalStepper",function(){return{restrict:"A",scope:{},require:["form","msHorizontalStepper"],priority:1001,controller:"MsStepperController as MsStepper",bindToController:{model:"=ngModel"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/horizontal/horizontal.html",compile:function(e){return e.addClass("ms-stepper"),function(e,t,n,a){var i=a[0],s=a[1];s.setOrientation("horizontal"),s.registerMainForm(i),s.setupSteps()}}}}).directive("msHorizontalStepperStep",function(){return{restrict:"E",require:["form","^msHorizontalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(n.optionalStep),s.registerStep(t,e,i),t.hide()}}}}).directive("msVerticalStepper",t).directive("msVerticalStepperStep",function(){return{restrict:"E",require:["form","^msVerticalStepper"],priority:1e3,scope:{step:"=?",stepTitle:"=?",stepTitleTranslate:"=?",optionalStep:"=?",hideStep:"=?"},transclude:!0,templateUrl:"app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",compile:function(e){return e.addClass("ms-stepper-step"),function(e,t,n,a){var i=a[0],s=a[1];e.optionalStep=angular.isDefined(n.optionalStep),e.stepInfo=s.registerStep(t,e,i),e.MsStepper=s,t.find(".ms-stepper-step-content").hide()}}}})}(),function(){"use strict";function e(e){return{restrict:"E",scope:{},transclude:!0,controller:"MsTabScrollController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-tab-scroll/ms-tab-scroll.html",compile:function(e){return e.addClass("ms-tab-scroll"),function(e,t){}}}}e.$inject=["$document"],angular.module("app.core").controller("MsTabScrollController",function(){function t(){var e=document.getElementById("bar-container"),t=document.getElementById("tab-container");return t.scrollWidth>e.scrollWidth&&0==e.scrollLeft&&0==t.scrollLeft?"right":t.scrollWidth>e.scrollWidth&&t.scrollLeft>e.scrollLeft&&e.scrollWidth+t.scrollLeft>=t.scrollWidth?"left":t.scrollWidth>e.scrollWidth&&t.scrollLeft>e.scrollLeft&&e.scrollWidth+t.scrollLeft<t.scrollWidth?"both":"none"}this.onTabScroll=function(e){"left"==e?$("#tab-container").stop().animate({scrollLeft:"-=400"},1e3):$("#tab-container").stop().animate({scrollLeft:"+=400"},1e3)},this.canScroll=function(e){switch(t()){case"both":return!0;case"left":return"left"==e;case"right":return"right"==e;case"none":default:return!1}}}).directive("msTabScroll",e)}(),function(){"use strict";function e(m,u){return{scope:!0,require:"^msTimeline",compile:function(e){return e.addClass("ms-timeline-item").addClass("hidden"),function(e,n,t,a){var i=72,s=!1,o=!1,r=a.getScrollEl();!function(){n.find("ms-card")?e.$on("msCard::cardTemplateLoaded",function(e,t){var n=angular.element(t[0]);d(n).then(function(){m(function(){s=!0})})}):d(n).then(function(){m(function(){s=!0})});r.on("scroll",c),c()}();var l=e.$watch(function(){return s&&o},function(e,t){angular.equals(e,t)||e&&(n.removeClass("hidden").addClass("animate"),l())},!0);function d(e){var t=u.defer(),n=e.find("img");return 0<n.length?n.on("load",function(){t.resolve("Image is loaded")}):t.resolve("No images"),t.promise}function c(){r.scrollTop()+r.height()>n.position().top+i&&(m(function(){o=!0}),r.off("scroll",c))}}}}}e.$inject=["$timeout","$q"],angular.module("app.core").controller("MsTimelineController",function(){var t=this;t.scrollEl=void 0,t.setScrollEl=function(e){t.scrollEl=e},t.getScrollEl=function(){return t.scrollEl}}).directive("msTimeline",function(){return{scope:{msTimeline:"=?",loadMore:"&?msTimelineLoadMore"},controller:"MsTimelineController",compile:function(e){return e.addClass("ms-timeline"),function(e,t,n,a){var i=angular.element('<div class="ms-timeline-loader md-accent-bg md-whiteframe-4dp"><span class="spinner animate-rotate"></span></div>');t.append(i);var s={scrollEl:"#content"};s=angular.extend(s,e.msTimeline,{});var o=angular.element(s.scrollEl);a.setScrollEl(o);var r=144;function l(){o.scrollTop()+o.height()+r>i.position().top&&(i.addClass("show"),c(),e.loadMore().then(function(){i.removeClass("show"),d()},function(){i.remove()}))}function d(){o.on("scroll",l)}function c(){o.off("scroll",l)}d(),e.$on("$destroy",function(){c()})}}}}).directive("msTimelineItem",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l){function d(){a.timeoutId&&clearTimeout(a.timeoutId)}function c(){void 0!==o.startTime&&(a.millis=moment().diff(moment(a.startTime))),a.maxTimeUnit&&"day"!==a.maxTimeUnit?"second"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3),a.minutes=0,a.hours=0,a.days=0,a.months=0,a.years=0):"minute"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4),a.hours=0,a.days=0,a.months=0,a.years=0):"hour"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5),a.days=0,a.months=0,a.years=0):"month"===a.maxTimeUnit?(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24%30),a.months=Math.floor(a.millis/36e5/24/30),a.years=0):"year"===a.maxTimeUnit&&(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24%30),a.months=Math.floor(a.millis/36e5/24/30%12),a.years=Math.floor(a.millis/36e5/24/365)):(a.seconds=Math.floor(a.millis/1e3%60),a.minutes=Math.floor(a.millis/6e4%60),a.hours=Math.floor(a.millis/36e5%24),a.days=Math.floor(a.millis/36e5/24),a.months=0,a.years=0),a.secondsS=1===a.seconds||0===a.seconds?"":"s",a.minutesS=1===a.minutes||0===a.minutes?"":"s",a.hoursS=1===a.hours||0===a.hours?"":"s",a.daysS=1===a.days||0===a.days?"":"s",a.monthsS=1===a.months||0===a.months?"":"s",a.yearsS=1===a.years||0===a.years?"":"s",a.sseconds=a.seconds<10?"0"+a.seconds:a.seconds,a.mminutes=a.minutes<10?"0"+a.minutes:a.minutes,a.hhours=a.hours<10?"0"+a.hours:a.hours,a.ddays=a.days<10?"0"+a.days:a.days,a.mmonths=a.months<10?"0"+a.months:a.months,a.yyears=a.years<10?"0"+a.years:a.years}"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.autoStart=o.autoStart||o.autostart,0===r.html().trim().length?r.append(l("<span>{{millis}}</span>")(a)):r.append(l(r.contents())(a)),a.interval=a.intervalAttr||1e3,a.startTime=null,a.endTime=null,a.timeoutId=null,a.countdown=a.countdownAttr&&0<=parseInt(a.countdownAttr,10)?parseInt(a.countdownAttr,10):void 0,a.isRunning=!1,a.$watch("startTimeAttr",function(e,t){e!==t&&a.isRunning&&a.start()}),a.$on("timer-start",function(){a.start()}),a.$on("timer-resume",function(){a.resume()}),a.$on("timer-stop",function(){a.stop()}),a.$on("timer-clear",function(){a.clear()}),a.$on("timer-set-countdown",function(e,t){a.countdown=t}),a.start=r[0].start=function(){var e=moment(),t=a.startTimeAttr?moment(a.startTimeAttr):null;a.startTime=!t||e<t?e:t;var n=a.endTimeAttr?moment(a.endTimeAttr):null;a.endTime=!n||n<e?null:n,a.countdown||(a.countdown=a.countdownAttr&&0<parseInt(a.countdownAttr,10)?parseInt(a.countdownattr,10):void 0),d(),m(),a.isRunning=!0},a.resume=r[0].resume=function(){d(),a.countdownAttr&&(a.countdown+=1),a.startTime=moment().diff(moment(a.stoppedTime).diff(moment(a.startTime))),m(),a.isRunning=!0},a.stop=a.pause=r[0].stop=r[0].pause=function(){a.clear(),a.$emit("timer-stopped",{timeoutId:a.timeoutId,millis:a.millis,seconds:a.seconds,minutes:a.minutes,hours:a.hours,days:a.days})},a.clear=r[0].clear=function(){a.stoppedTime=moment(),d(),a.timeoutId=null,a.isRunning=!1},r.bind("$destroy",function(){d(),a.isRunning=!1});var m=function(){a.millis=moment().diff(a.startTime);var e=a.millis%1e3;if(a.endTimeAttr&&(a.millis=moment(a.endTime).diff(moment()),e=a.interval-a.millis%1e3),a.countdownAttr&&(a.millis=1e3*a.countdown),a.millis<0)return a.stop(),a.millis=0,c(),void(a.finishCallback&&a.$eval(a.finishCallback));c(),a.timeoutId=setTimeout(function(){m(),a.$digest()},a.interval-e),a.$emit("timer-tick",{timeoutId:a.timeoutId,millis:a.millis}),0<a.countdown?a.countdown--:a.countdown<=0&&(a.stop(),a.finishCallback&&a.$eval(a.finishCallback))};void 0!==a.autoStart&&!0!==a.autoStart||a.start()}e.$inject=["$scope","$document","$timeout","$interval","$window","$translate","$attrs","$element","$compile"],angular.module("app.core").controller("MsTimerController",e).directive("timer",function(){return{restrict:"EA",replace:!1,scope:{intervalAttr:"=interval",startTimeAttr:"=startTime",endTimeAttr:"=endTime",countdownAttr:"=countdown",autoStart:"&autoStart",maxTimeUnit:"="},controller:"MsTimerController"}})}(),function(){"use strict";angular.module("app.core").directive("msTimezone",function(){return{restrict:"E",scope:{ngModel:"="},controller:["$scope",function(e){e.timezone=[{name:"Europe/Andorra",utcOffset:60,offsetStr:"+01:00",countries:["AD"]},{name:"Asia/Dubai",utcOffset:240,offsetStr:"+04:00",countries:["AE","OM"]},{name:"Asia/Kabul",utcOffset:270,offsetStr:"+04:30",countries:["AF"]},{name:"Europe/Tirane",utcOffset:60,offsetStr:"+01:00",countries:["AL"]},{name:"Asia/Yerevan",utcOffset:240,offsetStr:"+04:00",countries:["AM"]},{name:"Antarctica/Rothera",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Palmer",utcOffset:-180,offsetStr:"-03:00",countries:["AQ"]},{name:"Antarctica/Mawson",utcOffset:300,offsetStr:"+05:00",countries:["AQ"]},{name:"Antarctica/Davis",utcOffset:420,offsetStr:"+07:00",countries:["AQ"]},{name:"Antarctica/Casey",utcOffset:480,offsetStr:"+08:00",countries:["AQ"]},{name:"Antarctica/Vostok",utcOffset:360,offsetStr:"+06:00",countries:["AQ"]},{name:"Antarctica/DumontDUrville",utcOffset:600,offsetStr:"+10:00",countries:["AQ"]},{name:"Antarctica/Syowa",utcOffset:180,offsetStr:"+03:00",countries:["AQ"]},{name:"Antarctica/Troll",utcOffset:0,offsetStr:"+00:00",countries:["AQ"]},{name:"America/Argentina/Buenos_Aires",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Cordoba",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Salta",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Jujuy",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Tucuman",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Catamarca",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/La_Rioja",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Juan",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Mendoza",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/San_Luis",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Rio_Gallegos",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"America/Argentina/Ushuaia",utcOffset:-180,offsetStr:"-03:00",countries:["AR"]},{name:"Pacific/Pago_Pago",utcOffset:-660,offsetStr:"-11:00",countries:["AS","UM"]},{name:"Europe/Vienna",utcOffset:60,offsetStr:"+01:00",countries:["AT"]},{name:"Australia/Lord_Howe",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Antarctica/Macquarie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Hobart",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Currie",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Melbourne",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Sydney",utcOffset:660,offsetStr:"+11:00",countries:["AU"]},{name:"Australia/Broken_Hill",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Brisbane",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Lindeman",utcOffset:600,offsetStr:"+10:00",countries:["AU"]},{name:"Australia/Adelaide",utcOffset:630,offsetStr:"+10:30",countries:["AU"]},{name:"Australia/Darwin",utcOffset:570,offsetStr:"+09:30",countries:["AU"]},{name:"Australia/Perth",utcOffset:480,offsetStr:"+08:00",countries:["AU"]},{name:"Australia/Eucla",utcOffset:525,offsetStr:"+08:45",countries:["AU"]},{name:"Asia/Baku",utcOffset:240,offsetStr:"+04:00",countries:["AZ"]},{name:"America/Barbados",utcOffset:-240,offsetStr:"-04:00",countries:["BB"]},{name:"Asia/Dhaka",utcOffset:360,offsetStr:"+06:00",countries:["BD"]},{name:"Europe/Brussels",utcOffset:60,offsetStr:"+01:00",countries:["BE"]},{name:"Europe/Sofia",utcOffset:120,offsetStr:"+02:00",countries:["BG"]},{name:"Atlantic/Bermuda",utcOffset:-240,offsetStr:"-04:00",countries:["BM"]},{name:"Asia/Brunei",utcOffset:480,offsetStr:"+08:00",countries:["BN"]},{name:"America/La_Paz",utcOffset:-240,offsetStr:"-04:00",countries:["BO"]},{name:"America/Noronha",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Belem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Fortaleza",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Recife",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Araguaina",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Maceio",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Bahia",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Sao_Paulo",utcOffset:-120,offsetStr:"-02:00",countries:["BR"]},{name:"America/Campo_Grande",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Cuiaba",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Santarem",utcOffset:-180,offsetStr:"-03:00",countries:["BR"]},{name:"America/Porto_Velho",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Boa_Vista",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Manaus",utcOffset:-240,offsetStr:"-04:00",countries:["BR"]},{name:"America/Eirunepe",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Rio_Branco",utcOffset:-300,offsetStr:"-05:00",countries:["BR"]},{name:"America/Nassau",utcOffset:-300,offsetStr:"-05:00",countries:["BS"]},{name:"Asia/Thimphu",utcOffset:360,offsetStr:"+06:00",countries:["BT"]},{name:"Europe/Minsk",utcOffset:180,offsetStr:"+03:00",countries:["BY"]},{name:"America/Belize",utcOffset:-360,offsetStr:"-06:00",countries:["BZ"]},{name:"America/St_Johns",utcOffset:-210,offsetStr:"-03:30",countries:["CA"]},{name:"America/Halifax",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Glace_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Moncton",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Goose_Bay",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Blanc-Sablon",utcOffset:-240,offsetStr:"-04:00",countries:["CA"]},{name:"America/Toronto",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Nipigon",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Thunder_Bay",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Iqaluit",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Pangnirtung",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Resolute",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Atikokan",utcOffset:-300,offsetStr:"-05:00",countries:["CA"]},{name:"America/Rankin_Inlet",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Winnipeg",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Rainy_River",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Regina",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Swift_Current",utcOffset:-360,offsetStr:"-06:00",countries:["CA"]},{name:"America/Edmonton",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Cambridge_Bay",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Yellowknife",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Inuvik",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Creston",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Dawson_Creek",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Fort_Nelson",utcOffset:-420,offsetStr:"-07:00",countries:["CA"]},{name:"America/Vancouver",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Whitehorse",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"America/Dawson",utcOffset:-480,offsetStr:"-08:00",countries:["CA"]},{name:"Indian/Cocos",utcOffset:390,offsetStr:"+06:30",countries:["CC"]},{name:"Europe/Zurich",utcOffset:60,offsetStr:"+01:00",countries:["CH","DE","LI"]},{name:"Africa/Abidjan",utcOffset:0,offsetStr:"+00:00",countries:["CI","BF","GM","GN","ML","MR","SH","SL","SN","ST","TG"]},{name:"Pacific/Rarotonga",utcOffset:-600,offsetStr:"-10:00",countries:["CK"]},{name:"America/Santiago",utcOffset:-180,offsetStr:"-03:00",countries:["CL"]},{name:"Pacific/Easter",utcOffset:-300,offsetStr:"-05:00",countries:["CL"]},{name:"Asia/Shanghai",utcOffset:480,offsetStr:"+08:00",countries:["CN"]},{name:"Asia/Urumqi",utcOffset:360,offsetStr:"+06:00",countries:["CN"]},{name:"America/Bogota",utcOffset:-300,offsetStr:"-05:00",countries:["CO"]},{name:"America/Costa_Rica",utcOffset:-360,offsetStr:"-06:00",countries:["CR"]},{name:"America/Havana",utcOffset:-300,offsetStr:"-05:00",countries:["CU"]},{name:"Atlantic/Cape_Verde",utcOffset:-60,offsetStr:"-01:00",countries:["CV"]},{name:"America/Curacao",utcOffset:-240,offsetStr:"-04:00",countries:["CW","AW","BQ","SX"]},{name:"Indian/Christmas",utcOffset:420,offsetStr:"+07:00",countries:["CX"]},{name:"Asia/Nicosia",utcOffset:120,offsetStr:"+02:00",countries:["CY"]},{name:"Europe/Prague",utcOffset:60,offsetStr:"+01:00",countries:["CZ","SK"]},{name:"Europe/Berlin",utcOffset:60,offsetStr:"+01:00",countries:["DE"]},{name:"Europe/Copenhagen",utcOffset:60,offsetStr:"+01:00",countries:["DK"]},{name:"America/Santo_Domingo",utcOffset:-240,offsetStr:"-04:00",countries:["DO"]},{name:"Africa/Algiers",utcOffset:60,offsetStr:"+01:00",countries:["DZ"]},{name:"America/Guayaquil",utcOffset:-300,offsetStr:"-05:00",countries:["EC"]},{name:"Pacific/Galapagos",utcOffset:-360,offsetStr:"-06:00",countries:["EC"]},{name:"Europe/Tallinn",utcOffset:120,offsetStr:"+02:00",countries:["EE"]},{name:"Africa/Cairo",utcOffset:120,offsetStr:"+02:00",countries:["EG"]},{name:"Africa/El_Aaiun",utcOffset:0,offsetStr:"+00:00",countries:["EH"]},{name:"Europe/Madrid",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Africa/Ceuta",utcOffset:60,offsetStr:"+01:00",countries:["ES"]},{name:"Atlantic/Canary",utcOffset:0,offsetStr:"+00:00",countries:["ES"]},{name:"Europe/Helsinki",utcOffset:120,offsetStr:"+02:00",countries:["FI","AX"]},{name:"Pacific/Fiji",utcOffset:720,offsetStr:"+12:00",countries:["FJ"]},{name:"Atlantic/Stanley",utcOffset:-180,offsetStr:"-03:00",countries:["FK"]},{name:"Pacific/Chuuk",utcOffset:600,offsetStr:"+10:00",countries:["FM"]},{name:"Pacific/Pohnpei",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Pacific/Kosrae",utcOffset:660,offsetStr:"+11:00",countries:["FM"]},{name:"Atlantic/Faroe",utcOffset:0,offsetStr:"+00:00",countries:["FO"]},{name:"Europe/Paris",utcOffset:60,offsetStr:"+01:00",countries:["FR"]},{name:"Europe/London",utcOffset:0,offsetStr:"+00:00",countries:["GB","GG","IM","JE"]},{name:"Asia/Tbilisi",utcOffset:240,offsetStr:"+04:00",countries:["GE"]},{name:"America/Cayenne",utcOffset:-180,offsetStr:"-03:00",countries:["GF"]},{name:"Africa/Accra",utcOffset:0,offsetStr:"+00:00",countries:["GH"]},{name:"Europe/Gibraltar",utcOffset:60,offsetStr:"+01:00",countries:["GI"]},{name:"America/Godthab",utcOffset:-180,offsetStr:"-03:00",countries:["GL"]},{name:"America/Danmarkshavn",utcOffset:0,offsetStr:"+00:00",countries:["GL"]},{name:"America/Scoresbysund",utcOffset:-60,offsetStr:"-01:00",countries:["GL"]},{name:"America/Thule",utcOffset:-240,offsetStr:"-04:00",countries:["GL"]},{name:"Europe/Athens",utcOffset:120,offsetStr:"+02:00",countries:["GR"]},{name:"Atlantic/South_Georgia",utcOffset:-120,offsetStr:"-02:00",countries:["GS"]},{name:"America/Guatemala",utcOffset:-360,offsetStr:"-06:00",countries:["GT"]},{name:"Pacific/Guam",utcOffset:600,offsetStr:"+10:00",countries:["GU","MP"]},{name:"Africa/Bissau",utcOffset:0,offsetStr:"+00:00",countries:["GW"]},{name:"America/Guyana",utcOffset:-240,offsetStr:"-04:00",countries:["GY"]},{name:"Asia/Hong_Kong",utcOffset:480,offsetStr:"+08:00",countries:["HK"]},{name:"America/Tegucigalpa",utcOffset:-360,offsetStr:"-06:00",countries:["HN"]},{name:"America/Port-au-Prince",utcOffset:-300,offsetStr:"-05:00",countries:["HT"]},{name:"Europe/Budapest",utcOffset:60,offsetStr:"+01:00",countries:["HU"]},{name:"Asia/Jakarta",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Pontianak",utcOffset:420,offsetStr:"+07:00",countries:["ID"]},{name:"Asia/Makassar",utcOffset:480,offsetStr:"+08:00",countries:["ID"]},{name:"Asia/Jayapura",utcOffset:540,offsetStr:"+09:00",countries:["ID"]},{name:"Europe/Dublin",utcOffset:0,offsetStr:"+00:00",countries:["IE"]},{name:"Asia/Jerusalem",utcOffset:120,offsetStr:"+02:00",countries:["IL"]},{name:"Asia/Kolkata",utcOffset:330,offsetStr:"+05:30",countries:["IN"]},{name:"Indian/Chagos",utcOffset:360,offsetStr:"+06:00",countries:["IO"]},{name:"Asia/Baghdad",utcOffset:180,offsetStr:"+03:00",countries:["IQ"]},{name:"Asia/Tehran",utcOffset:210,offsetStr:"+03:30",countries:["IR"]},{name:"Atlantic/Reykjavik",utcOffset:0,offsetStr:"+00:00",countries:["IS"]},{name:"Europe/Rome",utcOffset:60,offsetStr:"+01:00",countries:["IT","SM","VA"]},{name:"America/Jamaica",utcOffset:-300,offsetStr:"-05:00",countries:["JM"]},{name:"Asia/Amman",utcOffset:120,offsetStr:"+02:00",countries:["JO"]},{name:"Asia/Tokyo",utcOffset:540,offsetStr:"+09:00",countries:["JP"]},{name:"Africa/Nairobi",utcOffset:180,offsetStr:"+03:00",countries:["KE","DJ","ER","ET","KM","MG","SO","TZ","UG","YT"]},{name:"Asia/Bishkek",utcOffset:360,offsetStr:"+06:00",countries:["KG"]},{name:"Pacific/Tarawa",utcOffset:720,offsetStr:"+12:00",countries:["KI"]},{name:"Pacific/Enderbury",utcOffset:780,offsetStr:"+13:00",countries:["KI"]},{name:"Pacific/Kiritimati",utcOffset:840,offsetStr:"+14:00",countries:["KI"]},{name:"Asia/Pyongyang",utcOffset:510,offsetStr:"+08:30",countries:["KP"]},{name:"Asia/Seoul",utcOffset:540,offsetStr:"+09:00",countries:["KR"]},{name:"America/Cayman",utcOffset:-300,offsetStr:"-05:00",countries:["KY"]},{name:"Asia/Almaty",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Qyzylorda",utcOffset:360,offsetStr:"+06:00",countries:["KZ"]},{name:"Asia/Aqtobe",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Aqtau",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Oral",utcOffset:300,offsetStr:"+05:00",countries:["KZ"]},{name:"Asia/Beirut",utcOffset:120,offsetStr:"+02:00",countries:["LB"]},{name:"Asia/Colombo",utcOffset:330,offsetStr:"+05:30",countries:["LK"]},{name:"Africa/Monrovia",utcOffset:0,offsetStr:"+00:00",countries:["LR"]},{name:"Europe/Vilnius",utcOffset:120,offsetStr:"+02:00",countries:["LT"]},{name:"Europe/Luxembourg",utcOffset:60,offsetStr:"+01:00",countries:["LU"]},{name:"Europe/Riga",utcOffset:120,offsetStr:"+02:00",countries:["LV"]},{name:"Africa/Tripoli",utcOffset:120,offsetStr:"+02:00",countries:["LY"]},{name:"Africa/Casablanca",utcOffset:0,offsetStr:"+00:00",countries:["MA"]},{name:"Europe/Monaco",utcOffset:60,offsetStr:"+01:00",countries:["MC"]},{name:"Europe/Chisinau",utcOffset:120,offsetStr:"+02:00",countries:["MD"]},{name:"Pacific/Majuro",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Pacific/Kwajalein",utcOffset:720,offsetStr:"+12:00",countries:["MH"]},{name:"Asia/Rangoon",utcOffset:390,offsetStr:"+06:30",countries:["MM"]},{name:"Asia/Ulaanbaatar",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Hovd",utcOffset:420,offsetStr:"+07:00",countries:["MN"]},{name:"Asia/Choibalsan",utcOffset:480,offsetStr:"+08:00",countries:["MN"]},{name:"Asia/Macau",utcOffset:480,offsetStr:"+08:00",countries:["MO"]},{name:"America/Martinique",utcOffset:-240,offsetStr:"-04:00",countries:["MQ"]},{name:"Europe/Malta",utcOffset:60,offsetStr:"+01:00",countries:["MT"]},{name:"Indian/Mauritius",utcOffset:240,offsetStr:"+04:00",countries:["MU"]},{name:"Indian/Maldives",utcOffset:300,offsetStr:"+05:00",countries:["MV"]},{name:"America/Mexico_City",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Cancun",utcOffset:-300,offsetStr:"-05:00",countries:["MX"]},{name:"America/Merida",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Monterrey",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Matamoros",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"America/Mazatlan",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Chihuahua",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Ojinaga",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Hermosillo",utcOffset:-420,offsetStr:"-07:00",countries:["MX"]},{name:"America/Tijuana",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Santa_Isabel",utcOffset:-480,offsetStr:"-08:00",countries:["MX"]},{name:"America/Bahia_Banderas",utcOffset:-360,offsetStr:"-06:00",countries:["MX"]},{name:"Asia/Kuala_Lumpur",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Asia/Kuching",utcOffset:480,offsetStr:"+08:00",countries:["MY"]},{name:"Africa/Maputo",utcOffset:120,offsetStr:"+02:00",countries:["MZ","BI","BW","CD","MW","RW","ZM","ZW"]},{name:"Africa/Windhoek",utcOffset:120,offsetStr:"+02:00",countries:["NA"]},{name:"Pacific/Noumea",utcOffset:660,offsetStr:"+11:00",countries:["NC"]},{name:"Pacific/Norfolk",utcOffset:660,offsetStr:"+11:00",countries:["NF"]},{name:"Africa/Lagos",utcOffset:60,offsetStr:"+01:00",countries:["NG","AO","BJ","CD","CF","CG","CM","GA","GQ","NE"]},{name:"America/Managua",utcOffset:-360,offsetStr:"-06:00",countries:["NI"]},{name:"Europe/Amsterdam",utcOffset:60,offsetStr:"+01:00",countries:["NL"]},{name:"Europe/Oslo",utcOffset:60,offsetStr:"+01:00",countries:["NO","SJ"]},{name:"Asia/Kathmandu",utcOffset:345,offsetStr:"+05:45",countries:["NP"]},{name:"Pacific/Nauru",utcOffset:720,offsetStr:"+12:00",countries:["NR"]},{name:"Pacific/Niue",utcOffset:-660,offsetStr:"-11:00",countries:["NU"]},{name:"Pacific/Auckland",utcOffset:780,offsetStr:"+13:00",countries:["NZ","AQ"]},{name:"Pacific/Chatham",utcOffset:825,offsetStr:"+13:45",countries:["NZ"]},{name:"America/Panama",utcOffset:-300,offsetStr:"-05:00",countries:["PA"]},{name:"America/Lima",utcOffset:-300,offsetStr:"-05:00",countries:["PE"]},{name:"Pacific/Tahiti",utcOffset:-600,offsetStr:"-10:00",countries:["PF"]},{name:"Pacific/Marquesas",utcOffset:-570,offsetStr:"-09:30",countries:["PF"]},{name:"Pacific/Gambier",utcOffset:-540,offsetStr:"-09:00",countries:["PF"]},{name:"Pacific/Port_Moresby",utcOffset:600,offsetStr:"+10:00",countries:["PG"]},{name:"Pacific/Bougainville",utcOffset:660,offsetStr:"+11:00",countries:["PG"]},{name:"Asia/Manila",utcOffset:480,offsetStr:"+08:00",countries:["PH"]},{name:"Asia/Karachi",utcOffset:300,offsetStr:"+05:00",countries:["PK"]},{name:"Europe/Warsaw",utcOffset:60,offsetStr:"+01:00",countries:["PL"]},{name:"America/Miquelon",utcOffset:-180,offsetStr:"-03:00",countries:["PM"]},{name:"Pacific/Pitcairn",utcOffset:-480,offsetStr:"-08:00",countries:["PN"]},{name:"America/Puerto_Rico",utcOffset:-240,offsetStr:"-04:00",countries:["PR"]},{name:"Asia/Gaza",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Asia/Hebron",utcOffset:120,offsetStr:"+02:00",countries:["PS"]},{name:"Europe/Lisbon",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Madeira",utcOffset:0,offsetStr:"+00:00",countries:["PT"]},{name:"Atlantic/Azores",utcOffset:-60,offsetStr:"-01:00",countries:["PT"]},{name:"Pacific/Palau",utcOffset:540,offsetStr:"+09:00",countries:["PW"]},{name:"America/Asuncion",utcOffset:-180,offsetStr:"-03:00",countries:["PY"]},{name:"Asia/Qatar",utcOffset:180,offsetStr:"+03:00",countries:["QA","BH"]},{name:"Indian/Reunion",utcOffset:240,offsetStr:"+04:00",countries:["RE","TF"]},{name:"Europe/Bucharest",utcOffset:120,offsetStr:"+02:00",countries:["RO"]},{name:"Europe/Belgrade",utcOffset:60,offsetStr:"+01:00",countries:["RS","BA","HR","ME","MK","SI"]},{name:"Europe/Kaliningrad",utcOffset:120,offsetStr:"+02:00",countries:["RU"]},{name:"Europe/Moscow",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Simferopol",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Volgograd",utcOffset:180,offsetStr:"+03:00",countries:["RU"]},{name:"Europe/Samara",utcOffset:240,offsetStr:"+04:00",countries:["RU"]},{name:"Asia/Yekaterinburg",utcOffset:300,offsetStr:"+05:00",countries:["RU"]},{name:"Asia/Omsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novosibirsk",utcOffset:360,offsetStr:"+06:00",countries:["RU"]},{name:"Asia/Novokuznetsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Krasnoyarsk",utcOffset:420,offsetStr:"+07:00",countries:["RU"]},{name:"Asia/Irkutsk",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Chita",utcOffset:480,offsetStr:"+08:00",countries:["RU"]},{name:"Asia/Yakutsk",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Khandyga",utcOffset:540,offsetStr:"+09:00",countries:["RU"]},{name:"Asia/Vladivostok",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Sakhalin",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Ust-Nera",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Magadan",utcOffset:600,offsetStr:"+10:00",countries:["RU"]},{name:"Asia/Srednekolymsk",utcOffset:660,offsetStr:"+11:00",countries:["RU"]},{name:"Asia/Kamchatka",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Anadyr",utcOffset:720,offsetStr:"+12:00",countries:["RU"]},{name:"Asia/Riyadh",utcOffset:180,offsetStr:"+03:00",countries:["SA","KW","YE"]},{name:"Pacific/Guadalcanal",utcOffset:660,offsetStr:"+11:00",countries:["SB"]},{name:"Indian/Mahe",utcOffset:240,offsetStr:"+04:00",countries:["SC"]},{name:"Africa/Khartoum",utcOffset:180,offsetStr:"+03:00",countries:["SD","SS"]},{name:"Europe/Stockholm",utcOffset:60,offsetStr:"+01:00",countries:["SE"]},{name:"Asia/Singapore",utcOffset:480,offsetStr:"+08:00",countries:["SG"]},{name:"America/Paramaribo",utcOffset:-180,offsetStr:"-03:00",countries:["SR"]},{name:"America/El_Salvador",utcOffset:-360,offsetStr:"-06:00",countries:["SV"]},{name:"Asia/Damascus",utcOffset:120,offsetStr:"+02:00",countries:["SY"]},{name:"America/Grand_Turk",utcOffset:-240,offsetStr:"-04:00",countries:["TC"]},{name:"Africa/Ndjamena",utcOffset:60,offsetStr:"+01:00",countries:["TD"]},{name:"Indian/Kerguelen",utcOffset:300,offsetStr:"+05:00",countries:["TF"]},{name:"Asia/Bangkok",utcOffset:420,offsetStr:"+07:00",countries:["TH","KH","LA","VN"]},{name:"Asia/Dushanbe",utcOffset:300,offsetStr:"+05:00",countries:["TJ"]},{name:"Pacific/Fakaofo",utcOffset:780,offsetStr:"+13:00",countries:["TK"]},{name:"Asia/Dili",utcOffset:540,offsetStr:"+09:00",countries:["TL"]},{name:"Asia/Ashgabat",utcOffset:300,offsetStr:"+05:00",countries:["TM"]},{name:"Africa/Tunis",utcOffset:60,offsetStr:"+01:00",countries:["TN"]},{name:"Pacific/Tongatapu",utcOffset:780,offsetStr:"+13:00",countries:["TO"]},{name:"Europe/Istanbul",utcOffset:120,offsetStr:"+02:00",countries:["TR"]},{name:"America/Port_of_Spain",utcOffset:-240,offsetStr:"-04:00",countries:["TT","AG","AI","BL","DM","GD","GP","KN","LC","MF","MS","VC","VG","VI"]},{name:"Pacific/Funafuti",utcOffset:720,offsetStr:"+12:00",countries:["TV"]},{name:"Asia/Taipei",utcOffset:480,offsetStr:"+08:00",countries:["TW"]},{name:"Europe/Kiev",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Uzhgorod",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Europe/Zaporozhye",utcOffset:120,offsetStr:"+02:00",countries:["UA"]},{name:"Pacific/Wake",utcOffset:720,offsetStr:"+12:00",countries:["UM"]},{name:"America/New_York",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Detroit",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Louisville",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Kentucky/Monticello",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Indianapolis",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vincennes",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Winamac",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Marengo",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Petersburg",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Indiana/Vevay",utcOffset:-300,offsetStr:"-05:00",countries:["US"]},{name:"America/Chicago",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Tell_City",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Indiana/Knox",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Menominee",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Center",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/New_Salem",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/North_Dakota/Beulah",utcOffset:-360,offsetStr:"-06:00",countries:["US"]},{name:"America/Denver",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Boise",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Phoenix",utcOffset:-420,offsetStr:"-07:00",countries:["US"]},{name:"America/Los_Angeles",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Metlakatla",utcOffset:-480,offsetStr:"-08:00",countries:["US"]},{name:"America/Anchorage",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Juneau",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Sitka",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Yakutat",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Nome",utcOffset:-540,offsetStr:"-09:00",countries:["US"]},{name:"America/Adak",utcOffset:-600,offsetStr:"-10:00",countries:["US"]},{name:"Pacific/Honolulu",utcOffset:-600,offsetStr:"-10:00",countries:["US","UM"]},{name:"America/Montevideo",utcOffset:-180,offsetStr:"-03:00",countries:["UY"]},{name:"Asia/Samarkand",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"Asia/Tashkent",utcOffset:300,offsetStr:"+05:00",countries:["UZ"]},{name:"America/Caracas",utcOffset:-270,offsetStr:"-04:30",countries:["VE"]},{name:"Asia/Ho_Chi_Minh",utcOffset:420,offsetStr:"+07:00",countries:["VN"]},{name:"Pacific/Efate",utcOffset:660,offsetStr:"+11:00",countries:["VU"]},{name:"Pacific/Wallis",utcOffset:720,offsetStr:"+12:00",countries:["WF"]},{name:"Pacific/Apia",utcOffset:840,offsetStr:"+14:00",countries:["WS"]},{name:"Africa/Johannesburg",utcOffset:120,offsetStr:"+02:00",countries:["ZA","LS","SZ"]}]}],templateUrl:"app/core/directives/ms-timezone/ms-timezone.html"}})}(),function(){"use strict";angular.module("app.core").controller("MsWidgetEngineCounterController",function(){var a=this;a.filter=[],a.filtered=!1,a.fontSize=20,a.getCount=function(e){var t=0;if(e){a.fontSize=e.attrs[2]&&e.attrs[2].value?parseInt(e.attrs[2].value)-parseInt(e.attrs[2].value)%2:20,e.attrs[1].value&&e.attrs[1].value.length?(a.filtered=!0,a.filter=_.intersection(e.voiceQueuesSelected,e.attrs[1].value)):(a.filtered=!1,a.filter=e.voiceQueuesSelected);for(var n=0;n<e.voiceQueues.rows.length;n+=1)_.includes(a.filter,e.voiceQueues.rows[n].id)&&(t+=e.voiceQueues.rows[n][e.attrs[0].value]?parseInt(e.voiceQueues.rows[n][e.attrs[0].value]):0)}return t}})}(),function(){"use strict";function e(o,e){var r=this;r.filter=[],r.filtered=!1,r.properties=[],r.multiBarChart={labels:["QUEUE_NAME"],series:["TOTAL"],data:[[50]],options:{responsive:!0,legend:{display:!0,fontColor:"#2196f3"},scales:{xAxes:[{gridLines:{display:!0},ticks:{fontColor:"#2196f3",stepSize:1,beginAtZero:!0}}],yAxes:[{gridLines:{display:!1},ticks:{fontColor:"#2196f3"}}]}}},r.getMultiBarChart=function(e){e&&(e.attrs&&function(e){r.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(r.filtered=!0,r.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(r.filtered=!1,r.filter=e.voiceQueuesSelected);if(r.multiBarChart.series.length>r.properties.length){var t=r.multiBarChart.series.length-r.properties.length;r.multiBarChart.series.splice(0,t),r.multiBarChart.data.splice(0,t)}for(var n=0;n<r.properties.length;n+=1){if(r.multiBarChart.series[n]=o.instant("TOOLS."+r.properties[n].toUpperCase()),_.isNil(r.multiBarChart.data[n])&&(r.multiBarChart.data[n]=[]),r.multiBarChart.labels.length>r.filter.length){var a=r.multiBarChart.labels.length-r.filter.length;r.multiBarChart.labels.splice(0,a),r.multiBarChart.data[n].splice(0,a)}for(var i=0,s=0;i<e.voiceQueues.rows.length;i+=1)_.includes(r.filter,e.voiceQueues.rows[i].id)&&(r.multiBarChart.labels[s]=e.voiceQueues.rows[i].name,r.multiBarChart.data[n][s]=e.voiceQueues.rows[i][r.properties[n]]?parseInt(e.voiceQueues.rows[i][r.properties[n]]):0,s+=1)}}(e),e.foreground&&function(e){r.multiBarChart.options.legend.fontColor=e.foreground;for(var t=0;t<r.multiBarChart.options.scales.xAxes.length;t+=1)r.multiBarChart.options.scales.xAxes[t].ticks.fontColor=e.foreground;for(var n=0;n<r.multiBarChart.options.scales.yAxes.length;n+=1)r.multiBarChart.options.scales.yAxes[n].ticks.fontColor=e.foreground}(e))}}e.$inject=["$translate","socket"],angular.module("app.core").controller("MsWidgetEngineMultibarChartController",e)}(),function(){"use strict";function e(s){var o=this;o.filter=[],o.filtered=!1,o.properties=[],o.pieChart={labels:["ANSWERED"],data:[30],options:{responsive:!0,legend:{display:!0}}},o.getPieChart=function(e){e&&(e.attrs&&function(e){o.properties=_.map(_.filter(e.attrs,function(e){return e.name&&0<=e.name.indexOf("attrSerie")&&e.value&&"null"!==e.value}),"value"),e.attrs[3].value&&e.attrs[3].value.length?(o.filtered=!0,o.filter=_.intersection(e.voiceQueuesSelected,e.attrs[3].value)):(o.filtered=!1,o.filter=e.voiceQueuesSelected);if(o.pieChart.labels.length>o.properties.length){var t=o.pieChart.labels.length-o.properties.length;o.pieChart.labels.splice(0,t),o.pieChart.data.splice(0,t)}for(var n=0,a=0;n<o.properties.length;n+=1){o.pieChart.labels[n]=s.instant("TOOLS."+o.properties[n].toUpperCase());for(var i=0;i<e.voiceQueues.rows.length;i+=1)_.includes(o.filter,e.voiceQueues.rows[i].id)&&(a+=e.voiceQueues.rows[i][o.properties[n]]?parseInt(e.voiceQueues.rows[i][o.properties[n]]):0);o.pieChart.data[n]=a,a=0}}(e),e.foreground&&(t=e,o.pieChart.options.legend.fontColor=t.foreground));var t}}e.$inject=["$translate"],angular.module("app.core").controller("MsWidgetEnginePieChartController",e)}(),function(){"use strict";function e(e,n,a,i){var s=this;function t(e){s.results=e||{count:0,rows:[]}}function o(){s.query.offset=(s.query.page-1)*s.query.limit,s.promise=i[s.reportRoute].run(s.query,t).$promise}s.countDown=0,s.refresh=0,s.title="",s.columns=[],s.results={rows:[],count:0},s.query={limit:10,page:1,startDate:moment().startOf("day").format("YYYY-MM-DD HH:mm:ss"),endDate:moment().endOf("day").format("YYYY-MM-DD HH:mm:ss"),output:"web"},s.onInit=function e(t){t&&t.attrs&&(t.attrs[0]&&t.attrs[0].value&&(s.query.id=t.attrs[0].value,i.analyticFieldReport.get({fields:"field,alias",nolimit:!0,DefaultReportId:"default"===t.attrs[0].type?t.attrs[0].value:void 0,CustomReportId:"custom"===t.attrs[0].type?t.attrs[0].value:void 0}).$promise.then(function(e){switch(e&&e.rows&&(s.columns=e.rows),t.attrs[0].type){case"default":s.reportRoute="analyticDefaultReport";break;case"custom":s.reportRoute="analyticCustomReport"}return i[s.reportRoute].get({id:t.attrs[0].value,fields:"id,name"}).$promise}).then(function(e){e&&e.name&&(s.title=e.name),o()}).catch(function(e){console.log(e)})),t.attrs[1]&&t.attrs[1].value&&(s.refresh=parseInt(t.attrs[1].value),!_.isNaN(s.refresh)&&0<s.refresh?(s.countDown=parseInt(t.attrs[1].value),s.interval=a(function(){s.countDown-=1},1e3,0),s.timeout=n(function(){s.interval&&a.cancel(s.interval),e(t)},1e3*s.refresh)):(s.interval&&a.cancel(s.interval),s.timeout&&n.cancel(s.timeout))))},s.getResults=o,s.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},e.$on("$destroy",function(){s.interval&&a.cancel(s.interval),s.timeout&&n.cancel(s.timeout)})}e.$inject=["$scope","$timeout","$interval","api"],angular.module("app.core").controller("MsWidgetEngineWebReportController",e)}(),function(){"use strict";function e(e,t){this.getTrustedURL=function(e){return t.trustAsResourceUrl(e)}}function t(e){return{restrict:"E",scope:{config:"=?",onEdit:"&?",onDelete:"&?"},require:"msWidgetEngine",controller:"MsWidgetEngineController",controllerAs:"vm",bindToController:!0,templateUrl:"app/core/directives/ms-widget-engine/ms-widget-engine.html"}}e.$inject=["$mdDialog","$sce"],t.$inject=["$document"],angular.module("app.core").controller("MsWidgetEngineController",e).directive("msWidgetEngine",t)}(),function(){"use strict";function e(e,t){var n=this;n.flipped=!1,n.flip=function(){if(!angular.isDefined(e.flippable)||!0!==e.flippable)return;n.flipped=!n.flipped,t.toggleClass("flipped",n.flipped)}}e.$inject=["$scope","$element"],angular.module("app.core").controller("MsWidgetController",e).directive("msWidget",function(){return{restrict:"E",scope:{flippable:"=?"},controller:"MsWidgetController",transclude:!0,compile:function(e){return e.addClass("ms-widget"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)})}}}}).directive("msWidgetFront",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-front"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}}).directive("msWidgetBack",function(){return{restrict:"E",require:"^msWidget",transclude:!0,compile:function(e){return e.addClass("ms-widget-back"),function(e,t,n,a,i){i(function(e){t.empty(),t.append(e)}),e.flipWidget=a.flip}}}})}(),function(){"use strict";angular.module("app.core").filter("altDate",function(){return function(e){var t=Date.now()-new Date(e);return t<36e5?moment(e).fromNow():t<864e5?moment(e).format("HH:mm"):t<6048e5?moment(e).format("dddd"):moment(e).calendar()}})}(),function(){"use strict";function e(t){return function(e){return t.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("app.core").filter("toTrusted",e).filter("htmlToPlaintext",function(){return function(e){return String(e).replace(/<[^>]+>/gm,"")}}).filter("nospace",function(){return function(e){return e?e.replace(/ /g,""):""}}).filter("humanizeDoc",function(){return function(e){if(e)return"directive"===e.type?e.name.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}):e.label||e.name}})}(),function(){"use strict";angular.module("app.core").filter("filterByIds",function(){return function(e,t){if(0===e.length||!t)return e;if(0===t.length)return[];for(var n=[],a=0;a<e.length;a++){for(var i=e[a],s=!1,o=0;o<t.length;o++){var r=t[o];if(i.id===r){s=!0;break}}s&&n.push(i)}return n}})}(),function(){"use strict";angular.module("app.core").filter("filterByPropIds",function(){return function(e,t,n){if(0===e.length||!n||0===n.length)return e;for(var a=[],i=0;i<e.length;i++){for(var s=e[i],o=!1,r=0;r<n.length;r++){var l=n[r];if(-1<s[t].indexOf(l)){o=!0;break}}o&&a.push(s)}return a}})}(),function(){"use strict";angular.module("app.core").filter("filterByTags",function(){return function(e,n){if(0===e.length||0===n.length)return e;var a=[];return e.forEach(function(e){var t=n.every(function(t){var n=!1;return e.tags.forEach(function(e){e.name!==t.name||(n=!0)}),n});t&&a.push(e)}),a}}).filter("filterSingleByTags",function(){return function(e,t){if(0!==e.length&&0!==t.length){if(e.length<t.length)return[];var n=[],a=t.every(function(t){var n=!1;return e.forEach(function(e){e.name!==t.name||(n=!0)}),n});return a&&n.push(e),n}}})}(),function(){"use strict";function c(e,t,n,a){this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),this.title=e,this.body=t,this.accept=n,this.reject=a,this.close=i}function m(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function i(){var n=this;navigator.serviceWorker.ready.then(function(e){e.getNotifications().then(function(e){var t=_.find(e,function(e){return e.data.id===n.id});t&&t.close()})})}angular.module("app.dashboards").provider("motNotification",function(){return{$get:[function(){var l,n,d=[];"serviceWorker"in navigator&&m()?navigator.serviceWorker.register("notification.js").then(function(e){(l=e).update(),l.installing?n=l.installing:l.waiting?n=l.waiting:l.active&&(n=l.active)}).catch(function(e){console.error("Service worker registration failed",e)}):console.error("Service Worker is not supported");return navigator.serviceWorker.addEventListener("message",function(e){if(e.source===n){var t=_.find(d,{id:e.data.id});if(t)switch(e.data.action){case"accept":t.accept&&t.accept();break;case"reject":t.reject&&t.reject()}}}),{create:function(e,i,s,o,r){return new Promise(function(t,n){var a;m()&&(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)?(a=new c(e||"MyTitle",i||"MyBody",o,r),d.push(a),a?window.Notification.requestPermission().then(function(e){if("granted"===e)return l.showNotification(a.title,{body:a.body,requireInteraction:!0,icon:s||"assets/images/business/queueCampaigns.jpg",data:{id:a.id},actions:[{action:"accept",title:"Accept"},{action:"reject",title:"Reject"}]})}).then(function(e){t(a)}).catch(function(e){n(e)}):n(new Error("Notification creating error"))):t()})}}}]}})}(),function(){"use strict";function e(l,d,c){return{resolve:function(e,t){var n=e.split("@"),a=n[0],i=n[1],s=t||{};if(!a||!i)return d.error("apiResolver.resolve requires correct action parameter (ResourceName@methodName)"),!1;var o=l.defer(),r=function(e){for(var t=e.split("."),n=c,a=0;a<t.length;a++){if(angular.isUndefined(n[t[a]])){d.error('Resource part "'+t[a]+'" is not defined!'),n=!1;break}n=n[t[a]]}return n||!1}(a);r?r[i](s,function(e){o.resolve(e)},function(e){o.reject(e)}):(d.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!'));return o.promise}}}e.$inject=["$q","$log","api"],angular.module("app.core").factory("apiResolver",e)}(),function(){"use strict";angular.module("app.core").provider("msApi",function(){var n=angular.injector(["ng"]).get("$log"),a="",v=[];function t(e){a=e}function i(){return a}function s(e,t){angular.isString(e)?angular.isArray(t)?v[e]={url:a+(t[0]||""),paramDefaults:t[1]||[],actions:t[2]||[],options:t[3]||{}}:n.error('"resource" must be an array and it must follow $resource definition'):n.error('"path" must be a string (eg. `dashboard.project`)')}this.setBaseUrl=t,this.getBaseUrl=i,this.getApiObject=function(){return v},this.register=s,this.$get=["$log","$q","$resource","$rootScope",function(m,u,p,g){var e={setBaseUrl:t,getBaseUrl:i,register:s,resolve:function(e,t){g.$broadcast("msApi::resolveStart");var n=e.split("@"),a=n[0],i=n[1],s=t||{};if(!a||!i)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var o=u.defer(),r=v[a];if(r){var l=p(r.url,r.paramDefaults,r.actions,r.options);l[i](s,function(e){o.resolve(e),g.$broadcast("msApi::resolveSuccess")},function(e){o.reject(e),g.$broadcast("msApi::resolveError")})}else m.error('Resource "'+a+'" is not defined in the api service!'),o.reject('Resource "'+a+'" is not defined in the api service!');return o.promise},request:function(e,t,n,a){g.$broadcast("msApi::requestStart");var i=e.split("@"),s=i[0],o=i[1],r=t||{};if(!s||!o)return m.error("msApi.resolve requires correct action parameter (resourceName@methodName)"),!1;var l=u.defer(),d=v[s];if(d){var c=p(d.url,d.paramDefaults,d.actions,d.options);c[o](r,function(e){g.$broadcast("msApi::requestSuccess"),l.resolve(e),angular.isDefined(n)&&angular.isFunction(n)&&n(e)},function(e){g.$broadcast("msApi::requestError"),l.reject(e),angular.isDefined(a)&&angular.isFunction(a)&&a(e)})}else m.error('Resource "'+s+'" is not defined in the api service!'),l.reject('Resource "'+s+'" is not defined in the api service!');return l.promise}};return e}]})}(),function(){"use strict";function e(l){var e=new MobileDetect(l.navigator.userAgent),d=null;return{exists:function(e,t){return-1<t.indexOf(e)},detectBrowser:function(){if(d)return d;var e=[{string:l.navigator.userAgent,subString:"Edge",versionSearch:"Edge",identity:"Edge"},{string:l.navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:l.navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:l.navigator.vendor,subString:"Apple",versionSearch:"Version",identity:"Safari"},{prop:l.opera,identity:"Opera"},{string:l.navigator.vendor,subString:"iCab",identity:"iCab"},{string:l.navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:l.navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:l.navigator.vendor,subString:"Camino",identity:"Camino"},{string:l.navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:l.navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:l.navigator.userAgent,subString:"Trident/7",identity:"Explorer",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:l.navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],t=[{string:l.navigator.platform,subString:"Win",identity:"Windows"},{string:l.navigator.platform,subString:"Mac",identity:"Mac"},{string:l.navigator.platform,subString:"Linux",identity:"Linux"},{string:l.navigator.platform,subString:"iPhone",identity:"iPhone"},{string:l.navigator.platform,subString:"iPod",identity:"iPod"},{string:l.navigator.platform,subString:"iPad",identity:"iPad"},{string:l.navigator.platform,subString:"Android",identity:"Android"}],i="";function n(e){for(var t=0;t<e.length;t++){var n=e[t].string,a=e[t].prop;if(i=e[t].versionSearch||e[t].identity,n){if(-1!==n.indexOf(e[t].subString))return e[t].identity}else if(a)return e[t].identity}}function a(e){var t=e.indexOf(i);if(-1!==t)return parseInt(e.substring(t+i.length+1))}var s=n(e)||"unknown-browser",o=a(l.navigator.userAgent)||a(l.navigator.appVersion)||"unknown-version",r=n(t)||"unknown-os";return s=s.toLowerCase(),o=s+"-"+o,r=r.toLowerCase(),d={browser:s,version:o,os:r}},guidGenerator:function(){var e=function(){return(65536*(1+Math.random())||0).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()},isMobile:function(){return e.mobile()},toggleInArray:function(e,t){-1===t.indexOf(e)?t.push(e):t.splice(t.indexOf(e),1)}}}e.$inject=["$window"],angular.module("app.core").factory("msUtils",e)}(),function(){"use strict";function e(e,t){var n=this;n.themes=t.themes,n.layoutModes=[{label:"Boxed",value:"boxed"},{label:"Wide",value:"wide"}],n.layoutStyles=[{label:"Vertical Navigation",value:"verticalNavigation",figure:"/assets/images/theme-options/vertical-nav.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar",value:"verticalNavigationFullwidthToolbar",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar.jpg"},{label:"Vertical Navigation with Fullwidth Toolbar 2",value:"verticalNavigationFullwidthToolbar2",figure:"/assets/images/theme-options/vertical-nav-with-full-toolbar-2.jpg"},{label:"Horizontal Navigation",value:"horizontalNavigation",figure:"/assets/images/theme-options/horizontal-nav.jpg"},{label:"Content with Toolbar",value:"contentWithToolbar",figure:"/assets/images/theme-options/content-with-toolbar.jpg"},{label:"Content Only",value:"contentOnly",figure:"/assets/images/theme-options/content-only.jpg"}],n.layoutMode="wide",n.layoutStyle=e.get("motion.layoutStyle")||"verticalNavigation",n.setActiveTheme=function(e){t.setActiveTheme(e)},n.getActiveTheme=function(){return t.themes.active},n.updateLayoutMode=function(){angular.element("body").toggleClass("boxed","boxed"===n.layoutMode)},n.updateLayoutStyle=function(){e.put("motion.layoutStyle",n.layoutStyle),location.reload()}}function t(t){return{restrict:"E",scope:{},controller:"MsThemeOptionsController as vm",templateUrl:"app/core/theme-options/theme-options.html",compile:function(e){return e.addClass("ms-theme-options"),function(e){e.toggleOptionsSidenav=function(){t("motion-theme-options").toggle()}}}}}e.$inject=["$cookies","motionTheming"],t.$inject=["$mdSidenav"],angular.module("app.core").controller("MsThemeOptionsController",e).directive("msThemeOptions",t)}(),function(){"use strict";function e(i,a,s){var o={};return{generate:function(){var e=angular.copy(s.getRegisteredThemes()),a=angular.copy(s.getRegisteredPalettes());angular.forEach(e,function(n){o[n.name]={},angular.forEach(n.colors,function(e,t){o[n.name][t]={name:e.name,levels:{default:{color:l(a[e.name][e.hues.default].value),contrast1:l(a[e.name][e.hues.default].contrast,1),contrast2:l(a[e.name][e.hues.default].contrast,2),contrast3:l(a[e.name][e.hues.default].contrast,3),contrast4:l(a[e.name][e.hues.default].contrast,4)},hue1:{color:l(a[e.name][e.hues["hue-1"]].value),contrast1:l(a[e.name][e.hues["hue-1"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-1"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-1"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-1"]].contrast,4)},hue2:{color:l(a[e.name][e.hues["hue-2"]].value),contrast1:l(a[e.name][e.hues["hue-2"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-2"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-2"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-2"]].contrast,4)},hue3:{color:l(a[e.name][e.hues["hue-3"]].value),contrast1:l(a[e.name][e.hues["hue-3"]].contrast,1),contrast2:l(a[e.name][e.hues["hue-3"]].contrast,2),contrast3:l(a[e.name][e.hues["hue-3"]].contrast,3),contrast4:l(a[e.name][e.hues["hue-3"]].contrast,4)}}}})}),function(e){var t=angular.copy(e);angular.forEach(t,function(n){angular.forEach(n,function(e,t){n[t]=e.levels,n[t].color=e.levels.default.color,n[t].contrast1=e.levels.default.contrast1,n[t].contrast2=e.levels.default.contrast2,n[t].contrast3=e.levels.default.contrast3,n[t].contrast4=e.levels.default.contrast4,delete n[t].default})}),s.setThemesList(t);var n=i.get("motion.selectedTheme");n?s.setActiveTheme(n):s.setActiveTheme("default")}(o);var r={};angular.forEach(o,function(e,t){var n,a,i,s,o;(r={})["@themeName"]=t,angular.forEach(e,function(e,a){angular.forEach(e.levels,function(e,n){angular.forEach(e,function(e,t){r["@"+a+d(n)+d(t)]=e})})}),n=r,a=new RegExp(Object.keys(n).join("|"),"gi"),i='/* Content hack because they wont fix */\n/* https://github.com/angular/material/pull/8067 */\n[md-theme="@themeName"] md-content.md-hue-1,\nmd-content.md-@themeName-theme.md-hue-1 {\n color: @backgroundHue1Contrast1;\n background-color: @backgroundHue1Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-2,\nmd-content.md-@themeName-theme.md-hue-2 {\n color: @backgroundHue2Contrast1;\n background-color: @backgroundHue2Color;\n}\n\n[md-theme="@themeName"] md-content.md-hue-3,\n md-content.md-@themeName-theme.md-hue-3 {\n color: @backgroundHue3Contrast1;\n background-color: @backgroundHue3Color;\n}\n\n/* Text Colors */\n[md-theme="@themeName"] a {\n color: @accentDefaultColor;\n}\n\n[md-theme="@themeName"] .secondary-text,\n[md-theme="@themeName"] .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .hint-text,\n[md-theme="@themeName"] .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .fade-text,\n[md-theme="@themeName"] .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Primary */\n[md-theme="@themeName"] .md-primary-bg {\n background-color: @primaryDefaultColor;\n color: @primaryDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg .secondary-text,\n[md-theme="@themeName"] .md-primary-bg .icon {\n color: @primaryDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg .hint-text,\n[md-theme="@themeName"] .md-primary-bg .disabled-text {\n color: @primaryDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg .fade-text,\n[md-theme="@themeName"] .md-primary-bg .divider {\n color: @primaryDefaultContrast4;\n}\n\n/* Primary, Hue-1 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 {\n background-color: @primaryHue1Color;\n color: @primaryHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .icon {\n color: @primaryHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .disabled-text {\n color: @primaryHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-1 .divider {\n color: @primaryHue1Contrast4;\n}\n\n/* Primary, Hue-2 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 {\n background-color: @primaryHue2Color;\n color: @primaryHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .icon {\n color: @primaryHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .disabled-text {\n color: @primaryHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-2 .divider {\n color: @primaryHue2Contrast4;\n}\n\n/* Primary, Hue-3 */\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 {\n background-color: @primaryHue3Color;\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .icon {\n color: @primaryHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .disabled-text {\n color: @primaryHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-primary-bg.md-hue-3 .divider {\n color: @primaryHue3Contrast4;\n}\n\n/* Primary foreground */\n[md-theme="@themeName"] .md-primary-fg {\n color: @primaryDefaultColor !important;\n}\n\n/* Primary foreground, Hue-1 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-1 {\n color: @primaryHue1Color !important;\n}\n\n/* Primary foreground, Hue-2 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-2 {\n color: @primaryHue2Color !important;\n}\n\n/* Primary foreground, Hue-3 */\n[md-theme="@themeName"] .md-primary-fg.md-hue-3 {\n color: @primaryHue3Color !important;\n}\n\n/* Accent */\n[md-theme="@themeName"] .md-accent-bg {\n background-color: @accentDefaultColor;\n color: @accentDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg .secondary-text,\n[md-theme="@themeName"] .md-accent-bg .icon {\n color: @accentDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg .hint-text,\n[md-theme="@themeName"] .md-accent-bg .disabled-text {\n color: @accentDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg .fade-text,\n[md-theme="@themeName"] .md-accent-bg .divider {\n color: @accentDefaultContrast4;\n}\n\n/* Accent, Hue-1 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 {\n background-color: @accentHue1Color;\n color: @accentHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .icon {\n color: @accentHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .disabled-text {\n color: @accentHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-1 .divider {\n color: @accentHue1Contrast4;\n}\n\n/* Accent, Hue-2 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 {\n background-color: @accentHue2Color;\n color: @accentHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .icon {\n color: @accentHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .disabled-text {\n color: @accentHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-2 .divider {\n color: @accentHue2Contrast4;\n}\n\n/* Accent, Hue-3 */\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 {\n background-color: @accentHue3Color;\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .icon {\n color: @accentHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .disabled-text {\n color: @accentHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-accent-bg.md-hue-3 .divider {\n color: @accentHue3Contrast4;\n}\n\n/* Accent foreground */\n[md-theme="@themeName"] .md-accent-fg {\n color: @accentDefaultColor !important;\n}\n\n/* Accent foreground, Hue-1 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-1 {\n color: @accentHue1Color !important;\n}\n\n/* Accent foreground, Hue-2 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-2 {\n color: @accentHue2Color !important;\n}\n\n/* Accent foreground, Hue-3 */\n[md-theme="@themeName"] .md-accent-fg.md-hue-3 {\n color: @accentHue3Color !important;\n}\n\n/* Warn */\n[md-theme="@themeName"] .md-warn-bg {\n background-color: @warnDefaultColor;\n color: @warnDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg .secondary-text,\n[md-theme="@themeName"] .md-warn-bg .icon {\n color: @warnDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg .hint-text,\n[md-theme="@themeName"] .md-warn-bg .disabled-text {\n color: @warnDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg .fade-text,\n[md-theme="@themeName"] .md-warn-bg .divider {\n color: @warnDefaultContrast4;\n}\n\n/* Warn, Hue-1 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 {\n background-color: @warnHue1Color;\n color: @warnHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .icon {\n color: @warnHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .disabled-text {\n color: @warnHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-1 .divider {\n color: @warnHue1Contrast4;\n}\n\n/* Warn, Hue-2 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 {\n background-color: @warnHue2Color;\n color: @warnHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .icon {\n color: @warnHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .disabled-text {\n color: @warnHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-2 .divider {\n color: @warnHue2Contrast4;\n}\n\n/* Warn, Hue-3 */\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 {\n background-color: @warnHue3Color;\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .icon {\n color: @warnHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .disabled-text {\n color: @warnHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-warn-bg.md-hue-3 .divider {\n color: @warnHue3Contrast4;\n}\n\n/* Warn foreground */\n[md-theme="@themeName"] .md-warn-fg {\n color: @warnDefaultColor !important;\n}\n\n/* Warn foreground, Hue-1 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-1 {\n color: @warnHue1Color !important;\n}\n\n/* Warn foreground, Hue-2 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-2 {\n color: @warnHue2Color !important;\n}\n\n/* Warn foreground, Hue-3 */\n[md-theme="@themeName"] .md-warn-fg.md-hue-3 {\n color: @warnHue3Color !important;\n}\n\n/* Background */\n[md-theme="@themeName"] .md-background-bg {\n background-color: @backgroundDefaultColor;\n color: @backgroundDefaultContrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg .secondary-text,\n[md-theme="@themeName"] .md-background-bg .icon {\n color: @backgroundDefaultContrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg .hint-text,\n[md-theme="@themeName"] .md-background-bg .disabled-text {\n color: @backgroundDefaultContrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg .fade-text,\n[md-theme="@themeName"] .md-background-bg .divider {\n color: @backgroundDefaultContrast4;\n}\n\n/* Background, Hue-1 */\n[md-theme="@themeName"] .md-background-bg.md-hue-1 {\n background-color: @backgroundHue1Color;\n color: @backgroundHue1Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .icon {\n color: @backgroundHue1Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .disabled-text {\n color: @backgroundHue1Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-1 .divider {\n color: @backgroundHue1Contrast4;\n}\n\n/* Background, Hue-2 */\n[md-theme="@themeName"] .md-background-bg.md-hue-2 {\n background-color: @backgroundHue2Color;\n color: @backgroundHue2Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .icon {\n color: @backgroundHue2Contrast2;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .disabled-text {\n color: @backgroundHue2Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-2 .divider {\n color: @backgroundHue2Contrast4;\n}\n\n/* Background, Hue-3 */\n[md-theme="@themeName"] .md-background-bg.md-hue-3 {\n background-color: @backgroundHue3Color;\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .secondary-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .icon {\n color: @backgroundHue3Contrast1;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .hint-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .disabled-text {\n color: @backgroundHue3Contrast3;\n}\n\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .fade-text,\n[md-theme="@themeName"] .md-background-bg.md-hue-3 .divider {\n color: @backgroundHue3Contrast4;\n}\n\n/* Background foreground */\n[md-theme="@themeName"] .md-background-fg {\n color: @backgroundDefaultColor !important;\n}\n\n/* Background foreground, Hue-1 */\n[md-theme="@themeName"] .md-background-fg.md-hue-1 {\n color: @backgroundHue1Color !important;\n}\n\n/* Background foreground, Hue-2 */\n[md-theme="@themeName"] .md-background-fg.md-hue-2 {\n color: @backgroundHue2Color !important;\n}\n\n/* Background foreground, Hue-3 */\n[md-theme="@themeName"] .md-background-fg.md-hue-3 {\n color: @backgroundHue3Color !important;\n}'.replace(a,function(e){return n[e]}),s=angular.element("head"),(o=angular.element('<style type="text/css"></style>')).html(i),s.append(o)})},rgba:l};function l(e,t){var n=t||!1;return 4===e.length&&255===e[0]&&255===e[1]&&255===e[2]&&e.splice(3,4),n&&(e=function(e,t){var n={white:{1:"1",2:"0.7",3:"0.3",4:"0.12"},black:{1:"0.87",2:"0.54",3:"0.26",4:"0.12"}};255===e[0]&&255===e[1]&&255===e[2]?e[3]=n.white[t]:0===e[0]&&0===e[1]&&0===e[2]&&(e[3]=n.black[t]);return e}(e,n)),3===e.length?"rgb("+e.join(",")+")":4===e.length?"rgba("+e.join(",")+")":void a.error("Invalid number of arguments supplied in the color array: "+e.length+"\nThe array must have 3 or 4 colors.")}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}}e.$inject=["$cookies","$log","motionTheming"],angular.module("app.core").factory("motionGenerator",e)}(),function(){"use strict";angular.module("app.core").constant("motionPalettes",[{name:"motion-blue",options:{50:"#ebf1fa",100:"#c2d4ef",200:"#9ab8e5",300:"#78a0dc",400:"#5688d3",500:"#3470ca",600:"#2e62b1",700:"#275498",800:"#21467e",900:"#1a3865",A100:"#c2d4ef",A200:"#9ab8e5",A400:"#5688d3",A700:"#275498",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}},{name:"motion-paleblue",options:{50:"#ececee",100:"#c5c6cb",200:"#9ea1a9",300:"#7d818c",400:"#5c616f",500:"#3c4252",600:"#353a48",700:"#2d323e",800:"#262933",900:"#1e2129",A100:"#c5c6cb",A200:"#9ea1a9",A400:"#5c616f",A700:"#2d323e",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400"}}])}(),function(){"use strict";angular.module("app.core").constant("motionThemes",{default:{primary:{name:"motion-paleblue",hues:{default:"700","hue-1":"500","hue-2":"600","hue-3":"400"}},accent:{name:"light-blue",hues:{default:"600","hue-1":"400","hue-2":"700","hue-3":"A100"}},warn:{name:"red"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},pinkTheme:{primary:{name:"blue-grey",hues:{default:"800","hue-1":"600","hue-2":"400","hue-3":"A100"}},accent:{name:"pink",hues:{default:"400","hue-1":"300","hue-2":"600","hue-3":"A100"}},warn:{name:"blue"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}},tealTheme:{primary:{name:"motion-blue",hues:{default:"900","hue-1":"600","hue-2":"500","hue-3":"A100"}},accent:{name:"teal",hues:{default:"500","hue-1":"400","hue-2":"600","hue-3":"A100"}},warn:{name:"deep-orange"},background:{name:"grey",hues:{default:"A100","hue-1":"A100","hue-2":"100","hue-3":"300"}}}})}(),function(){"use strict";function e(n,e,t){var a;angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.getObject("motion.customTheme");i&&(t.custom=i),n.alwaysWatchTheme(!0),angular.forEach(e,function(e){n.definePalette(e.name,e.options)}),angular.forEach(t,function(e,t){n.theme(t).primaryPalette(e.primary.name,e.primary.hues).accentPalette(e.accent.name,e.accent.hues).warnPalette(e.warn.name,e.warn.hues).backgroundPalette(e.background.name,e.background.hues)})}e.$inject=["$mdThemingProvider","motionPalettes","motionThemes"],angular.module("app.core").config(e)}(),function(){"use strict";function e(t,n,e){var a={getRegisteredPalettes:function(){return e.PALETTES},getRegisteredThemes:function(){return e.THEMES},setActiveTheme:function(e){if(angular.isUndefined(a.themes.list[e]))return angular.isUndefined(a.themes.list.default)?void n.error('You must have at least one theme named "default"'):(n.warn('The theme "'+e+'" does not exist! Falling back to the "default" theme.'),a.themes.active.name="default",a.themes.active.theme=a.themes.list.default,void t.put("motion.selectedTheme",a.themes.active.name));a.themes.active.name=e,a.themes.active.theme=a.themes.list[e],t.put("motion.selectedTheme",e)},setThemesList:function(e){a.themes.list=e},themes:{list:{},active:{name:"",theme:{}}}};return a}e.$inject=["$cookies","$log","$mdTheming"],angular.module("app.core").service("motionTheming",e)}(),function(){"use strict";function e(t,s,o,r){this.search=function(t){for(var e=[],n=r.getFlatNavigation(),a=o.defer(),i=0;i<n.length;i+=1)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return s(function(){a.resolve(e)},1e3),a.promise},this.searchResultClick=function(e){e.uisref&&(e.stateParams?t.go(e.state,e.stateParams):t.go(e.state))}}e.$inject=["$state","$timeout","$q","msNavigationService"],angular.module("app.errors.error-404").controller("Error404Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.code="",n.send=!1,n.error=e.params,n.sendReport=function(){t.post("/api/jira",n.error).then(function(e){n.send=!0,e.data&&(n.code=e.data.id)},function(e){n.send=!1})}}e.$inject=["$state","$http"],angular.module("app.errors.error-500").controller("Error500Controller",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.cookieAlertHide=t.get("motion.cookieAlertHide:"+n.currentUser.id)||!1,n.cookieAlertOnClose=function(){t.put("motion.cookieAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.footer").controller("FooterController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.form={},s.forgotPassword=function(){return i.auth.forgot(s.form).$promise.then(function(){t.success({title:n.instant("FORGOTPASSWORD.LINK_SENT"),msg:n.instant("FORGOTPASSWORD.LINNK_SENT_MESSAGE")})}).catch(function(e){e&&t.error({title:n.instant("FORGOTPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},s.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general")}}e.$inject=["Auth","toasty","$translate","$state","api"],angular.module("app.forgot").controller("ForgotPasswordController",e)}(),function(){"use strict";function e(e,t){var n=this;n.currentUser=e.getCurrentUser(),n.newsAlertHide=t.get("motion.newsAlertHide:"+n.currentUser.id)||!1,n.newsAlertOnClose=function(){t.put("motion.newsAlertHide:"+n.currentUser.id,!0)}}e.$inject=["Auth","$cookies"],angular.module("app.header").controller("HeaderController",e)}(),function(){"use strict";function e(e){var t={baseUrl:"api/"};return t.auth=e(t.baseUrl+"auth/local",{},{local:{method:"post",url:t.baseUrl+"auth/local"},forgot:{method:"post",url:t.baseUrl+"auth/local/forgot"},reset:{method:"post",url:t.baseUrl+"auth/local/reset/:token",params:{token:"@token"}},google:{method:"post",url:t.baseUrl+"auth/google"}}),t.jira=e(t.baseUrl+"jira"),t.rpc=e(t.baseUrl+"rpc",{},{startMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/mixmonitor",params:{uniqueid:"@uniqueid"}},stopMonitor:{method:"get",url:t.baseUrl+"rpc/voice/channels/:uniqueid/stopmixmonitor",params:{uniqueid:"@uniqueid"}},getVoiceChannels:{method:"get",url:t.baseUrl+"rpc/voice/channels"},getVoiceQueues:{method:"get",url:t.baseUrl+"rpc/voice/queues"},getChatQueues:{method:"get",url:t.baseUrl+"rpc/chat/queues"},getMailQueues:{method:"get",url:t.baseUrl+"rpc/mail/queues"},getSmsQueues:{method:"get",url:t.baseUrl+"rpc/sms/queues"},getOpenchannelQueues:{method:"get",url:t.baseUrl+"rpc/openchannel/queues"},getFaxQueues:{method:"get",url:t.baseUrl+"rpc/fax/queues"},getVoiceQueuesPreview:{method:"get",url:t.baseUrl+"rpc/voice/queues/preview/:id"},getVoiceQueuesChannels:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels"},getVoiceQueuesChannel:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid"},getVoiceQueuesChannelHangup:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/hangup"},getVoiceQueuesChannelRedirect:{method:"get",url:t.baseUrl+"rpc/voice/queues/channels/:uniqueid/redirect/:exten"},getOutbound:{method:"get",url:t.baseUrl+"rpc/outbound"},getOutboundChannels:{method:"get",url:t.baseUrl+"rpc/outbound/channels"},getAgents:{method:"get",url:t.baseUrl+"rpc/agents"},setAgentCapacity:{method:"put",url:t.baseUrl+"rpc/agents/:id/capacity",params:{id:"@id"}},getTelephones:{method:"get",url:t.baseUrl+"rpc/telephones"},getTrunks:{method:"get",url:t.baseUrl+"rpc/trunks"},getCampaigns:{method:"get",url:t.baseUrl+"rpc/campaigns"},getMailAccounts:{method:"get",url:t.baseUrl+"rpc/mail/accounts"},getFaxAccounts:{method:"get",url:t.baseUrl+"rpc/fax/accounts"},getChatQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/chat/queues/waitinginteractions"},getMailQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/mail/queues/waitinginteractions"},getOpenchannelQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/openchannel/queues/waitinginteractions"},getSmsQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/sms/queues/waitinginteractions"},getFaxQueuesWaitingInteractions:{method:"get",url:t.baseUrl+"rpc/fax/queues/waitinginteractions"},mailQueueNotify:{method:"post",url:t.baseUrl+"rpc/mail/queues/:id/notify",params:{id:"@id"}},chatQueueNotify:{method:"post",url:t.baseUrl+"rpc/chat/queues/:id/notify",params:{id:"@id"}},faxQueueNotify:{method:"post",url:t.baseUrl+"rpc/fax/queues/:id/notify",params:{id:"@id"}},smsQueueNotify:{method:"post",url:t.baseUrl+"rpc/sms/queues/:id/notify",params:{id:"@id"}},openchannelQueueNotify:{method:"post",url:t.baseUrl+"rpc/openchannel/queues/:id/notify",params:{id:"@id"}},agentNotify:{method:"post",url:t.baseUrl+"rpc/agents/:id/notify",params:{id:"@id"}}}),t.version=e(t.baseUrl+"version",{},{fetch:{method:"get",url:t.baseUrl+"version/fetch"},reset:{method:"get",url:t.baseUrl+"version/reset"},pull:{method:"get",url:t.baseUrl+"version/pull"},restart:{method:"get",url:t.baseUrl+"version/restart"},migrations:{method:"get",url:t.baseUrl+"version/migrations"}}),t.system=e(t.baseUrl+"system",{},{killProcess:{method:"get",url:t.baseUrl+"system/process/:pid/kill",params:{pid:"@pid"}}}),t.pm2=e(t.baseUrl+"pm2/:id",{id:"@id"},{update:{method:"put",isArray:!0}}),t.user=e(t.baseUrl+"users/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"users/describe"},clone:{method:"post",url:t.baseUrl+"users/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"users/create_many",isArray:!0},addContacts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/contacts"},changePassword:{isArray:!1,method:"put",url:t.baseUrl+"users/:id/password"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/queues"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/avatar"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/avatar"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/contacts"},getQueues:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues"},getVoiceQueuesRt:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/queues_rt"},getGroups:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/groups"},getRecordings:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/recordings"},getChatInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat/interactions"},getOpenchannelInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel/interactions"},getMailInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail/interactions"},getSmsInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms/interactions"},getFaxInteractions:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax/interactions"},login:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/login"},logout:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/logout"},pause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/pause"},unpause:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/unpause"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/teams"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/lists"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/agents"},addChatInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_interactions"},removeChatInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_interactions"},addMailInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_interactions"},removeMailInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_interactions"},addFaxInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_interactions"},removeFaxInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_interactions"},addSmsInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_interactions"},removeSmsInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_interactions"},addOpenchannelInteractions:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_interactions"},removeOpenchannelInteractions:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_interactions"},getVoicePrefixes:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/prefixes"},getFaxAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/fax_accounts"},addFaxAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/fax_accounts"},removeFaxAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/fax_accounts"},getMailAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/mail_accounts"},addMailAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/mail_accounts"},removeMailAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/mail_accounts"},getOpenchannelAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/openchannel_accounts"},addOpenchannelAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/openchannel_accounts"},removeOpenchannelAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/openchannel_accounts"},getSmsAccounts:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/sms_accounts"},addSmsAccounts:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/sms_accounts"},removeSmsAccounts:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/sms_accounts"},getChatWebsites:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/chat_websites"},addChatWebsites:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/chat_websites"},removeChatWebsites:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/chat_websites"},getSquareProjects:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/square_projects"},addSquareProjects:{isArray:!0,method:"post",url:t.baseUrl+"users/:id/square_projects"},removeSquareProjects:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/square_projects"},getScheduledCalls:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/scheduled_calls"},getApiKey:{isArray:!1,method:"get",url:t.baseUrl+"users/:id/api_key"},createApiKey:{isArray:!1,method:"post",url:t.baseUrl+"users/:id/api_key"},removeApiKey:{isArray:!1,method:"delete",url:t.baseUrl+"users/:id/api_key"}}),t.voiceChanSpy=e(t.baseUrl+"voice/chanspy/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/chanspy/describe"},clone:{method:"post",url:t.baseUrl+"voice/chanspy/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceContext=e(t.baseUrl+"voice/contexts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/contexts/describe"},clone:{method:"post",url:t.baseUrl+"voice/contexts/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceExtension=e(t.baseUrl+"voice/extensions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/extensions/describe"},clone:{method:"post",url:t.baseUrl+"voice/extensions/:id/clone",params:{includeAll:"@includeAll"}},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"voice/extensions/:id/applications"}}),t.voiceMusicOnHold=e(t.baseUrl+"voice/mohs/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mohs/describe"},clone:{method:"post",url:t.baseUrl+"voice/mohs/:id/clone",params:{includeAll:"@includeAll"}},addSound:{isArray:!1,method:"post",url:t.baseUrl+"voice/mohs/:id/sounds"},removeSound:{isArray:!1,method:"delete",url:t.baseUrl+"voice/mohs/:id/sounds/:id2"},getSounds:{isArray:!1,method:"get",url:t.baseUrl+"voice/mohs/:id/sounds"}}),t.voiceQueue=e(t.baseUrl+"voice/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/hopper_black"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/users"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/members"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"voice/queues/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"voice/queues/:id/blacklists"}}),t.voiceRecording=e(t.baseUrl+"voice/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/recordings/describe"},clone:{method:"post",url:t.baseUrl+"voice/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},downloads:{isArray:!1,method:"get",url:t.baseUrl+"voice/recordings/:id/downloads"}}),t.voiceMail=e(t.baseUrl+"voice/mails/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/:id/clone",params:{includeAll:"@includeAll"}},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/:id/messages"}}),t.voiceMailMessage=e(t.baseUrl+"voice/mails/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/mails/messages/describe"},clone:{method:"post",url:t.baseUrl+"voice/mails/messages/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"voice/mails/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.voiceCallReport=e(t.baseUrl+"voice/calls/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/calls/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/calls/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceDialReport=e(t.baseUrl+"voice/dials/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/dials/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/dials/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceAgentReport=e(t.baseUrl+"voice/agents/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/agents/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/agents/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueueReport=e(t.baseUrl+"voice/queues/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/queues/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/queues/reports/:id/clone",params:{includeAll:"@includeAll"}},getVoiceQueuesReport:{isArray:!1,method:"get",url:t.baseUrl+"voice/queues/reports/index"}}),t.memberReport=e(t.baseUrl+"members/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"members/reports/describe"},clone:{method:"post",url:t.baseUrl+"members/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.trunk=e(t.baseUrl+"trunks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"trunks/describe"},clone:{method:"post",url:t.baseUrl+"trunks/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceTransferReport=e(t.baseUrl+"voice/transfers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/transfers/reports/describe"},clone:{method:"post",url:t.baseUrl+"voice/transfers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailServerOut=e(t.baseUrl+"mail/out_servers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/out_servers/describe"},clone:{method:"post",url:t.baseUrl+"mail/out_servers/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailAccount=e(t.baseUrl+"mail/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/accounts/describe"},clone:{method:"post",url:t.baseUrl+"mail/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/canned_answers"},getImap:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/in_servers"},addImap:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/in_servers"},removeImap:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/in_servers"},getSmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/out_servers"},addSmtp:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/out_servers"},removeSmtp:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/out_servers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/applications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"mail/accounts/:id/send"},verifySmtp:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/verify"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/accounts/:id/users"}}),t.mailQueue=e(t.baseUrl+"mail/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/queues/describe"},clone:{method:"post",url:t.baseUrl+"mail/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"mail/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"mail/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"mail/queues/:id/users"}}),t.mailSubstatus=e(t.baseUrl+"mail/substatuses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/substatuses/describe"},clone:{method:"post",url:t.baseUrl+"mail/substatuses/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailInteraction=e(t.baseUrl+"mail/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/interactions/describe"},clone:{method:"post",url:t.baseUrl+"mail/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"mail/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"mail/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"mail/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.mailMessage=e(t.baseUrl+"mail/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/messages/describe"},clone:{method:"post",url:t.baseUrl+"mail/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"mail/messages/:id/reject"},download:{isArray:!1,method:"get",url:t.baseUrl+"mail/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.mailApplication=e(t.baseUrl+"mail/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/applications/describe"},clone:{method:"post",url:t.baseUrl+"mail/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.mailQueueReport=e(t.baseUrl+"mail/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.dashboard=e(t.baseUrl+"dashboards/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/:id/clone",params:{includeAll:"@includeAll"}},addItem:{isArray:!1,method:"post",url:t.baseUrl+"dashboards/:id/items"},getItems:{isArray:!1,method:"get",url:t.baseUrl+"dashboards/:id/items"}}),t.dashboardItem=e(t.baseUrl+"dashboards/items/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dashboards/items/describe"},clone:{method:"post",url:t.baseUrl+"dashboards/items/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxAccount=e(t.baseUrl+"fax/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/accounts/describe"},clone:{method:"post",url:t.baseUrl+"fax/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/canned_answers"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/interactions"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/applications"},addAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/addaccountapplications"},updateAccountApplications:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/updateaccountapplications"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/messages"},send:{isArray:!1,method:"post",url:t.baseUrl+"fax/accounts/:id/send"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/accounts/:id/users"}}),t.faxApplication=e(t.baseUrl+"fax/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/applications/describe"},clone:{method:"post",url:t.baseUrl+"fax/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxInteraction=e(t.baseUrl+"fax/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/interactions/describe"},clone:{method:"post",url:t.baseUrl+"fax/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"fax/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"fax/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"fax/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.faxMessage=e(t.baseUrl+"fax/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/messages/describe"},clone:{method:"post",url:t.baseUrl+"fax/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"fax/messages/:id/reject"},download:{isArray:!1,method:"get",url:t.baseUrl+"fax/messages/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.faxQueue=e(t.baseUrl+"fax/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/queues/describe"},clone:{method:"post",url:t.baseUrl+"fax/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"fax/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"fax/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"fax/queues/:id/users"}}),t.faxQueueReport=e(t.baseUrl+"fax/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsAccount=e(t.baseUrl+"sms/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/accounts/describe"},clone:{method:"post",url:t.baseUrl+"sms/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/interactions"},send:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/send"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/accounts/:id/status"},statusGet:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/status"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/accounts/:id/users"}}),t.smsApplication=e(t.baseUrl+"sms/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/applications/describe"},clone:{method:"post",url:t.baseUrl+"sms/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsInteraction=e(t.baseUrl+"sms/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/interactions/describe"},clone:{method:"post",url:t.baseUrl+"sms/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"sms/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"sms/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"sms/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.smsMessage=e(t.baseUrl+"sms/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/messages/describe"},clone:{method:"post",url:t.baseUrl+"sms/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"sms/messages/:id/reject"},status:{isArray:!1,method:"post",url:t.baseUrl+"sms/messages/:id/status"}}),t.smsQueue=e(t.baseUrl+"sms/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/queues/describe"},clone:{method:"post",url:t.baseUrl+"sms/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"sms/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"sms/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"sms/queues/:id/users"}}),t.openchannelAccount=e(t.baseUrl+"openchannel/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/accounts/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/accounts/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/canned_answers"},notify:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/notify"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/applications"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/interactions"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/accounts/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/accounts/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/accounts/:id/users"},send:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/accounts/:id/send"}}),t.openchannelApplication=e(t.baseUrl+"openchannel/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/applications/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelInteraction=e(t.baseUrl+"openchannel/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/interactions/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/interactions/:id/clone",params:{includeAll:"@includeAll"}},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"openchannel/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.openchannelMessage=e(t.baseUrl+"openchannel/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/messages/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"openchannel/messages/:id/reject"}}),t.openchannelQueue=e(t.baseUrl+"openchannel/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/queues/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"openchannel/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"openchannel/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"openchannel/queues/:id/users"}}),t.chatWebsite=e(t.baseUrl+"chat/websites/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/websites/describe"},clone:{method:"post",url:t.baseUrl+"chat/websites/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/dispositions"},addAnswer:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/canned_answers"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/canned_answers"},removeAnswers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/canned_answers"},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/logo"},addAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/avatar"},addCustomerAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/customer_avatar"},addSystemAvatar:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/system_avatar"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/logo"},getAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/avatar"},getCustomerAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/customer_avatar"},getSystemAvatar:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/system_avatar"},notify:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/notify"},offline:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/offline"},addInteraction:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/interactions"},getInteractions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/interactions"},getSnippet:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/snippet"},addApplications:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/applications"},getApplications:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/applications"},addProactiveActions:{isArray:!1,method:"post",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getProactiveActions:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/proactive_actions"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/fields"},getOfflineMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/offline_messages"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/websites/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/websites/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/websites/:id/users"}}),t.openchannelQueueReport=e(t.baseUrl+"openchannel/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatApplication=e(t.baseUrl+"chat/applications/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/applications/describe"},clone:{method:"post",url:t.baseUrl+"chat/applications/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInteraction=e(t.baseUrl+"chat/interactions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/interactions/describe"},clone:{method:"post",url:t.baseUrl+"chat/interactions/:id/clone",params:{includeAll:"@includeAll"}},customUpdate:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/custom_update"},abandon:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/abandon"},attachmentUpload:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/attachment_upload"},attachmentDownload:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/attachment_download"},close:{isArray:!1,method:"put",url:t.baseUrl+"chat/interactions/:id/close"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/messages"},getMyMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/my_messages"},addTags:{isArray:!1,method:"post",url:t.baseUrl+"chat/interactions/:id/tags"},removeTags:{isArray:!1,method:"delete",url:t.baseUrl+"chat/interactions/:id/tags"},download:{isArray:!1,method:"get",url:t.baseUrl+"chat/interactions/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.chatMessage=e(t.baseUrl+"chat/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/messages/:id/clone",params:{includeAll:"@includeAll"}},accept:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/accept"},reject:{isArray:!1,method:"put",url:t.baseUrl+"chat/messages/:id/reject"}}),t.chatOfflineMessage=e(t.baseUrl+"chat/offline_messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/offline_messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/offline_messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueue=e(t.baseUrl+"chat/queues/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/queues/describe"},clone:{method:"post",url:t.baseUrl+"chat/queues/:id/clone",params:{includeAll:"@includeAll"}},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/members"},getTeams:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/teams"},addTeams:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/teams"},removeTeams:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/teams"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"chat/queues/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"chat/queues/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"chat/queues/:id/users"}}),t.chatGroup=e(t.baseUrl+"chat/groups/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/groups/describe"},clone:{method:"post",url:t.baseUrl+"chat/groups/:id/clone",params:{includeAll:"@includeAll"}},getUnread:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/unread"},addMembers:{isArray:!0,method:"post",url:t.baseUrl+"chat/groups/:id/members"},getMembers:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/members"},removeMembers:{isArray:!1,method:"delete",url:t.baseUrl+"chat/groups/:id/members"},addMessage:{isArray:!1,method:"post",url:t.baseUrl+"chat/groups/:id/messages"},getMessages:{isArray:!1,method:"get",url:t.baseUrl+"chat/groups/:id/messages"}}),t.chatProactiveAction=e(t.baseUrl+"chat/proactive_actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/proactive_actions/describe"},clone:{method:"post",url:t.baseUrl+"chat/proactive_actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCompany=e(t.baseUrl+"cm/companies/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/companies/describe"},clone:{method:"post",url:t.baseUrl+"cm/companies/:id/clone",params:{includeAll:"@includeAll"}},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/companies/:id/contacts"},getContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/companies/:id/contacts"}}),t.cmContact=e(t.baseUrl+"cm/contacts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/contacts/describe"},clone:{method:"post",url:t.baseUrl+"cm/contacts/:id/clone",params:{includeAll:"@includeAll"}},merge:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/merge"},bulkCreate:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/create_many"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"cm/contacts/:id/tags"},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/hopper_finals"},getJscriptySessions:{isArray:!1,method:"get",url:t.baseUrl+"cm/contacts/:id/jscripty_sessions"},uploadCsv:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/csv"},upload:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload"},import:{isArray:!1,method:"post",url:t.baseUrl+"cm/contacts/upload/:id"}}),t.cmHopper=e(t.baseUrl+"cm/hopper/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper/:id/clone",params:{includeAll:"@includeAll"}},getPreview:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper/preview"},getOpenContacts:{isArray:!1,method:"get",url:t.baseUrl+"cm/hopper/opencontacts"}}),t.cmHopperBlack=e(t.baseUrl+"cm/hopper_black/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_black/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_black/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmHopperFinal=e(t.baseUrl+"cm/hopper_final/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_final/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_final/:id/clone",params:{includeAll:"@includeAll"}},countContactsQueueCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/voice/queue/countAttributes/:id"},countContactsIvrCampaignHopperFinal:{isArray:!0,method:"get",url:t.baseUrl+"cm/hopper_final/campaign/countAttributes/:id"},moveContactsQueueCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/queue/moveContacts/:id"},moveContactsIvrCampaignHopperFinal:{isArray:!0,method:"post",url:t.baseUrl+"cm/hopper_final/voice/campaign/moveContacts/:id"},checkContactHopper:{isArray:!1,method:"post",url:t.baseUrl+"cm/hopper_final/checkContactHopper"}}),t.cmHopperHistory=e(t.baseUrl+"cm/hopper_history/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/hopper_history/describe"},clone:{method:"post",url:t.baseUrl+"cm/hopper_history/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmCustomField=e(t.baseUrl+"cm/custom_fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/custom_fields/describe"},clone:{method:"post",url:t.baseUrl+"cm/custom_fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.action=e(t.baseUrl+"actions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"actions/describe"},clone:{method:"post",url:t.baseUrl+"actions/:id/clone",params:{includeAll:"@includeAll"}}}),t.automation=e(t.baseUrl+"automations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"automations/describe"},clone:{method:"post",url:t.baseUrl+"automations/:id/clone",params:{includeAll:"@includeAll"}},addConditions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/conditions"},getConditions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/conditions"},addActions:{isArray:!1,method:"post",url:t.baseUrl+"automations/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"automations/:id/actions"}}),t.cannedAnswer=e(t.baseUrl+"canned_answers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"canned_answers/describe"},clone:{method:"post",url:t.baseUrl+"canned_answers/:id/clone",params:{includeAll:"@includeAll"}}}),t.disposition=e(t.baseUrl+"dispositions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"dispositions/describe"},clone:{method:"post",url:t.baseUrl+"dispositions/:id/clone",params:{includeAll:"@includeAll"}}}),t.condition=e(t.baseUrl+"conditions/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"conditions/describe"},clone:{method:"post",url:t.baseUrl+"conditions/:id/clone",params:{includeAll:"@includeAll"}}}),t.interval=e(t.baseUrl+"intervals/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"intervals/describe"},clone:{method:"post",url:t.baseUrl+"intervals/:id/clone",params:{includeAll:"@includeAll"}},addInterval:{isArray:!1,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals"},getIntervals:{isArray:!1,method:"get",url:t.baseUrl+"intervals/:id/sub_intervals"},addIntervals:{isArray:!0,method:"post",url:t.baseUrl+"intervals/:id/sub_intervals/create_many"}}),t.pause=e(t.baseUrl+"pauses/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"pauses/describe"},clone:{method:"post",url:t.baseUrl+"pauses/:id/clone",params:{includeAll:"@includeAll"}}}),t.cdr=e(t.baseUrl+"cdr/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cdr/describe"},clone:{method:"post",url:t.baseUrl+"cdr/:id/clone",params:{includeAll:"@includeAll"}}}),t.voiceQueuesLog=e(t.baseUrl+"voiceQueuesLog/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voiceQueuesLog/describe"},clone:{method:"post",url:t.baseUrl+"voiceQueuesLog/:id/clone",params:{includeAll:"@includeAll"}}}),t.schedule=e(t.baseUrl+"schedules/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"schedules/describe"},clone:{method:"post",url:t.baseUrl+"schedules/:id/clone",params:{includeAll:"@includeAll"}},run:{isArray:!1,method:"get",url:t.baseUrl+"schedules/:id/run"}}),t.sound=e(t.baseUrl+"sounds/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sounds/describe"},clone:{method:"post",url:t.baseUrl+"sounds/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"sounds/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},delete:{isArray:!1,method:"delete",url:t.baseUrl+"sounds/:id"}}),t.tag=e(t.baseUrl+"tags/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"tags/describe"},clone:{method:"post",url:t.baseUrl+"tags/:id/clone",params:{includeAll:"@includeAll"}}}),t.template=e(t.baseUrl+"templates/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"templates/describe"},clone:{method:"post",url:t.baseUrl+"templates/:id/clone",params:{includeAll:"@includeAll"}}}),t.trigger=e(t.baseUrl+"triggers/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"triggers/describe"},clone:{method:"post",url:t.baseUrl+"triggers/:id/clone",params:{includeAll:"@includeAll"}},addAllCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/all_conditions"},addAnyCondition:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/any_conditions"},getAllConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/all_conditions"},getAnyConditions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/any_conditions"},addAction:{isArray:!1,method:"post",url:t.baseUrl+"triggers/:id/actions"},getActions:{isArray:!1,method:"get",url:t.baseUrl+"triggers/:id/actions"}}),t.variable=e(t.baseUrl+"variables/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"variables/describe"},clone:{method:"post",url:t.baseUrl+"variables/:id/clone",params:{includeAll:"@includeAll"}}}),t.integration=e(t.baseUrl+"integrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.integrationReport=e(t.baseUrl+"integrations/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/reports/describe"},clone:{method:"post",url:t.baseUrl+"integrations/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticCustomReport=e(t.baseUrl+"analytics/custom_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/custom_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/custom_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/custom_reports/:id/query"}}),t.analyticDefaultReport=e(t.baseUrl+"analytics/default_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/default_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/default_reports/:id/clone",params:{includeAll:"@includeAll"}},preview:{isArray:!0,method:"get",url:t.baseUrl+"analytics/default_reports/:id/preview"},run:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/run"},query:{isArray:!1,method:"get",url:t.baseUrl+"analytics/default_reports/:id/query"}}),t.analyticExtractedReport=e(t.baseUrl+"analytics/extracted_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/extracted_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/extracted_reports/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"analytics/extracted_reports/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.analyticMetric=e(t.baseUrl+"analytics/metrics/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/metrics/describe"},clone:{method:"post",url:t.baseUrl+"analytics/metrics/:id/clone",params:{includeAll:"@includeAll"}}}),t.analyticFieldReport=e(t.baseUrl+"analytics/field_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/field_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/field_reports/:id/clone",params:{includeAll:"@includeAll"}},bulkCreate:{method:"post",url:t.baseUrl+"analytics/field_reports/create_many",isArray:!0},bulkDestroy:{method:"delete",url:t.baseUrl+"analytics/field_reports/destroy_many",isArray:!0},addFields:{isArray:!0,method:"post",url:t.baseUrl+"analytics/field_reports/:id/create_many"}}),t.analyticTreeReport=e(t.baseUrl+"analytics/tree_reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"analytics/tree_reports/describe"},clone:{method:"post",url:t.baseUrl+"analytics/tree_reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSalesforceAccount=e(t.baseUrl+"integrations/salesforce/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/salesforce/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/accounts/:id/fields"}}),t.intSalesforceConfiguration=e(t.baseUrl+"integrations/salesforce/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/salesforce/configurations/:id/descriptions"}}),t.intSalesforceField=e(t.baseUrl+"integrations/salesforce/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/salesforce/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/salesforce/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intSugarcrmAccount=e(t.baseUrl+"integrations/sugarcrm/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/accounts/:id/fields"}}),t.intSugarcrmConfiguration=e(t.baseUrl+"integrations/sugarcrm/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/sugarcrm/configurations/:id/descriptions"}}),t.intSugarcrmField=e(t.baseUrl+"integrations/sugarcrm/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/sugarcrm/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/sugarcrm/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDeskAccount=e(t.baseUrl+"integrations/desk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/desk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/accounts/:id/fields"}}),t.intDeskConfiguration=e(t.baseUrl+"integrations/desk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/desk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/desk/configurations/:id/tags"}}),t.intDeskField=e(t.baseUrl+"integrations/desk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/desk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/desk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZohoAccount=e(t.baseUrl+"integrations/zoho/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zoho/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/accounts/:id/fields"}}),t.intZohoConfiguration=e(t.baseUrl+"integrations/zoho/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zoho/configurations/:id/descriptions"}}),t.intZohoField=e(t.baseUrl+"integrations/zoho/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zoho/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zoho/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intZendeskAccount=e(t.baseUrl+"integrations/zendesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/zendesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/accounts/:id/fields"}}),t.intZendeskConfiguration=e(t.baseUrl+"integrations/zendesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/zendesk/configurations/:id/tags"}}),t.intZendeskField=e(t.baseUrl+"integrations/zendesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/zendesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/zendesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intFreshdeskAccount=e(t.baseUrl+"integrations/freshdesk/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/freshdesk/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/accounts/:id/fields"}}),t.intFreshdeskConfiguration=e(t.baseUrl+"integrations/freshdesk/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/descriptions"},getTags:{isArray:!1,method:"get",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"},setTags:{isArray:!0,method:"post",url:t.baseUrl+"integrations/freshdesk/configurations/:id/tags"}}),t.intFreshdeskField=e(t.baseUrl+"integrations/freshdesk/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/freshdesk/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/freshdesk/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intVtigerAccount=e(t.baseUrl+"integrations/vtiger/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/vtiger/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/accounts/:id/fields"}}),t.intVtigerConfiguration=e(t.baseUrl+"integrations/vtiger/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/vtiger/configurations/:id/descriptions"}}),t.intVtigerField=e(t.baseUrl+"integrations/vtiger/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/vtiger/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/vtiger/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intServicenowAccount=e(t.baseUrl+"integrations/servicenow/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/servicenow/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/accounts/:id/fields"}}),t.intServicenowConfiguration=e(t.baseUrl+"integrations/servicenow/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/servicenow/configurations/:id/descriptions"}}),t.intServicenowField=e(t.baseUrl+"integrations/servicenow/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/servicenow/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/servicenow/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.intDynamics365Account=e(t.baseUrl+"integrations/dynamics365/accounts/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/accounts/:id/clone",params:{includeAll:"@includeAll"}},getConfigurations:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},addConfiguration:{isArray:!1,method:"post",url:t.baseUrl+"integrations/dynamics365/accounts/:id/configurations"},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/accounts/:id/fields"}}),t.intDynamics365Configuration=e(t.baseUrl+"integrations/dynamics365/configurations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/configurations/:id/clone",params:{includeAll:"@includeAll"}},getFields:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/fields"},getSubjects:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/subjects"},getDescriptions:{isArray:!1,method:"get",url:t.baseUrl+"integrations/dynamics365/configurations/:id/descriptions"}}),t.intDynamics365Field=e(t.baseUrl+"integrations/dynamics365/fields/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"integrations/dynamics365/fields/describe"},clone:{method:"post",url:t.baseUrl+"integrations/dynamics365/fields/:id/clone",params:{includeAll:"@includeAll"}}}),t.network=e(t.baseUrl+"networks/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"networks/describe"},clone:{method:"post",url:t.baseUrl+"networks/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatQueueReport=e(t.baseUrl+"chat/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatInternalMessage=e(t.baseUrl+"chat/internal/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/internal/messages/describe"},clone:{method:"post",url:t.baseUrl+"chat/internal/messages/:id/clone",params:{includeAll:"@includeAll"}},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"chat/internal/messages/users"}}),t.jscriptyAnswerReport=e(t.baseUrl+"jscripty/answers/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/answers/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/answers/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyQuestionReport=e(t.baseUrl+"jscripty/questions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/questions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/questions/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptySessionReport=e(t.baseUrl+"jscripty/sessions/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/sessions/reports/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/sessions/reports/:id/clone",params:{includeAll:"@includeAll"}},getQuestions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/sessions/reports/:id/questions"}}),t.smsQueueReport=e(t.baseUrl+"sms/reports/queue/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/queue/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/queue/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReport=e(t.baseUrl+"square/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.squareReportDetail=e(t.baseUrl+"square/details/reports/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/details/reports/describe"},clone:{method:"post",url:t.baseUrl+"square/details/reports/:id/clone",params:{includeAll:"@includeAll"}}}),t.jscriptyProject=e(t.baseUrl+"jscripty/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"jscripty/projects/describe"},clone:{method:"post",url:t.baseUrl+"jscripty/projects/:id/clone",params:{includeAll:"@includeAll"}},getSessions:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/sessions"},getAnswers:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/answers"},getSummary:{isArray:!1,method:"get",url:t.baseUrl+"jscripty/projects/:id/summary",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.setting=e(t.baseUrl+"settings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"settings/describe"},clone:{method:"post",url:t.baseUrl+"settings/:id/clone",params:{includeAll:"@includeAll"}},addLogo:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo"},addLogoLogin:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/logo_login"},getLogo:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo"},getLogoLogin:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/logo_login"},gdpr:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/gdpr"},addPreferred:{isArray:!1,method:"post",url:t.baseUrl+"settings/:id/preferred"},getPreferred:{isArray:!1,method:"get",url:t.baseUrl+"settings/:id/preferred"}}),t.squareOdbc=e(t.baseUrl+"square/odbc/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/odbc/describe"},clone:{method:"post",url:t.baseUrl+"square/odbc/:id/clone",params:{includeAll:"@includeAll"}},test:{isArray:!1,method:"get",url:t.baseUrl+"square/odbc/:id/test"}}),t.squareProject=e(t.baseUrl+"square/projects/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/projects/describe"},clone:{method:"post",url:t.baseUrl+"square/projects/:id/clone",params:{includeAll:"@includeAll"}},addUsers:{isArray:!0,method:"post",url:t.baseUrl+"square/projects/:id/users"},removeUsers:{isArray:!1,method:"delete",url:t.baseUrl+"square/projects/:id/users"},getUsers:{isArray:!1,method:"get",url:t.baseUrl+"square/projects/:id/users"}}),t.squareRecording=e(t.baseUrl+"square/recordings/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/recordings/describe"},clone:{method:"post",url:t.baseUrl+"square/recordings/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"square/recordings/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.squareMessage=e(t.baseUrl+"square/messages/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"square/messages/describe"},clone:{method:"post",url:t.baseUrl+"square/messages/:id/clone",params:{includeAll:"@includeAll"}}}),t.team=e(t.baseUrl+"teams/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"teams/describe"},clone:{method:"post",url:t.baseUrl+"teams/:id/clone",params:{includeAll:"@includeAll"}},getQueues:{isArray:!0,method:"get",url:t.baseUrl+"teams/:id/queues"},addQueues:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/queues"},removeQueues:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/queues"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"teams/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"teams/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"teams/:id/users"}}),t.license=e(t.baseUrl+"license/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"license/describe"},clone:{method:"post",url:t.baseUrl+"license/:id/clone",params:{includeAll:"@includeAll"}}}),t.campaign=e(t.baseUrl+"campaigns/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"campaigns/describe"},clone:{method:"post",url:t.baseUrl+"campaigns/:id/clone",params:{includeAll:"@includeAll"}},getHoppers:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hoppers"},getHopperHistories:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_histories"},getHopperFinals:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_finals"},getHopperBlacks:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/hopper_black"},getLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/lists"},addLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/lists"},removeLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/lists"},getBlackLists:{isArray:!1,method:"get",url:t.baseUrl+"campaigns/:id/blacklists"},addBlackLists:{isArray:!0,method:"post",url:t.baseUrl+"campaigns/:id/blacklists"},removeBlackLists:{isArray:!0,method:"delete",url:t.baseUrl+"campaigns/:id/blacklists"}}),t.migration=e(t.baseUrl+"migrations/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"migrations/describe"},clone:{method:"post",url:t.baseUrl+"migrations/:id/clone",params:{includeAll:"@includeAll"}}}),t.attachment=e(t.baseUrl+"attachments/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"attachments/describe"},clone:{method:"post",url:t.baseUrl+"attachments/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"attachments/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}}}),t.plugin=e(t.baseUrl+"plugins/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"plugins/describe"},clone:{method:"post",url:t.baseUrl+"plugins/:id/clone",params:{includeAll:"@includeAll"}},download:{isArray:!1,method:"get",url:t.baseUrl+"plugins/:id/download",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},upload:{isArray:!1,method:"post",url:t.baseUrl+"plugins/"},delete:{isArray:!1,method:"delete",url:t.baseUrl+"plugins/:id"},webhookGet:{isArray:!1,method:"get",url:t.baseUrl+"plugins/webhook"},webhookPost:{isArray:!1,method:"post",url:t.baseUrl+"plugins/webhook"}}),t.mailTransferReport=e(t.baseUrl+"mail/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"mail/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"mail/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.chatTransferReport=e(t.baseUrl+"chat/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"chat/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"chat/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.faxTransferReport=e(t.baseUrl+"fax/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"fax/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"fax/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.openchannelTransferReport=e(t.baseUrl+"openchannel/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"openchannel/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"openchannel/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.smsTransferReport=e(t.baseUrl+"sms/reports/transfer/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"sms/reports/transfer/describe"},clone:{method:"post",url:t.baseUrl+"sms/reports/transfer/:id/clone",params:{includeAll:"@includeAll"}}}),t.cmList=e(t.baseUrl+"cm/lists/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"cm/lists/describe"},clone:{method:"post",url:t.baseUrl+"cm/lists/:id/clone",params:{includeAll:"@includeAll"}},addDisposition:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/dispositions"},getDispositions:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/dispositions"},removeDispositions:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/dispositions"},addContacts:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/contacts"},getContacts:{isArray:!0,method:"get",url:t.baseUrl+"cm/lists/:id/contacts"},getContactsCsv:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/contacts/csv",responseType:"arraybuffer",cache:!1,transformResponse:function(e,t){var n=t();return{type:n["content-type"],length:n["content-length"],buffer:e}}},addCustomField:{isArray:!1,method:"post",url:t.baseUrl+"cm/lists/:id/fields"},getCustomFields:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/fields"},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"cm/lists/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"cm/lists/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"cm/lists/:id/users"}}),t.voicePrefix=e(t.baseUrl+"voice/prefixes/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"voice/prefixes/describe"},clone:{method:"post",url:t.baseUrl+"voice/prefixes/:id/clone",params:{includeAll:"@includeAll"}},addAgents:{isArray:!0,method:"post",url:t.baseUrl+"voice/prefixes/:id/users"},removeAgents:{isArray:!1,method:"delete",url:t.baseUrl+"voice/prefixes/:id/users"},getAgents:{isArray:!1,method:"get",url:t.baseUrl+"voice/prefixes/:id/users"}}),t.userProfile=e(t.baseUrl+"userProfiles/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfiles/describe"},clone:{method:"post",url:t.baseUrl+"userProfiles/:id/clone",params:{includeAll:"@includeAll"}},addSections:{isArray:!0,method:"post",url:t.baseUrl+"userProfiles/:id/sections"},removeSections:{isArray:!1,method:"delete",url:t.baseUrl+"userProfiles/:id/sections"},addResources:{isArray:!0,method:"post",url:t.baseUrl+"userProfiles/:id/resources"},removeResources:{isArray:!1,method:"delete",url:t.baseUrl+"userProfiles/:id/resources"},getResources:{isArray:!1,method:"get",url:t.baseUrl+"userProfiles/:id/resources"}}),t.userProfileSection=e(t.baseUrl+"userProfile/sections/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfile/sections/describe"},clone:{method:"post",url:t.baseUrl+"userProfile/sections/:id/clone",params:{includeAll:"@includeAll"}}}),t.userProfileResource=e(t.baseUrl+"userProfile/resources/:id",{id:"@id"},{update:{method:"put"},describe:{method:"get",url:t.baseUrl+"userProfile/resources/describe"},clone:{method:"post",url:t.baseUrl+"userProfile/resources/:id/clone",params:{includeAll:"@includeAll"}}}),t}e.$inject=["$resource"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(e,t){t.setConfig({position:"top-right",sound:!1,html:!0,theme:"material"}),e.useLoader("$translatePartialLoader",{urlTemplate:"{part}/i18n/{lang}.json"}),e.preferredLanguage("en"),e.useSanitizeValueStrategy(null)}e.$inject=["$translateProvider","toastyConfigProvider"],angular.module("motion").config(e)}(),function(){"use strict";angular.module("motion")}(),function(){"use strict";function e(e,t,n,a){var i=this;i.themes=e.themes,i.direction="ltr";var s=n.get("motion.language");s&&(t.use(s),0<=["ar","fa","he"].indexOf(s)&&a.setting.get({id:1}).$promise.then(function(e){e&&e.rtlSupport&&(i.direction="rtl")}).catch(function(e){e&&toasty.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})}))}e.$inject=["motionTheming","$translate","$cookies","api"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(a,i){return function(e){var t=new Date,n=new Date(e);return n.getDate()===t.getDate()&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?a("date")(n.getTime(),"shortTime"):n.getDate()===t.getDate()-1&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()?i.instant("DASHBOARDS.YESTERDAY")+" "+a("date")(n.getTime(),"shortTime"):a("date")(n.getTime(),"MMM d, y h:mm a")}}function t(e){return{Today:e.instant("DASHBOARDS.TODAY"),Yesterday:e.instant("DASHBOARDS.YESTERDAY"),"This Week":e.instant("DASHBOARDS.THIS_WEEK"),"Last Week":e.instant("DASHBOARDS.LAST_WEEK"),"This Month":e.instant("DASHBOARDS.THIS_MONTH"),"Last Month":e.instant("DASHBOARDS.LAST_MONTH"),"This Year":e.instant("DASHBOARDS.THIS_YEAR"),"Last Year":e.instant("DASHBOARDS.LAST_YEAR"),January:e.instant("DASHBOARDS.JANUARY"),February:e.instant("DASHBOARDS.FEBRUARY"),March:e.instant("DASHBOARDS.MARCH"),April:e.instant("DASHBOARDS.APRIL"),May:e.instant("DASHBOARDS.MAY"),June:e.instant("DASHBOARDS.JUNE"),July:e.instant("DASHBOARDS.JULY"),August:e.instant("DASHBOARDS.AUGUST"),September:e.instant("DASHBOARDS.SEPTEMBER"),October:e.instant("DASHBOARDS.OCTOBER"),November:e.instant("DASHBOARDS.NOVEMBER"),December:e.instant("DASHBOARDS.DECEMBER"),Mon:e.instant("DASHBOARDS.MON"),Tue:e.instant("DASHBOARDS.TUE"),Wed:e.instant("DASHBOARDS.WED"),Thu:e.instant("DASHBOARDS.THU"),Fri:e.instant("DASHBOARDS.FRI"),Sat:e.instant("DASHBOARDS.SAT"),Sun:e.instant("DASHBOARDS.SUN")}}e.$inject=["$filter","$translate"],t.$inject=["$translate"],angular.module("motion").filter("limitObjectFromTo",function(){return function(e,t,n){var a,i={},s=0;for(a in e)if(n<=s&&(i[a]=e[a]),++s===n+t)break;return i}}).filter("formatdate",e).factory("IndexFactory",function(){var e=[{value:"jan"},{value:"feb"},{value:"mar"},{value:"apr"},{value:"may"},{value:"jun"},{value:"jul"},{value:"aug"},{value:"sep"},{value:"oct"},{value:"nov"},{value:"dec"}],t=[{value:"1"},{value:"2"},{value:"3"},{value:"4"},{value:"5"},{value:"6"},{value:"7"},{value:"8"},{value:"9"},{value:"10"},{value:"11"},{value:"12"}],n=[{value:"mon"},{value:"tue"},{value:"wed"},{value:"thu"},{value:"fri"},{value:"sat"},{value:"sun"}],a=[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{getMonthName:function(){return e},getMonthNumber:function(){return t},getDaysOfWeek:function(){return n},getDaysOfMonth:function(){return a}}}).factory("dateFilterLocalizationFactory",t).factory("Sequence",function(){return{enqueue:function(e){this.tail=this.tail?this.tail.finally(e):e()}}})}(),function(){"use strict";function e(e,t,n){var a;n.html5Mode(!0),t.otherwise("/dashboards/general"),angular.injector(["ngCookies"]).invoke(["$cookies",function(e){a=e}]);var i=a.get("motion.layoutStyle")||"verticalNavigation",s={verticalNavigation:{main:"app/core/layouts/vertical-navigation.html",toolbar:"app/toolbar/layouts/vertical-navigation/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html",header:"app/header/layouts/vertical-navigation/header.html",footer:"app/footer/layouts/vertical-navigation/footer.html"},verticalNavigationFullwidthToolbar:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation/navigation.html"},verticalNavigationFullwidthToolbar2:{main:"app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",toolbar:"app/toolbar/layouts/vertical-navigation-fullwidth-toolbar-2/toolbar.html",navigation:"app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html"},horizontalNavigation:{main:"app/core/layouts/horizontal-navigation.html",toolbar:"app/toolbar/layouts/horizontal-navigation/toolbar.html",navigation:"app/navigation/layouts/horizontal-navigation/navigation.html"},contentOnly:{main:"app/core/layouts/content-only.html",toolbar:"",navigation:""},contentWithToolbar:{main:"app/core/layouts/content-with-toolbar.html",toolbar:"app/toolbar/layouts/content-with-toolbar/toolbar.html",navigation:""}};e.state("app",{abstract:!0,views:{"main@":{templateUrl:s[i].main,controller:"MainController as vm"},"toolbar@app":{templateUrl:s[i].toolbar,controller:"ToolbarController as vm"},"navigation@app":{templateUrl:s[i].navigation,controller:"NavigationController as vm"},"quickPanel@app":{templateUrl:"app/quick-panel/quick-panel.html",controller:"QuickPanelController as vm"},"header@app":{templateUrl:s[i].header,controller:"HeaderController as vm"},"footer@app":{templateUrl:s[i].footer,controller:"FooterController as vm"}},resolve:{license:["apiResolver",function(e){return e.resolve("license@get")}],setting:["apiResolver",function(e){return e.resolve("setting@get",{id:1})}]}})}e.$inject=["$stateProvider","$urlRouterProvider","$locationProvider"],angular.module("motion").config(e)}(),function(){"use strict";function e(e,t,n){var a=e.$on("$stateChangeStart",function(){e.loadingProgress=!0}),i=e.$on("$stateChangeSuccess",function(){t(function(){e.loadingProgress=!1})});e.state=n,e.$on("$destroy",function(){a(),i()})}e.$inject=["$rootScope","$timeout","$state"],angular.module("motion").run(e)}(),function(){"use strict";function e(a,e){var i;function s(){i=io({query:"id="+e.getCurrentUser().id,transports:["websocket","polling"]})}return{connect:s,on:function(e,t){t=t||angular.noop,i||s(),i.on(e,function(){var e=arguments;a.$apply(function(){t.apply(i,e)})})},onWithoutApply:function(e,t){t=t||angular.noop,i||s(),i.on(e,function(){t.apply(i,arguments)})},emit:function(e,t,n){n=n||angular.noop,i||s(),i.emit(e,t,function(){var e=arguments;a.$apply(function(){n.apply(i,e)})})},removeAllListeners:function(e){i||s(),i.removeAllListeners(e)},removeListener:function(e,t){i||s(),i.removeListener(e,t)},disconnect:function(){i||s(),i.disconnect()}}}e.$inject=["$rootScope","Auth"],angular.module("motion").factory("socket",e)}(),function(){"use strict";function e(t,n,e,a,i,s){var o=this;o.progresslogin=!1,o.login=function(){return o.progresslogin=!0,o.message="",s.login(o.form).then(function(){return t.go("app.dashboards.general")}).catch(function(e){o.message=e.message}).finally(function(){o.progresslogin=!1})},o.loginOauth=function(e){o.message="",n.location.href="/api/auth/"+e},o.onInit=function(){{if(t.params.token&&t.params.userId)return s.removeCookies(),o.progresslogin=!0,e.put("motion.token",t.params.token),i.user.get({id:t.params.userId}).$promise.then(function(e){e&&(s.updateCurrentUser(e),t.go("app.dashboards.general"))}).finally(function(){o.progresslogin=!1});s.isLoggedIn()&&t.go("app.dashboards.general")}},o.onInit()}e.$inject=["$state","$window","$cookies","$timeout","api","Auth"],angular.module("app.login").controller("LoginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_EXTRACTEDREPORT",g.extractedReport=angular.copy(l),g.extractedReports=r,g.newExtractedReport=!1,g.extractedReport||(g.extractedReport={},g.title="ANALYTICS.NEW_EXTRACTEDREPORT",g.newExtractedReport=!0),g.addNewExtractedReport=function(){g.errors=[],d.analyticExtractedReport.save(g.extractedReport).$promise.then(function(e){g.extractedReports.unshift(e.toJSON()),o.success({title:"ExtractedReport properly created",msg:g.extractedReport.name?g.extractedReport.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveExtractedReport=function(){g.errors=[],d.analyticExtractedReport.update({id:g.extractedReport.id},g.extractedReport).$promise.then(function(e){var t=_.find(g.extractedReports,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ExtractedReport properly saved!",msg:g.extractedReport.name?g.extractedReport.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteExtractedReport=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The extractedReport will be deleted.").ariaLabel("Delete ExtractedReport").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.analyticExtractedReport.delete({id:g.extractedReport.id}).$promise.then(function(){_.remove(g.extractedReports,{id:g.extractedReport.id}),o.success({title:"ExtractedReport properly deleted!",msg:(g.extractedReport.name||"extractedReport")+" has been deleted!"}),v(g.extractedReport)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticExtractedReport.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","extractedReports","extractedReport","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditExtractedReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.extractedReports=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="extractedReports",b.listOrder="",b.listOrderAsc=null,b.selectedExtractedReports=[],b.query={fields:"createdAt,updatedAt,id,name,basename,savename,type,startDate,endDate,status,output,reportId,reportType",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{extractedReport:e,extractedReports:b.extractedReports.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.downloadfile2=function(s,e){return m.analyticExtractedReport.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.savename;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticExtractedReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("extractedReport")+"?").htmlContent("<b>"+(e.name||"extractedReport")+"</b> will be deleted.").ariaLabel("delete extractedReport").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getExtractedReports=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.analyticExtractedReport.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ExtractedReports",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditExtractedReport=function(e,t){i.show({controller:"CreateOrEditExtractedReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/extractedReports/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{extractedReport:t,extractedReports:b.extractedReports.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteExtractedReport=S,b.exportSelectedExtractedReports=function(){var e=angular.copy(b.selectedExtractedReports);return b.selectedExtractedReports=[],e},b.deleteSelectedExtractedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected extractedReports?").htmlContent("<b>"+b.selectedExtractedReports.length+" selected</b> will be deleted.").ariaLabel("delete ExtractedReports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedExtractedReports.forEach(function(e){S(e)}),b.selectedExtractedReports=[]})},b.deselectExtractedReports=function(){b.selectedExtractedReports=[]},b.selectAllExtractedReports=function(){b.selectedExtractedReports=b.extractedReports.rows};var E=!0,A=1;function y(e){b.extractedReports=e||{count:0,rows:[]}}function S(e){m.analyticExtractedReport.delete({id:e.id}).$promise.then(function(){_.remove(b.extractedReports.rows,{id:e.id}),b.extractedReports.count-=1,b.extractedReports.rows.length||b.getExtractedReports(),p.success({title:_.startCase("ExtractedReport")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticExtractedReport"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticExtractedReport",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getExtractedReports())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","extractedReports","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("ExtractedReportsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="ANALYTICS.EDIT_METRIC",g.metric=angular.copy(l),g.metrics=r,g.newMetric=!1,g.metric||(g.metric={table:"report_agent"},g.title="ANALYTICS.NEW_METRIC",g.newMetric=!0),g.addNewMetric=function(){g.errors=[],d.analyticMetric.save(g.metric).$promise.then(function(e){g.metrics.unshift(e.toJSON()),o.success({title:"Metric properly created",msg:g.metric.name?g.metric.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMetric=function(){g.errors=[],d.analyticMetric.update({id:g.metric.id},g.metric).$promise.then(function(e){var t=_.find(g.metrics,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Metric properly saved!",msg:g.metric.name?g.metric.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMetric=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The metric will be deleted.").ariaLabel("Delete Metric").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.analyticMetric.delete({id:g.metric.id}).$promise.then(function(){_.remove(g.metrics,{id:g.metric.id}),o.success({title:"Metric properly deleted!",msg:(g.metric.name||"metric")+" has been deleted!"}),v(g.metric)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.analyticMetric.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticMetric.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","metrics","metric","api","Auth","license","setting","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditMetricDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.metrics=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="metrics",b.listOrder="",b.listOrderAsc=null,b.selectedMetrics=[],b.query={fields:"createdAt,updatedAt,id,name,table,metric,description",sort:"-updatedAt",limit:10,page:1},b.arraytable=_.keyBy([{option:"Agent Report",value:"'report_agent'"},{option:"Call Report",value:"'report_call'"},{option:"Contacts",value:"'cm_contacts'"},{option:"CSquare Report",value:"'report_square'"},{option:"CSquare Details Report",value:"'report_square_details'"},{option:"Dialer Hopper Processing",value:"'cm_hopper'"},{option:"Dialer Hopper Logs",value:"'cm_hopper_history'"},{option:"Dialer Hopper Final",value:"'cm_hopper_final'"},{option:"Integration Report",value:"'report_integration'"},{option:"Jscripty Sessions",value:"'report_jscripty_sessions'"},{option:"Jscripty Questions",value:"'report_jscripty_questions'"},{option:"Jscripty Answers",value:"'report_jscripty_answers'"},{option:"Lists",value:"'cm_lists'"},{option:"Member Report",value:"'report_member'"},{option:"Queue Report",value:"'report_queue'"},{option:"Users",value:"'users'"},{option:"Voice Recordings",value:"'voice_recordings'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{metric:e,metrics:b.metrics.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("metric")+"?").htmlContent("<b>"+(e.name||"metric")+"</b> will be deleted.").ariaLabel("delete metric").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMetrics=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.analyticMetric.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Metrics",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMetric=function(e,t){i.show({controller:"CreateOrEditMetricDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/metrics/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{metric:t,metrics:b.metrics.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMetric=S,b.exportSelectedMetrics=function(){var e=angular.copy(b.selectedMetrics);return b.selectedMetrics=[],e},b.deleteSelectedMetrics=function(e){var t=i.confirm().title("Are you sure want to delete the selected metrics?").htmlContent("<b>"+b.selectedMetrics.length+" selected</b> will be deleted.").ariaLabel("delete Metrics").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMetrics.forEach(function(e){S(e)}),b.selectedMetrics=[]})},b.deselectMetrics=function(){b.selectedMetrics=[]},b.selectAllMetrics=function(){b.selectedMetrics=b.metrics.rows};var E=!0,A=1;function y(e){b.metrics=e||{count:0,rows:[]}}function S(e){m.analyticMetric.delete({id:e.id}).$promise.then(function(){_.remove(b.metrics.rows,{id:e.id}),b.metrics.count-=1,b.metrics.rows.length||b.getMetrics(),p.success({title:_.startCase("Metric")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEanalyticMetric"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEanalyticMetric",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMetrics())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","metrics","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.analytics").controller("MetricsController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o){var r=this;function l(){t.hide()}r.errors=[],r.report=angular.copy(n),r.report.name+="-copy",r.treeCustomData=o,r.treeCustomConfig={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},r.treeCustomEvents={select_node:function(e,t){r.currentNode=t.node}},r.copyReport=function(){var n;r.errors=[],i.analyticCustomReport.save({name:r.report.name,description:r.report.description,table:r.report.table,conditions:r.report.conditions,joins:r.report.joins,parent:r.currentNode.id}).$promise.then(function(e){n=e,a.success({title:"Report properly copied!",msg:r.report.name?r.report.name+" has been copied!":""});var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=r.report.id,i.analyticFieldReport.get(t).$promise}).then(function(e){var e=_.map(e.rows,function(e){return _.extend({},e,{CustomReportId:n.id})});return i.analyticFieldReport.bulkCreate(e).$promise}).then(function(){a.success({title:"Fields copied!",msg:"Fields has been copied!"}),l()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:COPYREPORT",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","treeCustomData"],angular.module("app.analytics").controller("CopyReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;function m(){t.hide()}c.errors=[],c.joinTables=[],c.title="ANALYTICS.EDIT_REPORT",c.crudPermissions=d,c.report=angular.copy(i),c.reports=a,c.newReport=!1,c.tables=l.getMap(),c.joinTypes=[{key:"join",value:"Join"},{key:"left_join",value:"Left Join"},{key:"right_join",value:"Right Join"},{key:"cross_join",value:"Cross Join"}],c.report||(c.report={name:"",table:"report_agent",description:"",parent:r.id},c.title="ANALYTICS.NEW_REPORT",c.newReport=!0),c.addNewReport=function(){c.errors=[],c.report.joins=_.map(c.joinTables||[],function(e){return{parentKey:e.parentKey,foreignTable:e.name,foreignKey:e.foreignKey,type:e.type.toLowerCase()}}),c.report.joins=JSON.stringify(c.report.joins),s[o].save(c.report).$promise.then(function(e){c.reports.unshift(e),n.success({title:"Report properly created",msg:c.report.name?c.report.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.save"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveReport=function(){c.errors=[],s[o].update({id:c.report.id},c.report).$promise.then(function(e){var t=_.find(c.reports,{id:e.id});t&&_.merge(t,e),n.success({title:"Report properly saved!",msg:c.report.name?c.report.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticReport.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteReport=function(){c.errors=[];var e=t.confirm().title("Are you sure?").content("The report will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){s[o].delete({id:c.report.id}).$promise.then(function(){_.remove(c.reports,{id:c.report.id}),n.success({title:"Report properly deleted!",msg:c.report.name?c.report.name+" has been deleted!":""}),m()}).catch(function(e){c.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReport.delete"}]})},function(){})},c.closeDialog=m,c.selectedTableChange=function(e){e&&(delete c.selectedItem,c.joinTables.push(e))},c.removeJoin=function(e){c.joinTables.splice(e,1)},c.getFields=function(t,n,e){var a=_.find(c.tables,{name:e});a&&a.api&&s[a.api].describe().$promise.then(function(e){t[n]=_.difference(_.keys(e),["$promise","$resolved"])}).catch(function(e){console.error(e)})}}e.$inject=["$location","$mdDialog","toasty","reports","report","api","apiName","currentNode","describeTable","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportDialogController",e)}(),function(){"use strict";function e(i,s,o,e){var r=this;r.report={},r.conditions=e.getConditions,r.init=function(e,t){r.report=e,r.report.condition=angular.fromJson(e.conditions)||{group:{operator:"AND",rules:[]}},r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1};for(var n=0;n<r.report.condition.group.rules.length;n++)if(r.report.condition.group.rules[n].field){var a=r.report.condition.group.rules[n].field.split(".");1===a.length&&(r.report.condition.group.rules[n].field=r.report.table+"."+r.report.condition.group.rules[n].field)}s.getColumns(r.report.table).then(function(e){r.columns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt"])}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.addCondition=function(e){e.unshift({condition:"=",field:"",value:""})},r.addGroup=function(e){e.push({group:{operator:"AND",rules:[]}})},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the item?").htmlContent("The item will be deleted.").ariaLabel("delete item").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){e.splice(t,1)},function(){console.log("CANCEL")})},r.isValueByCondition=function(e){return!_.includes(["IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"],e)}}e.$inject=["$mdDialog","describeTable","toasty","sqlUtil"],angular.module("app.analytics").controller("ReportConditionsController",e)}(),function(){"use strict";function e(t){var a={cm_contacts:"cmContact",cm_hopper:"cmHopper",cm_hopper_final:"cmHopperFinal",cm_hopper_history:"cmHopperHistory",cm_lists:"cmList",chat_websites:"chatWebsite",chat_queues:"chatQueue",chat_interactions:"chatInteraction",chat_messages:"chatMessage",chat_offline_messages:"chatOfflineMessage",report_chat_queue:"chatQueueReport",report_chat_transfer:"chatTransferReport",mail_accounts:"mailAccount",mail_queues:"mailQueue",mail_interactions:"mailInteraction",mail_messages:"mailMessage",report_mail_queue:"mailQueueReport",report_mail_transfer:"mailTransferReport",openchannel_accounts:"openchannelAccount",openchannel_queues:"openchannelQueue",openchannel_interactions:"openchannelInteraction",openchannel_messages:"openchannelMessage",report_openchannel_queue:"openchannelQueueReport",report_openchannel_transfer:"openchannelTransferReport",sms_accounts:"smsAccount",sms_queues:"smsQueue",sms_interactions:"smsInteraction",sms_messages:"smsMessage",report_sms_queue:"smsQueueReport",report_sms_transfer:"smsTransferReport",fax_accounts:"faxAccount",fax_queues:"faxQueue",fax_interactions:"faxInteraction",fax_messages:"faxMessage",report_fax_transfer:"faxTransferReport",report_fax_queue:"faxQueueReport",report_call:"voiceCallReport",report_agent:"voiceAgentReport",report_square:"squareReport",report_member:"memberReport",report_queue:"voiceQueueReport",report_square_details:"squareReportDetail",report_dial:"voiceDialReport",report_jscripty_sessions:"jscriptySessionReport",report_jscripty_questions:"jscriptyQuestionReport",report_jscripty_answers:"jscriptyAnswerReport",users:"user",voice_recordings:"voiceRecording",cdr:"cdr"};return{getMap:function(){var n=[];return _.forIn(a,function(e,t){n.push({name:t,api:e})}),n},getColumns:function(e){return t[a[e]].describe().$promise}}}e.$inject=["api"],angular.module("app.analytics").factory("describeTable",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;(u.errors=[],u.title="Edit Report Field",u.report=i,u.reportField=angular.copy(o),u.reportFields=s,u.metrics=r,u.columns=l,u.sqlUtil=d,u.newReportField=!1,u.crudPermissions=m,u.reportField)?(u.reportField.type=u.reportField.custom?"custom":u.reportField.MetricId?"metric":"column",u.reportField.field&&!u.reportField.custom&&_.isNil(u.reportField.MetricId)&&1===u.reportField.field.split(".").length&&(u.reportField.field=u.report.table+"."+u.reportField.field)):(u.reportField={type:"column",function:null,format:null,groupBy:!1,orderBy:null},u.title="New Report Field",u.newReportField=!0);function p(){n.hide()}u.addNewReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,u.reportField.CustomReportId=u.report.id,c.analyticFieldReport.save(u.reportField).$promise.then(function(e){u.reportFields.push(e),a.success({title:"Report field properly created",msg:u.reportField.field?u.reportField.field+" has been created!":u.reportField.type+" has been created!"}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.save"}]})},u.saveReportField=function(){u.errors=[],u.reportField.custom="custom"===u.reportField.type,u.reportField.MetricId="metric"===u.reportField.type?u.reportField.MetricId:null,c.analyticFieldReport.update({id:u.reportField.id},u.reportField).$promise.then(function(e){var t=_.find(u.reportFields,{id:e.id});t&&_.merge(t,e),a.success({title:"Report Field properly saved!",msg:u.reportField.field?u.reportField.field+" has been saved!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticFieldReport.update"}]})},u.deleteReportField=function(e){u.errors=[];var t=n.confirm().title("Are you sure?").content("The field will be deleted.").ariaLabel("Delete Report").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){c.analyticFieldReport.delete({id:u.reportField.id}).$promise.then(function(){_.remove(u.reportFields,{id:u.reportField.id}),a.success({title:"Report Field properly deleted!",msg:u.reportField.field?u.reportField.field+" has been deleted!":""}),p()}).catch(function(e){u.errors=e.data.errors||[{message:e.toString(),type:"api.analyticReportField.delete"}]})},function(){})},u.closeDialog=p}e.$inject=["$scope","$location","$mdDialog","toasty","report","reportFields","reportField","metrics","columns","sqlUtil","api","crudPermissions"],angular.module("app.analytics").controller("CreateOrEditReportFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.report={},c.reportFields={count:0,rows:[]},c.functions=_.keyBy(l.getFunctions,"value"),c.formats=_.keyBy(l.getFormats,"value"),c.groupBy=_.keyBy(l.getGroupBy,"value"),c.orderBy=_.keyBy(l.getOrderBy,"value"),c.selectedReportFields=[],c.query={fields:"createdAt,updatedAt,id,field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0},c.sortableTable={animation:100,onSort:function(e){o.analyticFieldReport.addFields({id:c.report.id},e.models).$promise.then(function(e){c.reportFields.rows=e}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDFIELDS"})})}},c.init=function(e,t){c.report=e,c.query.CustomReportId=c.report.id,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,r.getColumns(c.report.table).then(function(e){return c.columns=_.difference(_.keys(e),["$promise","$resolved"]),o.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise}).then(function(e){c.metrics=e.rows}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.getReportFields()},c.deleteConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>"+e.field+"</b> will be deleted.").ariaLabel("delete field").targetEvent(t).ok("OK").cancel("CANCEL");a.show(n).then(function(){p(e)},function(){console.log("CANCEL")})},c.success=u,c.getReportFields=function(){c.promise=o.analyticFieldReport.get(c.query,u).$promise},c.createOrEditReportField=function(e,t){a.show({controller:"CreateOrEditReportFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/edit/field/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:c.report,reportField:t,reportFields:c.reportFields.rows,metrics:c.metrics,columns:c.columns,setting:null,crudPermissions:c.crudPermissions}})},c.deleteReportField=p,c.deleteSelectedReportFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+c.selectedReportFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){c.selectedReportFields.forEach(function(e){p(e)}),c.selectedReportFields=[]})},c.getMetricName=function(e){var t=_.find(c.metrics,{id:e});return t?t.name:d.instant("ANALYTICS.NO_METRIC_FOUND")},c.getMetricValue=function(e){var t=_.find(c.metrics,{id:e});return t?t.metric:d.instant("ANALYTICS.NO_METRIC_FOUND")};var m=!0;function u(e){c.reportFields=e||{count:0,rows:[]}}function p(e){o.analyticFieldReport.delete({id:e.id}).$promise.then(function(){c.selectedReportFields=[],_.remove(c.reportFields.rows,{id:e.id}),c.reportFields.count-=1,c.reportFields.rows.length||c.getReportFields(),s.success({title:"Field deleted!",msg:e.field?e.field+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}t.$watch("vm_rf.query.filter",function(e,t){m?n(function(){m=!1}):c.getReportFields()})}e.$inject=["$cookies","$scope","$timeout","$mdDialog","$document","toasty","api","describeTable","sqlUtil","$translate"],angular.module("app.analytics").controller("ReportFieldsController",e)}(),function(){"use strict";angular.module("app.analytics").factory("sqlUtil",function(){return{getFunctions:[{value:"SUM",option:function(e){return"SUM ("+e+")"}},{value:"COUNT",option:function(e){return"COUNT ("+e+")"}},{value:"COUNT DISTINCT",option:function(e){return"COUNT (DISTINCT "+e+")"}},{value:"MAX",option:function(e){return"MAX ("+e+")"}},{value:"MIN",option:function(e){return"MIN ("+e+")"}},{value:"AVG",option:function(e){return"AVG ("+e+")"}},{value:"GROUP_CONCAT",option:function(e){return"GROUP_CONCAT ("+e+")"}},{value:"GROUP_CONCAT ASC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" ASC)"}},{value:"GROUP_CONCAT DESC",option:function(e){return"GROUP_CONCAT ("+e+" ORDER BY "+e+" DESC)"}}],getFormats:[{value:"SEC_TO_TIME",option:function(e){return"SEC_TO_TIME ("+e+")"}},{value:"DATE",option:function(e){return"DATE ("+e+")"}},{value:"HOUR",option:function(e){return"HOUR ("+e+")"}},{value:"ROUND",option:function(e){return"ROUND ("+e+")"}},{value:"UNIX_TIMESTAMP",option:function(e){return"UNIX_TIMESTAMP ("+e+")"}}],getGroupBy:[{value:!1,option:function(){return"No"}},{value:!0,option:function(e){return"GROUP BY "+e}}],getOrderBy:[{value:"ASC",option:function(e){return"ORDER BY "+e+" ASC"}},{value:"DESC",option:function(e){return"ORDER BY "+e+" DESC"}}],getConditions:["=","!=","<","<=",">",">=","LIKE","NOT LIKE","IS NULL","IS NOT NULL","IS EMPTY","IS NOT EMPTY"]}})}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(e){return _.isArray(e)}o.report=a||{},o.userProfileSection=s&&1==s.count?s.rows[0]:null,o.crudPermissions=i.parseCrudPermissions(o.userProfileSection?o.userProfileSection.crudPermissions:null),o.selectedTab=e.params.tab||0,o.gotoReports=function(){e.go("app.analytics.reports")},o.saveReport=function(){o.report.conditions=angular.toJson(o.report.condition),n.analyticCustomReport.update({id:o.report.id},_.omit(o.report,"joins")).$promise.then(function(){t.success({title:"Report updated!",msg:o.report.name?o.report.name+" has been updated!":""})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETreport",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.previewReport=function(){o.columns=[],o.rows=[],o.error=!1,n.analyticFieldReport.get({fields:"field,alias",nolimit:!0,CustomReportId:o.report.id}).$promise.then(function(e){return o.columns=e?e.rows:[],n.analyticCustomReport.preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})},o.queryReport=function(){return o.queryResult="Loading...",n.analyticCustomReport.query({id:o.report.id}).$promise.then(function(e){o.queryResult=e.sql}).catch(function(e){o.queryResult="",console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},t.error(o.error)})},o.mapArray=function(e,t){if(r(e))return _.map(e,t).join(",");return""},o.isArray=r,o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$state","toasty","api","report","Auth","userProfileSection"],angular.module("app.analytics").controller("ReportController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.errors=[],o.report=angular.copy(a),o.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t},o.closeDialog=function(){t.hide()},function(){o.columns=[],o.rows=[],o.error=!1;var e={fields:"field,alias",nolimit:!0};e["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=o.report.id,o.promise=i.analyticFieldReport.get(e).$promise.then(function(e){return o.columns=e?e.rows:[],i[s].preview({id:o.report.id}).$promise}).then(function(e){o.rows=e}).catch(function(e){console.log(e),o.error={title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:analyticFieldReport",msg:e.data?e.data.message:e.toString(),sql:e.data&&e.data.parent?e.data.parent.sql:"NO QUERY"},n.error(o.error)})}()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName"],angular.module("app.analytics").controller("PreviewReportDialogController",e)}(),function(){"use strict";function e(e,n,a,i,s,o,t,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.reports={count:0,rows:[]},p.userProfile=r,p.userProfileSection=l&&1==l.count?l.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.selectedReports=[],p.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},p.apiName=null,p.currentPath="",p.customTree=!0,p.editstate=function(e,t){s.go("app.analytics.reports.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.copydialog=function(e,t){i.show({controller:"CopyReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/copy/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,treeCustomData:p.treeCustomInstance.jstree(!0).get_json("#")}}).finally(function(){})},p.previewdialog=function(e,t){i.show({controller:"PreviewReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/preview/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName}})},p.rundialog=function(e,t){i.show({controller:"RunReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/dialog.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{report:e,apiName:p.apiName,currentPath:p.currentPath}})},p.downloadfile=function(a,e){var i;d.analyticMetric.get({fields:"id,name,metric,table",nolimit:!0}).$promise.then(function(e){i=_.keyBy(e.rows,"id");var t={fields:"field,alias,function,format,groupBy,orderBy,custom,MetricId",nolimit:!0};return t["analyticCustomReport"===p.apiName?"CustomReportId":"DefaultReportId"]=a.id,d.analyticFieldReport.get(t).$promise}).then(function(e){for(var t=0;t<e.rows.length;t+=1)e.rows[t].MetricId&&(e.rows[t].field=i[e.rows[t].MetricId].metric,e.rows[t].custom=!0),delete e.rows[t].MetricId;var n=o.document.createElement("a");n.href="data:text/json;charset=utf-8,"+o.encodeURIComponent(angular.toJson({name:a.name,description:a.description,table:a.table,conditions:a.conditions,joins:a.joins,fields:e.rows})),n.download=a.name+".json",n.target="_self",n.click(),m.success({title:"Report downloaded!",msg:a.name?a.name+" has been downloaded!":""})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DOWNLOADJSON",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the report?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete report").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){b(e)},function(){console.log("CANCEL")})},p.success=h,p.getReports=f,p.createOrEditReport=function(e,t){i.show({controller:"CreateOrEditReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{report:t,reports:p.reports.rows,apiName:p.apiName,currentNode:p.currentNode,setting:null,crudPermissions:p.crudPermissions}})},p.importReport=function(e,t,n){if("application/json"===e.file.type){var a=new FileReader;a.onload=function(e){console.log(e.target.result);try{var n=atob(e.target.result.split(",")[1]);n=angular.fromJson(n),d.analyticCustomReport.save({name:n.name,description:n.description,table:n.table,conditions:n.conditions,joins:n.joins,parent:p.currentNode.id}).$promise.then(function(t){p.reports.rows.unshift(t),m.success({title:"Report saved!",msg:t.name?t.name+" has been saved!":""});var e=_.map(n.fields,function(e){return _.extend({},e,{CustomReportId:t.id})});return d.analyticFieldReport.bulkCreate(e).$promise}).then(function(e){m.success({title:"Fields saved!",msg:"Fields has been saved!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETanalyticReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}catch(e){console.error(e),m.error({title:"Decode File Error",msg:e.toString()})}},a.readAsDataURL(e.file)}else m.error({title:"Format Error",msg:"Please use only json files"})},p.deleteReport=b,p.exportSelectedReports=function(){var e=angular.copy(p.selectedReports);return p.selectedReports=[],e},p.deleteSelectedReports=function(e){var t=i.confirm().title("Are you sure want to delete the selected reports?").htmlContent("<b>"+p.selectedReports.length+" selected</b> will be deleted.").ariaLabel("delete Reports").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){p.selectedReports.forEach(function(e){b(e)}),p.selectedReports=[]})},p.deselectReports=function(){p.selectedReports=[]},p.selectAllReports=function(){p.selectedReports=p.reports.rows},p.treeDefaultData=c.rows[0]?angular.fromJson(c.rows[0].tree):[],p.treeCustomData=c.rows[1]?angular.fromJson(c.rows[1].tree):[],p.treeDefaultConfig=S(!1),p.treeCustomConfig=S(!0),p.treeDefaultEvents=T(!1),p.treeCustomEvents=T(!0);var g=!0,v=1;function h(e){p.reports=e||{count:0,rows:[]}}function f(){if(p.query.offset=(p.query.page-1)*p.query.limit,p.apiName)if("admin"===p.currentUser.role||p.userProfileSection.autoAssociation)p.promise=d[p.apiName].get(p.query,h).$promise;else{var a=[];p.promise=d[p.apiName].get(p.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:p.userProfileSection.id,type:"analyticDefaultReport"===p.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),h({count:n.length,rows:n})}return h(null)}):h(null)})}}function b(e){p.apiName&&d[p.apiName].delete({id:e.id}).$promise.then(function(){_.remove(p.reports.rows,{id:e.id}),p.reports.count-=1,p.reports.rows.length||p.getReports(),m.success({title:"Report deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.analyticreport.delete"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.analyticreport.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function E(e,t){p.treeDefaultInstance.jstree(!0).deselect_all(),p.treeDefaultInstance.jstree(!0).close_all(),p.currentNode=t.node,p.currentNode.custom=!0,p.currentPath=p.treeCustomInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticCustomReport",p.query.parent=t.node.id,f()}function A(e,t){p.treeCustomInstance.jstree(!0).deselect_all(),p.treeCustomInstance.jstree(!0).close_all(),p.currentNode=t.node,p.currentNode.custom=!1,p.currentPath=p.treeDefaultInstance.jstree(!0).get_path(p.currentNode).join("/ "),p.apiName="analyticDefaultReport",p.query.parent=t.node.id,f()}function y(e,t){var n=angular.toJson(p.treeCustomInstance.jstree(!0).get_json("#"));d.analyticTreeReport.update({id:2,tree:n}).$promise.then(function(){c.rows[1]&&(c.rows[1].tree=n),m.success({title:"Node Updated",msg:t.node.text?t.node.text+" has been updated!":"Node has been updated!"})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEanalyticTreeReport",msg:e.data?JSON.stringify(e.data):e.toString()})})}function S(e){return{core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:e?["contextmenu","dnd","search","state","wholerow"]:["search","state","wholerow"],contextmenu:{items:function(n){var e={};return p.crudPermissions.canEdit&&_.assign(e,{create:{label:t.instant("ANALYTICS.CREATE"),action:function(){n=p.treeCustomInstance.jstree(!0).create_node(n),p.treeCustomInstance.jstree(!0).edit(n)}},rename:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.RENAME"),action:function(){p.treeCustomInstance.jstree(!0).edit(n)}}}),p.crudPermissions.canDelete&&_.assign(e,{remove:{_disabled:"#"===n.parent,label:t.instant("ANALYTICS.REMOVE"),action:function(){var e=i.confirm().title("Are you sure want to delete the node?").htmlContent("<b>"+(n.text?n.text:"Node")+"</b> and its subnode will be deleted.").ariaLabel("delete node").ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t=p.treeCustomInstance.jstree(!0).get_parent(n);t=p.treeCustomInstance.jstree(!0).get_node(t),p.treeCustomInstance.jstree(!0).delete_node(n),e=[n.id].concat(n.children_d||[]),d.analyticCustomReport.get({parent:e.join(","),fields:"id,name"}).$promise.then(function(e){e&&e.rows&&e.rows.forEach(function(e){b(e)})}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEreportsByParents",msg:e.data?JSON.stringify(e.data):e.toString()})}),p.treeCustomInstance.jstree(!0).select_node(t)})}}}),e}}}}function T(e){return e?{create_node:y,rename_node:y,move_node:y,delete_node:y,select_node:E}:{select_node:A}}e.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=v),p.getReports())}),e.$watch("vm.search",function(e,t){p.treeDefaultInstance&&p.treeDefaultInstance.jstree(!0).search(e),p.treeCustomInstance&&p.treeCustomInstance.jstree(!0).search(e)})}e.$inject=["$scope","$timeout","$document","$mdDialog","$state","$window","$translate","userProfile","userProfileSection","api","treeReports","toasty","Auth"],angular.module("app.analytics").controller("ReportsController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r){var l=this;function d(){l.export={id:l.report.id,name:l.report.name,startDate:new Date(moment().startOf("day")),endDate:new Date(moment().endOf("day")),output:"xlsx",fullPath:r?r+"/"+l.report.name:l.report.name}}function c(){n.hide()}l.errors=[],l.report=angular.copy(t),l.export={},l.runReport=function(t){l.errors=[],l.exportDate=_.assign({},l.export,{startDate:moment(l.export.startDate).format("YYYY-MM-DD HH:mm:ss"),endDate:moment(l.export.endDate).format("YYYY-MM-DD HH:mm:ss")}),i[s].run(l.exportDate).$promise.then(function(e){"web"===l.export.output?n.show({controller:"WebReportDialogController",controllerAs:"vm",templateUrl:"app/main/apps/analytics/views/reports/run/web/dialog.html",parent:angular.element(o.body),targetEvent:t,skipHide:!0,locals:{apiName:s,exportDate:l.exportDate,results:e},resolve:{columns:["apiResolver",function(e){var t={fields:"field,alias",nolimit:!0};return t["analyticCustomReport"===s?"CustomReportId":"DefaultReportId"]=l.report.id,e.resolve("analyticFieldReport@get",t)}]}}):(a.success({title:"Report properly run!",msg:l.report.name?l.report.name+" has been run!":""}),c())}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DESCRIBE",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.closeDialog=c,(l.refreshDate=d)()}e.$inject=["$location","$mdDialog","toasty","report","api","apiName","$document","currentPath"],angular.module("app.analytics").controller("RunReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o){var r=this;function l(e){r.results=e||{count:0,rows:[]}}r.errors=[],r.columns=a?a.rows:[],r.results=i||{rows:[],count:0},r.query={limit:10,page:1},r.closeDialog=function(){e.hide()},r.getResults=function(){o.offset=(r.query.page-1)*r.query.limit,o.limit=r.query.limit,r.promise=n[s].run(o,l).$promise},r.valueReplacer=function(e,t){moment(t,"YYYY-MM-DDTHH:mm:ssZ",!0).isValid()&&(t=moment(t,"").format("YYYY-MM-DD HH:mm:ss"));return t}}e.$inject=["$mdDialog","toasty","api","columns","results","apiName","exportDate"],angular.module("app.analytics").controller("WebReportDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_ODBC",g.odbc=angular.copy(l),g.odbcs=r,g.newOdbc=!1,g.odbc||(g.odbc={},g.title="CALLYSQUARE.NEW_ODBC",g.newOdbc=!0),g.addNewOdbc=function(){g.errors=[],d.squareOdbc.save(g.odbc).$promise.then(function(e){g.odbcs.unshift(e.toJSON()),o.success({title:"Odbc properly created",msg:g.odbc.name?g.odbc.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOdbc=function(){g.errors=[],d.squareOdbc.update({id:g.odbc.id},g.odbc).$promise.then(function(e){var t=_.find(g.odbcs,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Odbc properly saved!",msg:g.odbc.name?g.odbc.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOdbc=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The odbc will be deleted.").ariaLabel("Delete Odbc").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.squareOdbc.delete({id:g.odbc.id}).$promise.then(function(){_.remove(g.odbcs,{id:g.odbc.id}),o.success({title:"Odbc properly deleted!",msg:(g.odbc.name||"odbc")+" has been deleted!"}),v(g.odbc)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareOdbc.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareOdbc.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","odbcs","odbc","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditOdbcDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.odbcs=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="odbcs",b.listOrder="",b.listOrderAsc=null,b.selectedODBC=[],b.query={fields:"createdAt,updatedAt,id,name,dsn,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{odbc:e,odbcs:b.odbcs.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.testtestOdbc=function(e,t){return m.squareOdbc.test({id:e.id}).$promise.then(function(){p.success({title:"Square ODBC properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Square ODBC properly tested",msg:e.data?JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("odbc")+"?").htmlContent("<b>"+(e.name||"odbc")+"</b> will be deleted.").ariaLabel("delete odbc").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getODBC=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.squareOdbc.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ODBC",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOdbc=function(e,t){i.show({controller:"CreateOrEditOdbcDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/odbcs/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{odbc:t,odbcs:b.odbcs.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOdbc=S,b.exportSelectedODBC=function(){var e=angular.copy(b.selectedODBC);return b.selectedODBC=[],e},b.deleteSelectedODBC=function(e){var t=i.confirm().title("Are you sure want to delete the selected odbcs?").htmlContent("<b>"+b.selectedODBC.length+" selected</b> will be deleted.").ariaLabel("delete Odbcs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedODBC.forEach(function(e){S(e)}),b.selectedODBC=[]})},b.deselectODBC=function(){b.selectedODBC=[]},b.selectAllODBC=function(){b.selectedODBC=b.odbcs.rows};var E=!0,A=1;function y(e){b.odbcs=e||{count:0,rows:[]}}function S(e){m.squareOdbc.delete({id:e.id}).$promise.then(function(){_.remove(b.odbcs.rows,{id:e.id}),b.odbcs.count-=1,b.odbcs.rows.length||b.getODBC(),p.success({title:_.startCase("Odbc")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareOdbc"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareOdbc",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getODBC())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","odbcs","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("OdbcsController",e)}(),function(){"use strict";function e(t,n,a,i,s,e,o,r,l,d){var c=this;function m(e){t.hide(e)}c.errors=[],c.title="CALLYSQUARE.EDIT_PROJECT",c.crudPermissions=d,c.project=angular.copy(o),c.newWindow=!0,c.projects=e,c.newProject=!1,c.openFromEditor=l,c.project||(c.project={name:"",description:""},c.title="CALLYSQUARE.NEW_PROJECT",c.newProject=!0),c.addNewProject=function(){c.errors=[],r.squareProject.save(c.project).$promise.then(function(e){return r.user.addSquareProjects({id:i.getCurrentUser().id,ids:[e.id]}).$promise,e}).then(function(e){c.projects.unshift(e),s.success({title:"Project properly created",msg:c.project.name?c.project.name+" has been created!":""}),m(e),c.openFromEditor&&(c.newWindow?n.open("/callysquare/projects/"+e.id,"_blank"):a.go("app.callysquare.projects.edit",{id:e.id}))}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveProject=function(){c.errors=[],r.squareProject.update({id:c.project.id},c.project).$promise.then(function(e){var t=_.find(c.projects,{id:e.id});t&&_.merge(t,e),s.success({title:"Project properly saved!",msg:c.project.name?c.project.name+" has been saved!":""}),m(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteProject=function(){c.errors=[];var e=t.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(event);t.show(e).then(function(){r.squareProject.delete({id:c.project.id}).$promise.then(function(){return r.squareProject.getUsers({id:c.project.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(r.user.removeSquareProjects({id:i.getCurrentUser().id,ids:[c.project.id]}).$promise);return $q.all(t)}).then(function(){_.remove(c.projects,{id:c.project.id}),s.success({title:"Project properly deleted!",msg:c.project.name?c.project.name+" has been deleted!":""}),m(c.project)}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.delete"}]})},function(){})},c.closeDialog=m}e.$inject=["$mdDialog","$window","$state","Auth","toasty","projects","project","api","openFromEditor","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareProjectDialogController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E,A,y,S,T,I,C,w,O,x,R){var N=this,D={playback:["file_id"],answer:["timeout"],menu:["file_id","digit","response","retry"],getdigits:["file_id","variable_id","mindigit","maxdigit","retry"],getsecretdigits:["file_id","variable_id","mindigit","maxdigit","hiddendigitsnum","retry"],vswitch:["variable_id"],database:["odbc_id","query"],ext_dial:["trunk_name","phone","timeout"],set:["variable_id"],math:["variable_id"],gotoc:["context","extension","priority"],system:["command"],agi:["command"],gotoif:["condition"],saydigits:["digits"],saynumber:["number"],sayphonetic:["text"],record:["file","timeout"],goal:["goalname"],dial:["sip_id","timeout"],queue:["queue_id","timeout"],callback:["list_id","name","phone","delay"],gotoiftime:["interval_id"],voicemail:["mailbox"],subproject:["project_id"],sendSMS:["sms_account_id","to","sms_text"],sendMail:["account_id","to"],sendFax:["account_id","to","attachment_path"],tts:["text"],ispeechtts:["text","key","speed"],ispeechasr:["key","timeout"],custom_app:["application"],googleasr:["key","timeout"],awspolly:["aws_access_key_id","aws_secret_access_key","text","aws_text_type"],lumenvoxtts:["text"],sestektts:["text"],lumenvoxasr:["grammar"],sestekasr:["grammar"],tildeasr:["appid","appsecret","uri"],login:["findBy"],pause:["findBy","pause_id"],unpause:["findBy"],logout:["findBy"],dialogflow:["key","text","dialogflow_language"],awslex:["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],sesteknda:["text","ndauth_url","username","password","ndassistant_url"]},P={queue:["file_id"],database:["variable_id"],pause:["pause_id"]},L={sendMail:["to","cc","bcc"],voicemail:["mailbox"]};function k(e,t,n,a){return _.map(e,function(e){return{value:e[t],option:e[n],group:a?e[a]:void 0,canSelect:void 0===e.canSelect||e.canSelect}})}function M(){var e=_.find(N.attributes,{name:"sip_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(l,{id:Number(e.value)}))return a.user.get({id:_.find(N.attributes,{name:"sip_id"}).value,fields:"id,fullname,role"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,l.push(t),N.values.sip_id=k(l,"id","fullname","role")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_USER",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.sip_id=k(l,"id","fullname","role")}}function U(){var e=_.find(N.attributes,{name:"list_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(E,{id:Number(e.value)}))return a.cmList.get({id:_.find(N.attributes,{name:"list_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,E.push(t),N.values.list_id=k(E,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_LIST",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.list_id=k(E,"id","name")}}function F(n){var e=_.find(N.attributes,{name:n});if(!_.some(N.attributes,{id:e.value})){if(!_.some(d,{id:Number(e.value)}))return a.trunk.get({id:_.find(N.attributes,{name:n}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,d.push(t),N.values[n]=k(d,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TRUNK",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values[n]=k(d,"id","name")}}function $(){var e=_.find(N.attributes,{name:"queue_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(c,{id:Number(e.value)}))return a.voiceQueue.get({id:_.find(N.attributes,{name:"queue_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,c.push(t),N.values.queue_id=k(c,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_QUEUE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.queue_id=k(c,"id","name")}}function q(){var e=_.find(N.attributes,{name:"file_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(m,{id:Number(e.value)}))return a.sound.get({id:_.find(N.attributes,{name:"file_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,m.push(t),N.values.file_id=k(m,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SOUND",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.file_id=k(m,"id","name")}}function G(){var e=_.find(N.attributes,{name:"variable_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(u,{id:Number(e.value)}))return a.variable.get({id:_.find(N.attributes,{name:"variable_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,u.push(t),N.values.variable_id=k(u,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_VARIABLE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.variable_id=k(u,"id","name")}}function H(){var e=_.find(N.attributes,{name:"odbc_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(p,{id:Number(e.value)}))return a.squareOdbc.get({id:_.find(N.attributes,{name:"odbc_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,p.push(t),N.values.odbc_id=k(p,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_ODBC",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.odbc_id=k(p,"id","name")}}function V(){var e=_.find(N.attributes,{name:"project_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(g,{id:Number(e.value)}))return a.squareProject.get({id:_.find(N.attributes,{name:"project_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,g.push(t),N.values.project_id=k(g,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PROJECT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.project_id=k(g,"id","name")}}function Q(){var e=_.find(N.attributes,{name:"context"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(v,{id:Number(e.value)}))return a.voiceContext.get({id:_.find(N.attributes,{name:"context"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,v.push(t),N.values.context=k(v,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_CONTEXT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.context=k(v,"id","name")}}function B(){var e=_.find(N.attributes,{name:"interval_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(h,{id:Number(e.value)}))return a.interval.get({id:_.find(N.attributes,{name:"interval_id"}).value,fields:"id,name,IntervalId"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,h.push(t),N.values.interval_id=k(h,"id","name","IntervalId")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_INTERVAL",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.interval_id=k(h,"id","name","IntervalId")}}function W(){var e=_.find(N.attributes,{name:"account_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(f,{id:Number(e.value)}))return a.mailAccount.get({id:_.find(N.attributes,{name:"account_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,f.push(t),N.values.account_id=k(f,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_MAIL_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.account_id=k(f,"id","name")}}function Y(){var e=_.find(N.attributes,{name:"sms_account_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(I,{id:Number(e.value)}))return a.smsAccount.get({id:_.find(N.attributes,{name:"sms_account_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,I.push(t),N.values.sms_account_id=k(I,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_SMS_ACCOUNT",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.sms_account_id=k(I,"id","name")}}function j(){var e=_.find(N.attributes,{name:"template_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(b,{id:Number(e.value)}))return a.template.get({id:_.find(N.attributes,{name:"template_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,b.push(t),N.values.template_id=k(b,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_TEMPLATE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.template_id=k(b,"id","name")}}function z(){var e=_.find(N.attributes,{name:"pause_id"});if(!_.some(N.attributes,{id:e.value})){if(!_.some(C,{id:Number(e.value)}))return a.pause.get({id:_.find(N.attributes,{name:"pause_id"}).value,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,C.push(t),N.values.pause_id=k(C,"id","name")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_PAUSE",msg:e.data?JSON.stringify(e.data.message):e.toString()})});N.values.pause_id=k(C,"id","name")}}N.cellName=A.tagName,N.attributes=_.map(A.attributes,function(e){return{name:e.name,value:e.value,defaultValue:P[N.cellName]&&_.includes(P[N.cellName],e.name),required:D[N.cellName]&&_.includes(D[N.cellName],e.name),help:L[N.cellName]&&_.includes(L[N.cellName],e.name)}}),N.values={answer:[{value:"yes",option:"Yes"},{value:"no",option:"No"}],ndagenerate_audio:[{value:1,option:"Yes"},{value:0,option:"No"}],ndaactivity_type:[{value:"message",option:"Message"},{value:"conversationUpdate",option:"Conversation Update"},{value:"contactRelationUpdate",option:"Contact Relation Update"},{value:"endOfConversation",option:"End of Conversation"}],hiddendigitspos:[{value:"first",option:"First"},{value:"last",option:"Last"}],recordingFormat:[{value:"wav",option:"Wav"},{value:"gsm",option:"Gsm"}],intkey:[{value:"#",option:"#"},{value:"*",option:"*"}],beep:[{value:"BEEP",option:"Yes"},{value:"NOBEEP",option:"No"}],model:e,ispeech_asr_language:n,ispeech_tts_language:o,google_tts_language:r,google_asr_language:s,aws_polly_region:T,aws_polly_voice:S,aws_text_type:[{value:"text",option:"Text"},{value:"ssml",option:"SSML"}],callback_priority:[{option:"Highest",value:4},{option:"High",value:3},{option:"Medium",value:2},{option:"Low",value:1},{option:"Lowest",value:0}],findBy:[{value:"internal",option:"Internal"},{value:"phone",option:"Phone"},{value:"mobile",option:"Mobile"}],dialogflow_language:w,aws_lex_region:O},N.crudPermissions=R,N.onInit=function(){x.hasRole("admin")?(e={sip_id:k(l,"id","fullname","role"),trunk_name:k(d,"name","name"),trunk_id:k(d,"id","name"),queue_id:k(c,"id","name"),file_id:k(m,"id","name"),variable_id:k(u,"id","name"),odbc_id:k(p,"id","name"),project_id:k(g,"id","name"),context:k(v,"id","name"),interval_id:(n=h,a="id",i="name",s="IntervalId",o=_.filter(n,function(e){return null===e[s]}),r=[],_.forEach(o,function(t){r.push({value:t[a],option:t[i]});var e=_.filter(n,function(e){return e[s]===t.id});_.forEach(e,function(e){r.push({value:e[a],option:" - "+e[i]})})}),r),account_id:k(f,"id","name"),template_id:k(b,"id","name"),list_id:k(E,"id","name"),sms_account_id:k(I,"id","name"),pause_id:k(C,"id","name")},t=_.merge(N.values,e),N.values=t):function(){for(var e=["sip_id","trunk_name","trunk_id","queue_id","file_id","variable_id","odbc_id","project_id","context","interval_id","account_id","template_id","list_id","sms_account_id","pause_id"],t=0;t<N.attributes.length;t++)if(_.includes(e,N.attributes[t].name))switch(N.attributes[t].name){case"sip_id":M();break;case"trunk_name":case"trunk_id":F(N.attributes[t].name);break;case"queue_id":$();break;case"file_id":q();break;case"variable_id":G();break;case"odbc_id":H();break;case"project_id":V();break;case"context":Q();break;case"interval_id":B();break;case"account_id":W();break;case"template_id":j();break;case"list_id":U();break;case"sms_account_id":Y();break;case"pause_id":z()}}();var e,t,n,a,i,s,o,r},N.closeDialog=function(e){e&&y(N.attributes),t.hide()},N.getMap=k}e.$inject=["$mdDialog","api","toasty","ispeechAsrModel","ispeechAsrLanguage","googleAsrLanguage","ispeechTtsLanguage","googleTtsLanguage","users","trunks","queues","sounds","variables","databases","projects","contexts","intervals","mailAccounts","templates","lists","cell","saveCallback","awsPollyVoice","awsPollyRegion","smsAccounts","pauses","dialogFlowLanguage","awsLexRegion","Auth","crudPermissions"],angular.module("app.callysquare").controller("MxGraphDialogController",e)}(),function(){"use strict";angular.module("app.callysquare").directive("stringToNumber",function(){return{require:"ngModel",link:function(e,t,n,a){a.$parsers.push(function(e){return""+e}),a.$formatters.push(function(e){return parseFloat(e)})}}})}(),function(){"use strict";angular.module("app.callysquare").factory("ispeechAsrModel",function(){return[{value:"0",option:"Default"},{value:"date",option:"Date"},{value:"usmoney",option:"US Money"},{value:"numbersto9",option:"Numbers to 9"},{value:"numbersto99",option:"Numbers to 99"},{value:"numbersto999",option:"Numbers to 999"},{value:"time",option:"Time"},{value:"phonenumber",option:"Phone number"},{value:"streets",option:"Streets"},{value:"citystate",option:"US City/States"}]}).factory("ispeechAsrLanguage",function(){return[{value:"en-US",option:"English (US)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GB",option:"English (UK)"},{value:"en-AU",option:"English (Australia)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"it-IT",option:"Italian (Italy) / Finnish (Finland)"},{value:"fr-FR",option:"German (Germany)"},{value:"fr-CA",option:"French (Canada)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ca-ES",option:"Catalan (Catalan)"},{value:"zh-TW",option:"Chinese (Taiwan)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"ko-KR",option:"Korean (Korea)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"nb-NO",option:"Norwegian (Norway)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"zh-CN",option:"Chinese (China)"},{value:"zh-HK",option:"Chinese (Hong Kong)"}]}).factory("ispeechTtsLanguage",function(){return[{value:"usenglishfemale",option:"US English Female"},{value:"usenglishmale",option:"US English Male"},{value:"ukenglishfemale",option:"UK English Female"},{value:"ukenglishmale",option:"UK English Male"},{value:"auenglishfemale",option:"Australian English"},{value:"usspanishfemale",option:"US Spanish Female"},{value:"usspanishmale",option:"US Spanish Male"},{value:"chchinesefemale",option:"Chinese Female"},{value:"chchinesemale",option:"Chinese Male"},{value:"hkchinesefemale",option:"Hong Kong Cantonese Female"},{value:"twchinesefemale",option:"Taiwan Chinese Female"},{value:"jpjapanesefemale",option:"Japanese Female"},{value:"jpjapanesemale",option:"Japanese Male"},{value:"krkoreanfemale",option:"Korean Female"},{value:"krkoreanmale",option:"Korean Male"},{value:"caenglishfemale",option:"Canadian English Female"},{value:"huhungarianfemale",option:"Hungarian Female"},{value:"brportuguesefemale",option:"Brazilian Portuguese Female"},{value:"eurportuguesefemale",option:"European Portuguese Female"},{value:"eurportuguesemale",option:"European Portuguese Male"},{value:"eurspanishfemale",option:"European Spanish Female"},{value:"eurspanishmale",option:"European Spanish Male"},{value:"eurcatalanfemale",option:"European Catalan Female"},{value:"eurczechfemale",option:"European Czech Female"},{value:"eurdanishfemale",option:"European Danish Female"},{value:"eurfinnishfemale",option:"European Finnish Female"},{value:"eurfrenchfemale",option:"European French Female"},{value:"eurfrenchmale",option:"European French Male"},{value:"eurnorwegianfemale",option:"European Norwegian Female"},{value:"eurdutchfemale",option:"European Dutch Female"},{value:"eurpolishfemale",option:"European Polish Female"},{value:"euritalianfemale",option:"European Italian Female"},{value:"euritalianmale",option:"European Italian Male"},{value:"eurturkishfemale",option:"European Turkish Female"},{value:"eurturkishmale",option:"European Turkish Male"},{value:"eurgermanfemale",option:"European German Female"},{value:"eurgermanmale",option:"European German Male"},{value:"rurussianfemale",option:"Russian Female"},{value:"rurussianmale",option:"Russian Male"},{value:"swswedishfemale",option:"Swedish Female"},{value:"cafrenchfemale",option:"Canadian French Female"},{value:"cafrenchmale",option:"Canadian French Male"}]}).factory("googleTtsLanguage",function(){return[{value:"af",option:"Afrikaans"},{value:"sq",option:"Albanian"},{value:"am",option:"Amharic"},{value:"ar",option:"Arabic"},{value:"hy",option:"Armenian"},{value:"az",option:"Azerbaijani"},{value:"eu",option:"Basque"},{value:"be",option:"Belarusian"},{value:"bn",option:"Bengali"},{value:"bh",option:"Bihari"},{value:"bs",option:"Bosnian"},{value:"br",option:"Breton"},{value:"bg",option:"Bulgarian"},{value:"km",option:"Cambodian"},{value:"ca",option:"Catalan"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-TW",option:"Chinese (Traditional)"},{value:"co",option:"Corsican"},{value:"hr",option:"Croatian"},{value:"cs",option:"Czech"},{value:"da",option:"Danish"},{value:"nl",option:"Dutch"},{value:"en",option:"English"},{value:"eo",option:"Esperanto"},{value:"et",option:"Estonian"},{value:"fo",option:"Faroese"},{value:"tl",option:"Filipino"},{value:"fi",option:"Finnish"},{value:"fr",option:"French"},{value:"fy",option:"Frisian"},{value:"gl",option:"Galician"},{value:"ka",option:"Georgian"},{value:"de",option:"German"},{value:"el",option:"Greek"},{value:"gn",option:"Guarani"},{value:"gu",option:"Gujarati"},{value:"xx-hacker",option:"Hacker"},{value:"ha",option:"Hausa"},{value:"iw",option:"Hebrew"},{value:"hi",option:"Hindi"},{value:"hu",option:"Hungarian"},{value:"is",option:"Icelandic"},{value:"id",option:"Indonesian"},{value:"ia",option:"Interlingua"},{value:"ga",option:"Irish"},{value:"it",option:"Italian"},{value:"jw",option:"Javanese"},{value:"ja",option:"Japanese"},{value:"kn",option:"Kannada"},{value:"kk",option:"Kazakh"},{value:"rw",option:"Kinyarwanda"},{value:"rn",option:"Kirundi"},{value:"xx-klingon",option:"Klingon"},{value:"ku",option:"Kurdish"},{value:"ko",option:"Korean"},{value:"ky",option:"Kyrgyz"},{value:"lo",option:"Laothian"},{value:"la",option:"Latin"},{value:"lv",option:"Latvian"},{value:"ln",option:"Lingala"},{value:"lt",option:"Lithuanian"},{value:"mk",option:"Macedonian"},{value:"mg",option:"Malagasy"},{value:"ml",option:"Malayalam"},{value:"mt",option:"Maltese"},{value:"mi",option:"Maori"},{value:"mr",option:"Marathi"},{value:"mo",option:"Moldavian"},{value:"mn",option:"Mongolian"},{value:"sr-ME",option:"Montenegrin"},{value:"ne",option:"Nepali"},{value:"no",option:"Norwegian"},{value:"nn",option:"Norwegian (Nynorsk)"},{value:"oc",option:"Occitan"},{value:"or",option:"Oriya"},{value:"om",option:"Oromo"},{value:"ps",option:"Pashto"},{value:"fa",option:"Persian"},{value:"xx-pirate",option:"Pirate"},{value:"pl",option:"Polish"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"pa",option:"Punjabi"},{value:"qu",option:"Quechua"},{value:"ro",option:"Romanian"},{value:"rm",option:"Romansh"},{value:"ru",option:"Russian"},{value:"gd",option:"Scots Gaelic"},{value:"sr",option:"Serbian"},{value:"sh",option:"Serbo-Croatian"},{value:"st",option:"Sesotho"},{value:"sn",option:"Shona"},{value:"sd",option:"Sindhi"},{value:"si",option:"Sinhalese"},{value:"sk",option:"Slovak"},{value:"sl",option:"Slovenian"},{value:"so",option:"Somali"},{value:"es",option:"Spanish"},{value:"su",option:"Sundanese"},{value:"sw",option:"Swahili"},{value:"sv",option:"Swedish"},{value:"tg",option:"Tajik"},{value:"ta",option:"Tamil"},{value:"tt",option:"Tatar"},{value:"te",option:"Telugu"},{value:"th",option:"Thai"},{value:"ti",option:"Tigrinya"},{value:"to",option:"Tonga"},{value:"tr",option:"Turkish"},{value:"tk",option:"Turkmen"},{value:"tw",option:"Twi"},{value:"ug",option:"Uighur"},{value:"uk",option:"Ukrainian"},{value:"ur",option:"Urdu"},{value:"uz",option:"Uzbek"},{value:"vi",option:"Vietnamese"},{value:"cy",option:"Welsh"},{value:"xh",option:"Xhosa"},{value:"yi",option:"Yiddish"},{value:"yo",option:"Yoruba"},{value:"zu",option:"Zulu"}]}).factory("googleAsrLanguage",function(){return[{value:"af-ZA",option:"Afrikaans (South Africa)"},{value:"am-ET",option:"Amharic (Ethiopia)"},{value:"hy-AM",option:"Armenian (Armenia)"},{value:"az-AZ",option:"Azerbaijani (Azerbaijan)"},{value:"id-ID",option:"Indonesian (Indonesia)"},{value:"ms-MY",option:"Malay (Malaysia)"},{value:"bn-BD",option:"Bengali (Bangladesh)"},{value:"bn-IN",option:"Bengali (India)"},{value:"ca-ES",option:"Catalan (Spain)"},{value:"cs-CZ",option:"Czech (Czech Republic)"},{value:"da-DK",option:"Danish (Denmark)"},{value:"de-DE",option:"German (Germany)"},{value:"en-AU",option:"English (Australia)"},{value:"en-CA",option:"English (Canada)"},{value:"en-GH",option:"English (Ghana)"},{value:"en-GB",option:"English (United Kingdom)"},{value:"en-IN",option:"English (India)"},{value:"en-IE",option:"English (Ireland)"},{value:"en-KE",option:"English (Kenya)"},{value:"en-NZ",option:"English (New Zealand)"},{value:"en-NG",option:"English (Nigeria)"},{value:"en-PH",option:"English (Philippines)"},{value:"en-ZA",option:"English (South Africa)"},{value:"en-TZ",option:"English (Tanzania)"},{value:"en-US",option:"English (United States)"},{value:"es-AR",option:"Spanish (Argentina)"},{value:"es-BO",option:"Spanish (Bolivia)"},{value:"es-CL",option:"Spanish (Chile)"},{value:"es-CO",option:"Spanish (Colombia)"},{value:"es-CR",option:"Spanish (Costa Rica)"},{value:"es-EC",option:"Spanish (Ecuador)"},{value:"es-SV",option:"Spanish (El Salvador)"},{value:"es-ES",option:"Spanish (Spain)"},{value:"es-US",option:"Spanish (United States)"},{value:"es-GT",option:"Spanish (Guatemala)"},{value:"es-HN",option:"Spanish (Honduras)"},{value:"es-MX",option:"Spanish (Mexico)"},{value:"es-NI",option:"Spanish (Nicaragua)"},{value:"es-PA",option:"Spanish (Panama)"},{value:"es-PY",option:"Spanish (Paraguay)"},{value:"es-PE",option:"Spanish (Peru)"},{value:"es-PR",option:"Spanish (Puerto Rico)"},{value:"es-DO",option:"Spanish (Dominican Republic)"},{value:"es-UY",option:"Spanish (Uruguay)"},{value:"es-VE",option:"Spanish (Venezuela)"},{value:"eu-ES",option:"Basque (Spain)"},{value:"fil-PH",option:"Filipino (Philippines)"},{value:"fr-CA",option:"French (Canada)"},{value:"fr-FR",option:"French (France)"},{value:"gl-ES",option:"Galician (Spain)"},{value:"ka-GE",option:"Georgian (Georgia)"},{value:"gu-IN",option:"Gujarati (India)"},{value:"hr-HR",option:"Croatian (Croatia)"},{value:"zu-ZA",option:"Zulu (South Africa)"},{value:"is-IS",option:"Icelandic (Iceland)"},{value:"it-IT",option:"Italian (Italy)"},{value:"jv-ID",option:"Javanese (Indonesia)"},{value:"kn-IN",option:"Kannada (India)"},{value:"km-KH",option:"Khmer (Cambodia)"},{value:"lo-LA",option:"Lao (Laos)"},{value:"lv-LV",option:"Latvian (Latvia)"},{value:"lt-LT",option:"Lithuanian (Lithuania)"},{value:"hu-HU",option:"Hungarian (Hungary)"},{value:"ml-IN",option:"Malayalam (India)"},{value:"mr-IN",option:"Marathi (India)"},{value:"nl-NL",option:"Dutch (Netherlands)"},{value:"ne-NP",option:"Nepali (Nepal)"},{value:"nb-NO",option:"Norwegian Bokmal (Norway)"},{value:"pl-PL",option:"Polish (Poland)"},{value:"pt-BR",option:"Portuguese (Brazil)"},{value:"pt-PT",option:"Portuguese (Portugal)"},{value:"ro-RO",option:"Romanian (Romania)"},{value:"si-LK",option:"Sinhala (Srilanka)"},{value:"sk-SK",option:"Slovak (Slovakia)"},{value:"sl-SI",option:"Slovenian (Slovenia)"},{value:"su-ID",option:"Sundanese (Indonesia)"},{value:"sw-TZ",option:"Swahili (Tanzania)"},{value:"sw-KE",option:"Swahili (Kenya)"},{value:"fi-FI",option:"Finnish (Finland)"},{value:"sv-SE",option:"Swedish (Sweden)"},{value:"ta-IN",option:"Tamil (India)"},{value:"ta-SG",option:"Tamil (Singapore)"},{value:"ta-LK",option:"Tamil (Sri Lanka)"},{value:"ta-MY",option:"Tamil (Malaysia)"},{value:"te-IN",option:"Telugu (India)"},{value:"vi-VN",option:"Vietnamese (Vietnam)"},{value:"tr-TR",option:"Turkish (Turkey)"},{value:"ur-PK",option:"Urdu (Pakistan)"},{value:"ur-IN",option:"Urdu (India)"},{value:"el-GR",option:"Greek (Greece)"},{value:"bg-BG",option:"Bulgarian (Bulgaria)"},{value:"ru-RU",option:"Russian (Russia)"},{value:"sr-RS",option:"Serbian (Serbia)"},{value:"uk-UA",option:"Ukrainian (Ukraine)"},{value:"he-IL",option:"Hebrew (Israel)"},{value:"ar-IL",option:"Arabic (Israel)"},{value:"ar-JO",option:"Arabic (Jordan)"},{value:"ar-AE",option:"Arabic (United Arab Emirates)"},{value:"ar-BH",option:"Arabic (Bahrain)"},{value:"ar-DZ",option:"Arabic (Algeria)"},{value:"ar-SA",option:"Arabic (Saudi Arabia)"},{value:"ar-IQ",option:"Arabic (Iraq)"},{value:"ar-KW",option:"Arabic (Kuwait)"},{value:"ar-MA",option:"Arabic (Morocco)"},{value:"ar-TN",option:"Arabic (Tunisia)"},{value:"ar-OM",option:"Arabic (Oman)"},{value:"ar-PS",option:"Arabic (State of Palestine)"},{value:"ar-QA",option:"Arabic (Qatar)"},{value:"ar-LB",option:"Arabic (Lebanon)"},{value:"ar-EG",option:"Arabic (Egypt)"},{value:"fa-IR",option:"Persian (Iran)"},{value:"hi-IN",option:"Hindi (India)"},{value:"th-TH",option:"Thai (Thailand)"},{value:"ko-KR",option:"Korean (South Korea)"},{value:"cmn-Hant-TW",option:"Chinese, Mandarin (Traditional, Taiwan)"},{value:"yue-Hant-HK",option:"Chinese, Cantonese (Traditional, Hong Kong)"},{value:"ja-JP",option:"Japanese (Japan)"},{value:"cmn-Hans-HK",option:"Chinese, Mandarin (Simplified, Hong Kong)"},{value:"cmn-Hans-CN",option:"Chinese, Mandarin (Simplified, China)"}]}).factory("awsPollyVoice",function(){return[{value:"Amy",option:"Amy (English, British, Female)"},{value:"Astrid",option:"Astrid (Swedish, Female)"},{value:"Brian",option:"Brian (English, British, Male)"},{value:"Carla",option:"Carla (Italian, Female)"},{value:"Carmen",option:"Carmen (Romanian, Female)"},{value:"Celine",option:"Celine (French, Female)"},{value:"Chantal",option:"Chantal (French, Canadian, Female)"},{value:"Conchita",option:"Conchita (Spanish, Castilian, Female)"},{value:"Cristiano",option:"Cristiano (Portuguese, Male)"},{value:"Dora",option:"Dora (Icelandic, Female)"},{value:"Emma",option:"Emma (English, British, Female)"},{value:"Enrique",option:"Enrique (Spanish, Castilian, Male)"},{value:"Ewa",option:"Ewa (Polish, Female)"},{value:"Filiz",option:"Filiz (Turkish, Female)"},{value:"Geraint",option:"Geraint (English, Welsh, Male)"},{value:"Giorgio",option:"Giorgio (Italian, Male)"},{value:"Gwineth",option:"Gwineth (Welsh, Female)"},{value:"Hans",option:"Hans (German, Male)"},{value:"Ines",option:"Ines (Portuguese, Female)"},{value:"Ivy",option:"Ivy (English, US, Female)"},{value:"Jacek",option:"Jacek (Polish, Male)"},{value:"Jan",option:"Jan (Polish, Male)"},{value:"Joanna",option:"Joanna (English, US, Female)"},{value:"Joey",option:"Joey (English, US, Male)"},{value:"Justin",option:"Justin (English, US, Male)"},{value:"Karl",option:"Karl (Icelandic, Male)"},{value:"Kendra",option:"Kendra (English, US, Female)"},{value:"Kimberly",option:"Kimberly (English, US, Female)"},{value:"Liv",option:"Liv (Norwegian, Female)"},{value:"Lotte",option:"Lotte (Dutch, Female)"},{value:"Mads",option:"Mads (Danish, Male)"},{value:"Maja",option:"Maja (Polish, Female)"},{value:"Marlene",option:"Marlene (German, Female)"},{value:"Mathieu",option:"Mathieu (French, Male)"},{value:"Maxim",option:"Maxim (Russian, Male)"},{value:"Miguel",option:"Miguel (Spanish, US, Male)"},{value:"Mizuki",option:"Mizuki (Japanese, Female)"},{value:"Naja",option:"Naja (Danish, Female)"},{value:"Nicole",option:"Nicole (English, Austrialian, Female)"},{value:"Penelope",option:"Penelope (Spanish, US, Female)"},{value:"Raveena",option:"Raveena (English, Indian, Female)"},{value:"Ricardo",option:"Ricardo (Portuguese, Brazilian, Male)"},{value:"Ruben",option:"Ruben (Dutch, Male)"},{value:"Russell",option:"Russell (English, Austrialian, Male)"},{value:"Salli",option:"Salli (English, US, Female)"},{value:"Tatyana",option:"Tatyana (Russian, Female)"},{value:"Vitoria",option:"Vitoria (Portuguese, Brazilian, Female)"}]}).factory("awsPollyRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-east-2",option:"US East (Ohio)"},{value:"us-west-1",option:"US West (N. California)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"ca-central-1",option:"Canada (Central)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"eu-central-1",option:"EU (Frankfurt)"},{value:"eu-west-2",option:"EU (London)"},{value:"eu-west-3",option:"EU (Paris)"},{value:"ap-southeast-1",option:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"},{value:"ap-northeast-2",option:"Asia Pacific (Seoul)"},{value:"ap-northeast-1",option:"Asia Pacific (Tokyo)"},{value:"ap-south-1",option:"Asia Pacific (Mumbai)"},{value:"sa-east-1",option:"South America (São Paulo)"}]}).factory("awsLexRegion",function(){return[{value:"us-east-1",option:"US East (N. Virginia)"},{value:"us-west-2",option:"US West (Oregon)"},{value:"eu-west-1",option:"EU (Ireland)"},{value:"ap-southeast-2",option:"Asia Pacific (Sydney)"}]}).factory("dialogFlowLanguage",function(){return[{value:"da",option:"Danish"},{value:"en",option:"English"},{value:"de",option:"German"},{value:"it",option:"Italian"},{value:"es",option:"Spanish"},{value:"fr",option:"French"},{value:"id",option:"Indonesian"},{value:"ja",option:"Japanese"},{value:"ko",option:"Korean (South Korea)"},{value:"nl",option:"Dutch"},{value:"no",option:"Norwegian"},{value:"pt",option:"Portuguese (European)"},{value:"pt-br",option:"Portuguese (Nrazilian)"},{value:"ru",option:"Russian"},{value:"sv",option:"Swedish"},{value:"th",option:"Thai"},{value:"uk",option:"Ukrainian"},{value:"zh-CN",option:"Chinese (Simplified)"},{value:"zh-HK",option:"Chinese (Hong Kong)"},{value:"zh-TW",option:"Chinese (Traditional)"}]})}(),function(){"use strict";function e(t,e,n,a){var i=this;i.project={preproduction:n},i.closeDialog=function(e){e?(a(i.project.preproduction),t.hide(i.project.preproduction)):t.hide()}}e.$inject=["$mdDialog","toasty","currentXML","saveCallback"],angular.module("app.callysquare").controller("MxGraphEditXMLController",e)}(),function(){"use strict";function e(t,n){var a=this;function i(e){e?(n(e),t.hide(e)):t.hide()}a.errors=[],a.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:5242880,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},a.ngFlow={flow:{}},a.dropping=!1,a.closeDialog=i,a.fileAdded=function(e){a.errors=[];_.includes(["xml"],e.getExtension())||a.errors.push({message:"The extension "+e.getExtension()+" is not supported!"});5242880<e.size&&a.errors.push({message:"The file is too big. The max allowed size is 5MB"});if(!a.errors.length){var t=new FileReader;t.onload=function(e){i(e.target.result)},t.readAsText(e.file)}}}e.$inject=["$mdDialog","saveCallback"],angular.module("app.callysquare").controller("MxGraphImportXMLController",e)}(),function(){"use strict";function e(t,n,e,a){var i=this;i.project=_.clone(e),i.closeDialog=function(){t.hide()},i.save=function(){i.errors=[],a.squareProject.update({id:i.project.id},{notes:i.project.notes,description:i.project.description}).$promise.then(function(e){n.success({title:"Project updated!",msg:i.project.name?i.project.name+" has been updated!":""}),t.hide(e)}).catch(function(e){console.error(e),i.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.update"}]})}}e.$inject=["$mdDialog","toasty","project","api"],angular.module("app.callysquare").controller("MxGraphUpdateInfoController",e)}(),function(){"use strict";function e(t,e,n,a,i){var s=this;s.projects=n,s.id="",s.newWindow=!0,s.closeDialog=function(e){s.errors=[],e?(t.hide(),s.newWindow?a.open("/callysquare/projects/"+s.id,"_blank"):i.go("app.callysquare.projects.edit",{id:s.id})):t.hide()}}e.$inject=["$mdDialog","toasty","projects","$window","$state"],angular.module("app.callysquare").controller("MxGraphOpenProjectController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o){var r=this;function l(){return a.squareProject.getUsers({id:r.project.id,fields:"id,name,fullname,internal",nolimit:!0,role:"user"}).$promise.then(function(e){return r.selectedItems=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.selectedItems=r.selectedItems,a.user.get({fields:"id,fullname,name,internal",role:"user",nolimit:!0}).$promise}).then(function(e){r.items=e.rows?_.map(e.rows,function(e){return e}):[],r.dualMultiselectOptions.items=_.differenceBy(r.items,r.selectedItems,"id")}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}r.project=t,r.penalty=0,r.items=[],r.selectedItems=[],r.closeDialog=function(){e.hide()},r.dualMultiselectOptions={readOnly:!1,items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("CALLYSQUARE.ALL_USERS"),labelSelected:s.instant("CALLYSQUARE.SELECTED_USERS"),transferCallback:function(e,t){a.squareProject[t?"removeUsers":"addUsers"]({id:r.project.id,ids:_.map(e,"id"),penalty:r.penalty||0}).$promise.then(function(){n.success({title:"Project properly "+(t?"removed":"added"),msg:"Project has been "+(t?"removed":"added")+"!"}),t||l()}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:squareProjects.ADDUSERS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},l()}e.$inject=["$mdDialog","toasty","api","project","projects","$translate","Auth"],angular.module("app.callysquare").controller("ProjectspermissionaddController",e)}(),function(){"use strict";function e(t,n,e,a,i,s,o){var r=this;r.project=angular.copy(e),r.project.name+="_new",r.project.preproduction=a,r.newWindow=!0,r.closeDialog=function(){t.hide()},r.save=function(){delete r.project.id,i.squareProject.save(r.project).$promise.then(function(e){n.success({title:"Project properly created",msg:r.project.name?r.project.name+" has been created!":""}),t.hide(e),r.newWindow?s.open("/callysquare/projects/"+e.id,"_blank"):o.go("app.callysquare.projects.edit",{id:e.id})}).catch(function(e){console.error(e),r.errors=e.data.errors||[{message:e.toString(),type:"api.squareProject.save"}]})}}e.$inject=["$mdDialog","toasty","project","currentXML","api","$window","$state"],angular.module("app.callysquare").controller("MxGraphSaveProjectAsController",e)}(),function(){"use strict";function e(e,n,a,i,s,o,r,t,l,d,c,m,u,p,g,v,h,f,b,E,A,y,S,T){var I=this;I.currentUser=T.getCurrentUser(),I.project=t||{},I.userProfileSection=S&&1==S.count?S.rows[0]:null,I.crudPermissions=T.parseCrudPermissions(I.userProfileSection?I.userProfileSection.crudPermissions:null),I.onInit=function(){new EditorUi(I,new Editor,document.getElementById("geEditor")).openString(I.project.preproduction,I.project.name,I.project)},I.saveOrPublishProject=function(e,t){var n={preproduction:e};t&&(n.production=e);r.squareProject.update({id:I.project.id},n).$promise.then(function(e){o.success({title:"Project "+(t?"published":"saved")+"!",msg:I.project.name?I.project.name+" has been "+(t?"published":"saved")+"!":""}),I.project.preproduction=e.preproduction}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsquareProject",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.openDialog=function(e,t){a.show({controller:"MxGraphDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{users:l.rows||[],trunks:d.rows||[],queues:c.rows||[],sounds:m.rows||[],variables:u.rows||[],databases:p.rows||[],contexts:g.rows||[],projects:v.rows||[],intervals:h.rows||[],mailAccounts:f.rows||[],smsAccounts:A.rows||[],pauses:y.rows||[],templates:b.rows||[],lists:E.rows||[],cell:e,saveCallback:t,crudPermissions:I.crudPermissions}})},I.newProject=function(e){a.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:e,projects:v.rows,openFromEditor:!0,license:null,setting:null,crudPermissions:I.crudPermissions}})},I.openProject=function(){a.show({controller:"MxGraphOpenProjectController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/open/open.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{projects:v.rows||[]}})},I.saveProjectAs=function(e){a.show({controller:"MxGraphSaveProjectAsController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{project:I.project,currentXML:e}}).then(function(e){e&&v.rows.push(e)})},I.newVariable=function(t){return i(function(a,t){return r.userProfileSection.get({userProfileId:I.currentUser.userProfileId,sectionId:1012}).$promise.then(function(e){var t=e.rows?e.rows[0]:null,n=T.parseCrudPermissions(t?t.crudPermissions:null);a(n)}).catch(function(e){t(e)})}).then(function(e){e.canEdit?a.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{variable:t,variables:u.rows,license:null,setting:null,crudPermissions:e}}):o.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE")})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:NEW_VARIABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})},I.updateInfo=function(e){a.show({controller:"MxGraphUpdateInfoController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/info/info.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:I.project}}).then(function(e){e&&_.merge(I.project,e)})},I.editXML=function(e,t){a.show({controller:"MxGraphEditXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/edit/edit.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{currentXML:e,saveCallback:t}}).then(function(e){e&&(I.project.preproduction=e)})},I.importXML=function(e){a.show({controller:"MxGraphImportXMLController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/edit/import/import.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{saveCallback:e}}).then(function(e){e&&(I.project.preproduction=e)})},I.gotoProjects=function(){e.go("app.callysquare.projects")}}e.$inject=["$state","$document","$mdDialog","$q","$translate","toasty","api","project","users","trunks","queues","sounds","variables","databases","contexts","projects","intervals","mailAccounts","templates","lists","smsAccounts","pauses","userProfileSection","Auth"],angular.module("app.callysquare").controller("ProjectController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.projects=a||{count:0,rows:[]},p.userProfile=i,p.userProfileSection=s&&1==s.count?s.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.table="projects",p.listOrder="",p.listOrderAsc=null,p.selectedProjects=[],p.query={fields:"id,name,description,notes",sort:"-updatedAt",limit:10,page:1},p.editstate=function(e,t){n.go("app.callysquare.projects.edit",{id:e.id,crudPermissions:p.crudPermissions})},p.deleteconfirm=function(e,t){var n=l.confirm().title("Are you sure want to delete the project?").htmlContent("<b>"+e.name+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");l.show(n).then(function(){f(e)},function(){console.log("CANCEL")})},p.success=h,p.getProjects=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=o.squareProject.get(p.query,h).$promise:(p.query.id=p.userProfile.id,p.query.section="Projects",p.promise=o.userProfile.getResources(p.query,h).$promise)},p.createOrEditProject=function(e,t){l.show({controller:"CreateOrEditSquareProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/projects/create/dialog.html",parent:angular.element(d.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:p.projects.rows,openFromEditor:null,setting:null,crudPermissions:p.crudPermissions}})},p.deleteProject=f,p.exportSelectedProjects=function(){var e=angular.copy(p.selectedProjects);return p.selectedProjects=[],e},p.deleteSelectedProjects=function(e){var t=l.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+p.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");l.show(t).then(function(){p.selectedProjects.forEach(function(e){f(e)}),p.selectedProjects=[]})},p.deselectProjects=function(){p.selectedProjects=[]},p.selectAllProjects=function(){p.selectedProjects=p.projects.rows};var g=!0,v=1;function h(e){p.projects=e||{count:0,rows:[]}}function f(e){o.squareProject.delete({id:e.id}).$promise.then(function(){_.remove(p.projects.rows,{id:e.id}),p.projects.count-=1,p.projects.rows.length||p.getProjects(),m.success({title:"Project deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.project.delete"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.project.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){g?c(function(){g=!1}):(t||(v=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=v),p.getProjects())})}e.$inject=["$scope","$state","$mdSidenav","projects","userProfile","userProfileSection","api","msUtils","$mdDialog","$document","$timeout","toasty","Auth"],angular.module("app.callysquare").controller("ProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CALLYSQUARE.EDIT_SQUARERECORDING",g.squareRecording=angular.copy(l),g.squareRecordings=r,g.newSquareRecording=!1,g.squareRecording||(g.squareRecording={},g.title="CALLYSQUARE.NEW_SQUARERECORDING",g.newSquareRecording=!0),g.addNewSquareRecording=function(){g.errors=[],d.squareRecording.save(g.squareRecording).$promise.then(function(e){g.squareRecordings.unshift(e.toJSON()),o.success({title:"SquareRecording properly created",msg:g.squareRecording.name?g.squareRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSquareRecording=function(){g.errors=[],d.squareRecording.update({id:g.squareRecording.id},g.squareRecording).$promise.then(function(e){var t=_.find(g.squareRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SquareRecording properly saved!",msg:g.squareRecording.name?g.squareRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSquareRecording=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The squareRecording will be deleted.").ariaLabel("Delete SquareRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.squareRecording.delete({id:g.squareRecording.id}).$promise.then(function(){_.remove(g.squareRecordings,{id:g.squareRecording.id}),o.success({title:"SquareRecording properly deleted!",msg:(g.squareRecording.name||"squareRecording")+" has been deleted!"}),v(g.squareRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.squareRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","squareRecordings","squareRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.callysquare").controller("CreateOrEditSquareRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.squareRecordings=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="squareRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedSquareRecordings=[],b.query={fields:"createdAt,updatedAt,id,filename,projectName,uniqueid,callerid,extension,audio",sort:"-updatedAt",limit:10,page:1},b.downloadfile2=function(s,e){return m.squareRecording.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.uniqueid+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.squareRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("squareRecording")+"?").htmlContent("<b>"+(e.name||"squareRecording")+"</b> will be deleted.").ariaLabel("delete squareRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSquareRecordings=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.squareRecording.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SquareRecordings",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSquareRecording=function(e,t){i.show({controller:"CreateOrEditSquareRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/callysquare/views/squareRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{squareRecording:t,squareRecordings:b.squareRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSquareRecording=S,b.exportSelectedSquareRecordings=function(){var e=angular.copy(b.selectedSquareRecordings);return b.selectedSquareRecordings=[],e},b.deleteSelectedSquareRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected squareRecordings?").htmlContent("<b>"+b.selectedSquareRecordings.length+" selected</b> will be deleted.").ariaLabel("delete SquareRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSquareRecordings.forEach(function(e){S(e)}),b.selectedSquareRecordings=[]})},b.deselectSquareRecordings=function(){b.selectedSquareRecordings=[]},b.selectAllSquareRecordings=function(){b.selectedSquareRecordings=b.squareRecordings.rows};var E=!0,A=1;function y(e){b.squareRecordings=e||{count:0,rows:[]}}function S(e){m.squareRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.squareRecordings.rows,{id:e.id}),b.squareRecordings.count-=1,b.squareRecordings.rows.length||b.getSquareRecordings(),p.success({title:_.startCase("SquareRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsquareRecording"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsquareRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSquareRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","squareRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.callysquare").controller("SquareRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chatQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chatQueues",b.listOrder="",b.listOrderAsc=null,b.selectedChatQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"chat",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.chat.chatQueues.edit",{id:e.id,chatQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:b.chatQueues?b.chatQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:b.chatQueues?b.chatQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chatQueue")+"?").htmlContent("<b>"+(e.name||"chatQueue")+"</b> will be deleted.").ariaLabel("delete chatQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.chat.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.chat.realtime.queues",{})}},b.success=y,b.getChatQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.chatQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChatQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditChatQueue=function(e,t){i.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:b.chatQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteChatQueue=S,b.exportSelectedChatQueues=function(){var e=angular.copy(b.selectedChatQueues);return b.selectedChatQueues=[],e},b.deleteSelectedChatQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatQueues?").htmlContent("<b>"+b.selectedChatQueues.length+" selected</b> will be deleted.").ariaLabel("delete ChatQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChatQueues.forEach(function(e){S(e)}),b.selectedChatQueues=[]})},b.deselectChatQueues=function(){b.selectedChatQueues=[]},b.selectAllChatQueues=function(){b.selectedChatQueues=b.chatQueues.rows};var E=!0,A=1;function y(e){b.chatQueues=e||{count:0,rows:[]}}function S(e){m.chatQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.chatQueues.rows,{id:e.id}),b.chatQueues.count-=1,b.chatQueues.rows.length||b.getChatQueues(),p.success({title:_.startCase("ChatQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChatQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATQUEUE",g.chatQueue=angular.copy(l),g.chatQueues=r,g.newChatQueue=!1,g.chatQueue||(g.chatQueue={strategy:"beepall",timeout:10},g.title="CHAT.NEW_CHATQUEUE",g.newChatQueue=!0),g.addNewChatQueue=function(){g.errors=[],d.chatQueue.save(g.chatQueue).$promise.then(function(e){g.chatQueues.unshift(e.toJSON()),o.success({title:"ChatQueue properly created",msg:g.chatQueue.name?g.chatQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatQueue=function(){g.errors=[],d.chatQueue.update({id:g.chatQueue.id},g.chatQueue).$promise.then(function(e){var t=_.find(g.chatQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatQueue properly saved!",msg:g.chatQueue.name?g.chatQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatQueue will be deleted.").ariaLabel("Delete ChatQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatQueue.delete({id:g.chatQueue.id}).$promise.then(function(){_.remove(g.chatQueues,{id:g.chatQueue.id}),o.success({title:"ChatQueue properly deleted!",msg:(g.chatQueue.name||"chatQueue")+" has been deleted!"}),v(g.chatQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatQueues","chatQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatQueue.getAgents({id:c.chatQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserChatQueue?"penalty "+e.UserChatQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.chatQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.removeAgents({id:c.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.addAgents({id:c.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","chatQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatQueue.getTeams({id:l.chatQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.chatQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("CHAT.ALL_TEAMS"),labelSelected:n.instant("CHAT.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.removeTeams({id:l.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatQueue.addTeams({id:l.chatQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","chatQueue","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.chatQueue=c||e.params.chatQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"ChatQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatQueue:e,chatQueues:u.chatQueues?u.chatQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatQueues=function(){e.go("app.chat.chatQueues")},u.saveChatQueue=function(){r.chatQueue.update({id:u.chatQueue.id},u.chatQueue).$promise.then(function(){l.success({title:"ChatQueue updated!",msg:u.chatQueue.name?u.chatQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatQueue","userProfileSection"],angular.module("app.chat").controller("ChatQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chatWebsites=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chatWebsites",b.listOrder="",b.listOrderAsc=null,b.selectedChatWebsites=[],b.query={fields:"createdAt,updatedAt,id,token,agentIdentifier,customerAlias,messageFontSize,name,key,address,remote,ListId,fidelity,timeout,agentAlias,closingQuestion,formSubmitSuccessMessage,formSubmitFailureMessage,color,color_focus,color_button,textColor,backgroundColor,fontSize,header_shape,showAgentAvatar,showCustomerAvatar,alignment,verticalAlignment,messagesAlignment,defaultTitle,animation,defaultWhiteLabel,whiteLabel,defaultLogo,conditionAgreement,autoclose,enableUnmanagedNote,unmanagedMessage,skipUnmanaged,sendUnmanaged,enableCustomerWriting,waitingTitle,waitingMessage,closingMessage,noteTitle,placeholderMessage,skipMessageButton,enableRating,ratingType,ratingStarsNumber,enableFeedback,forwardTranscript,forwardTranscriptMessage,closingMessageButton,download_transcript,enableCustomerAttachment,enableCustomerCheckmarks,systemAlias,enquiry_enable,enquiry_forwarding,enquiry_forwarding_address,name_title,username_placeholder,email_title,email_placeholder,header_online,hideWhenOffline,header_offline,start_chat_button,offline_chat_button,offlineMessageSubject,offlineMessageBody,offline_message,message_title,enquiry_message_placeholder,enquiry_button,rating_message,rating_send,rating_skip,onlineForm,offlineForm,mapKey,mapKeyOffline,forwardOffline,forwardOfflineAddress,IntervalId,timezone,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arrayagentIdentifier=_.keyBy([{option:"WebsiteAlias",value:"'website_alias'"},{option:"AgentAlias",value:"'agent_alias'"},{option:"AgentFullname",value:"'agent_fullname'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayheader_shape=_.keyBy([{option:"Rounded",value:"'rounded'"},{option:"Squared",value:"'squared'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayalignment=_.keyBy([{option:"bottom_right",value:"'bottom_right'"},{option:"right",value:"'right'"},{option:"left",value:"'left'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymessagesAlignment=_.keyBy([{option:"alternate",value:"'alternate'"},{option:"centered",value:"'centered'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayratingType=_.keyBy([{option:"Star",value:"'star'"},{option:"Thumb",value:"'thumb'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,chatWebsite:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:9})},b.offlinemessagesgoto=function(e,t){n.go("app.chat.chatWebsites.edit",{id:e.id,tab:10})},b.agentadddialog=function(e,t){i.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:b.chatWebsites?b.chatWebsites.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chatWebsite")+"?").htmlContent("<b>"+(e.name||"chatWebsite")+"</b> will be deleted.").ariaLabel("delete chatWebsite").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getChatWebsites=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.chatWebsite.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChatWebsites",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditChatWebsite=function(e,t){i.show({controller:"CreateOrEditChatWebsiteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:t,chatWebsites:b.chatWebsites.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteChatWebsite=S,b.exportSelectedChatWebsites=function(){var e=angular.copy(b.selectedChatWebsites);return b.selectedChatWebsites=[],e},b.deleteSelectedChatWebsites=function(e){var t=i.confirm().title("Are you sure want to delete the selected chatWebsites?").htmlContent("<b>"+b.selectedChatWebsites.length+" selected</b> will be deleted.").ariaLabel("delete ChatWebsites").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChatWebsites.forEach(function(e){S(e)}),b.selectedChatWebsites=[]})},b.deselectChatWebsites=function(){b.selectedChatWebsites=[]},b.selectAllChatWebsites=function(){b.selectedChatWebsites=b.chatWebsites.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.chatWebsite&&(n=_.find(b.lists,{id:Number(b.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.chatWebsite&&(a=_.find(b.lists,{id:Number(b.chatWebsite.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.chatWebsite&&(n=_.find(b.interval,{id:Number(b.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.chatWebsite&&(a=_.find(b.interval,{id:Number(b.chatWebsite.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.chatWebsites=e||{count:0,rows:[]}}function S(e){m.chatWebsite.delete({id:e.id}).$promise.then(function(){_.remove(b.chatWebsites.rows,{id:e.id}),b.chatWebsites.count-=1,b.chatWebsites.rows.length||b.getChatWebsites(),p.success({title:_.startCase("ChatWebsite")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChatWebsites())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chatWebsites","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.chat").controller("ChatWebsitesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATWEBSITE",g.chatWebsite=angular.copy(l),g.chatWebsites=r,g.newChatWebsite=!1,g.chatWebsite||(g.chatWebsite={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),header_shape:"rounded",alignment:"bottom_right",verticalAlignment:30,messagesAlignment:"alternate",IntervalId:"null",timezone:"null",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="CHAT.NEW_CHATWEBSITE",g.newChatWebsite=!0),t.params.id&&(g.chatWebsite.ChatWebsiteId=t.params.id),g.addNewChatWebsite=function(){g.errors=[],d.chatWebsite.save(g.chatWebsite).$promise.then(function(e){g.chatWebsites.unshift(e.toJSON()),o.success({title:"ChatWebsite properly created",msg:g.chatWebsite.name?g.chatWebsite.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatWebsite=function(){g.errors=[],d.chatWebsite.update({id:g.chatWebsite.id},g.chatWebsite).$promise.then(function(e){var t=_.find(g.chatWebsites,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatWebsite properly saved!",msg:g.chatWebsite.name?g.chatWebsite.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatWebsite=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatWebsite will be deleted.").ariaLabel("Delete ChatWebsite").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatWebsite.delete({id:g.chatWebsite.id}).$promise.then(function(){_.remove(g.chatWebsites,{id:g.chatWebsite.id}),o.success({title:"ChatWebsite properly deleted!",msg:(g.chatWebsite.name||"chatWebsite")+" has been deleted!"}),v(g.chatWebsite)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatWebsite.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.chatWebsite&&(n=_.find(g.lists,{id:Number(g.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.chatWebsite&&(a=_.find(g.lists,{id:Number(g.chatWebsite.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.chatWebsite&&(n=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.chatWebsite&&(a=_.find(g.interval,{id:Number(g.chatWebsite.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatWebsites","chatWebsite","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatWebsiteDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsiteApp:n,chatWebsite:r.chatWebsite,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.chatWebsiteApps.rows[t]=e:r.chatWebsiteApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.chatWebsiteApps.rows.length;n++,0){var a=r.chatWebsiteApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.chatWebsite.context,a.exten=r.chatWebsite.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.chatWebsite.addApplications({id:r.chatWebsite.id},_.sortBy(t,"priority")).$promise.then(function(e){r.chatWebsiteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.chatWebsiteApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.chatWebsite={},r.chatWebsiteApps={count:0,rows:[]},r.selectedChatWebsiteApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"ChatQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"chatQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:501}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",role:"agent",sort:"name",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]},{app:"dialogflow",appType:"dialogflow",type:"dialogflow",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Key",name:"key",type:"text",required:!0,param:0},{title:"language",name:"language",type:"select",defaultValue:"'en'",values:[{option:"Danish",value:"'da'"},{option:"English",value:"'en'"},{option:"German",value:"'de'"},{option:"Italian",value:"'it'"},{option:"Spanish",value:"'es'"},{option:"French",value:"'fr'"},{option:"Indonesian",value:"'id'"},{option:"Japanese",value:"'ja'"},{option:"Korean (South Korea)",value:"'ko'"},{option:"Dutch",value:"'nl'"},{option:"Norwegian",value:"'no'"},{option:"Portuguese (European)",value:"'pt'"},{option:"Portuguese (Nrazilian)",value:"'pt-br'"},{option:"Russian",value:"'ru'"},{option:"Swedish",value:"'sv'"},{option:"Thai",value:"'th'"},{option:"Ukrainian",value:"'uk'"},{option:"Chinese (Simplified)",value:"'zh-CN'"},{option:"Chinese (Hong Kong)",value:"'zh-HK'"},{option:"Chinese (Traditional)",value:"'zh-TW'"}],required:!0,param:1},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:2,help:!0}]},{app:"amazonlex",appType:"amazonlex",type:"amazonlex",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"accesskeyid",name:"accesskeyid",type:"text",required:!0,param:0},{title:"secretaccesskey",name:"secretaccesskey",type:"text",required:!0,param:1},{title:"lexregion",name:"lexregion",type:"select",defaultValue:"'us-east-1'",values:[{option:"US East (N. Virginia)",value:"'us-east-1'"},{option:"US West (Oregon)",value:"'us-west-2'"},{option:"EU (Ireland)",value:"'eu-west-1'"},{option:"Asia Pacific (Sydney)",value:"'ap-southeast-2'"}],required:!0,param:2},{title:"botname",name:"botname",type:"text",required:!0,param:3},{title:"welcomemessage",name:"welcomemessage",type:"textarea",maxlength:255,param:4,help:!0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.chatWebsite=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getChatWebsiteApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.chatWebsiteApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getChatWebsiteApps=function(){r.promise=o.chatWebsite.getApplications(r.query,n).$promise},r.editChatWebsiteApp=t,r.editInterval=function(e,t){if(r.chatWebsiteApps.rows.length){var n=r.chatWebsiteApps.rows[t]?r.chatWebsiteApps.rows[t]:r.chatWebsiteApps.rows[0];i.show({controller:"EditChatWebsiteAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteChatWebsiteApp=function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedChatWebsiteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedChatWebsiteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedChatWebsiteApps.forEach(function(e){_.remove(r.chatWebsiteApps.rows,{id:e.id})}),r.selectedChatWebsiteApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.chat").controller("ChatWebsiteActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.chatWebsite.getAgents({id:c.chatWebsite.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserChatWebsite?"penalty "+e.UserChatWebsite.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.chatWebsite=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.chatWebsite.removeAgents({id:c.chatWebsite.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.chatWebsite.addAgents({id:c.chatWebsite.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CHAT.ALL_AGENTS"),labelSelected:r.instant("CHAT.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","chatWebsite","chatWebsites","realtime","$translate","Auth","crudPermissions"],angular.module("app.chat").controller("ChatWebsiteagentaddController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsiteagentAvatarController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.amazonlex=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.amazonlex.appdata)switch(l.amazonlex.appType?l.amazonlex.appType.toLowerCase():l.amazonlex.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.amazonlex.appdata.split(",");l.amazonlex.key=d[0],l.amazonlex.language=d[1],l.amazonlex.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=d[0],l.amazonlex.secretaccesskey=d[1],l.amazonlex.lexregion=d[2],l.amazonlex.botname=d[3],l.amazonlex.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.amazonlex.appdata.split(",");l.amazonlex.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.amazonlex.text=d.slice(1,d.length).join(",");break;case"message":l.amazonlex.text=l.amazonlex.appdata;break;case"set":l.amazonlex.name=l.amazonlex.appdata.split("=")[0],l.amazonlex.value=l.amazonlex.appdata.split("=")[1];break;case"agi":l.amazonlex.project=l.amazonlex.appdata;break;default:var c=l.amazonlex.appdata.split(",");l.amazonlex.accesskeyid=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.amazonlex.secretaccesskey=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.amazonlex.lexregion=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.amazonlex.botname=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.amazonlex.welcomemessage=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10)}else l.amazonlex.lexregion="us-east-1";function m(e){t.hide(e)}l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outbounddial"===l.amazonlex.appType.toLowerCase()&&(l.amazonlex.prefix=l.amazonlex.phone?l.amazonlex.phone.split("$")[0]:void 0,l.amazonlex.callerId=l.amazonlex.callerID?"CALLERID(all)="+l.amazonlex.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.amazonlex.type&&"outbound"===l.amazonlex.type.toLowerCase()&&"outboundDial"===l.amazonlex.appType&&(l.amazonlex.phone=i.cutdigits?(l.amazonlex.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.amazonlex.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.amazonlex.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.amazonlex.options+="U(xcally-mixmonitor-context)"):l.amazonlex.options=l.amazonlex.options.replace("U(xcally-mixmonitor-context)",""));if(l.amazonlex.appType&&"custom"===l.amazonlex.appType);else switch((l.amazonlex.app||l.amazonlex.appType).toLowerCase()){case"set":l.amazonlex.appdata=l.amazonlex.name+"="+l.amazonlex.value;break;case"custom":break;default:e[0]=l.amazonlex.accesskeyid,e[1]=l.amazonlex.secretaccesskey,e[2]=l.amazonlex.lexregion,e[3]=l.amazonlex.botname,e[4]=l.amazonlex.welcomemessage,l.amazonlex.appdata=e.join(",")}m(l.amazonlex)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppamazonlexDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.dialogflow=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dialogflow.appdata)switch(l.dialogflow.appType?l.dialogflow.appType.toLowerCase():l.dialogflow.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dialogflow.appdata.split(",");l.dialogflow.key=d[0],l.dialogflow.language=d[1],l.dialogflow.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dialogflow.appdata.split(",");l.dialogflow.accesskeyid=d[0],l.dialogflow.secretaccesskey=d[1],l.dialogflow.lexregion=d[2],l.dialogflow.botname=d[3],l.dialogflow.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dialogflow.appdata.split(",");l.dialogflow.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dialogflow.text=d.slice(1,d.length).join(",");break;case"message":l.dialogflow.text=l.dialogflow.appdata;break;case"set":l.dialogflow.name=l.dialogflow.appdata.split("=")[0],l.dialogflow.value=l.dialogflow.appdata.split("=")[1];break;case"agi":l.dialogflow.project=l.dialogflow.appdata;break;default:var c=l.dialogflow.appdata.split(",");l.dialogflow.key=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dialogflow.language=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dialogflow.welcomemessage=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}else l.dialogflow.language="en";function m(e){t.hide(e)}l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outbounddial"===l.dialogflow.appType.toLowerCase()&&(l.dialogflow.prefix=l.dialogflow.phone?l.dialogflow.phone.split("$")[0]:void 0,l.dialogflow.callerId=l.dialogflow.callerID?"CALLERID(all)="+l.dialogflow.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.dialogflow.type&&"outbound"===l.dialogflow.type.toLowerCase()&&"outboundDial"===l.dialogflow.appType&&(l.dialogflow.phone=i.cutdigits?(l.dialogflow.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dialogflow.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dialogflow.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dialogflow.options+="U(xcally-mixmonitor-context)"):l.dialogflow.options=l.dialogflow.options.replace("U(xcally-mixmonitor-context)",""));if(l.dialogflow.appType&&"custom"===l.dialogflow.appType);else switch((l.dialogflow.app||l.dialogflow.appType).toLowerCase()){case"set":l.dialogflow.appdata=l.dialogflow.name+"="+l.dialogflow.value;break;case"custom":break;default:e[0]=l.dialogflow.key,e[1]=l.dialogflow.language,e[2]=l.dialogflow.welcomemessage,l.dialogflow.appdata=e.join(",")}m(l.dialogflow)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppdialogflowDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditChatWebsiteAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("chat")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.chatQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:501}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="CHAT.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveChatWebsiteApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","chatWebsiteApp","chatWebsite","api","Auth","crudPermissions"],angular.module("app.chat").controller("EditChatWebsiteApptagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatCannedAnswers={count:0,rows:[]},c.selectedChatWebsiteChatCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatCannedAnswer?").htmlContent("<b>"+(e.name||"chatCannedAnswer")+"</b> will be deleted.").ariaLabel("delete chatCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getAnswers(c.query,p).$promise},c.createOrEditChatWebsiteChatCannedAnswer=function(e,t){s.show({controller:"CreateOrEditChatCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatCannedAnswer:t,chatCannedAnswers:c.chatWebsiteChatCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteChatCannedAnswers=function(){var e=angular.copy(c.selectedChatWebsiteChatCannedAnswers);return c.selectedChatWebsiteChatCannedAnswers=[],e},c.deleteChatWebsiteChatCannedAnswer=g,c.deleteSelectedChatWebsiteChatCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected chatCannedAnswers?").htmlContent("<b>"+c.selectedChatWebsiteChatCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete chatCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteChatCannedAnswers.forEach(function(e){g(e)}),c.selectedChatWebsiteChatCannedAnswers=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatCannedAnswers.rows,{id:e.id}),c.chatWebsiteChatCannedAnswers.count-=1,c.chatWebsiteChatCannedAnswers.rows.length||c.getChatWebsiteChatCannedAnswers(),r.success({title:"ChatCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATCANNEDANSWER",g.chatCannedAnswer=angular.copy(l),g.chatCannedAnswers=r,g.newChatCannedAnswer=!1,g.chatCannedAnswer||(g.chatCannedAnswer={},g.title="CHAT.NEW_CHATCANNEDANSWER",g.newChatCannedAnswer=!0),t.params.id&&(g.chatCannedAnswer.ChatWebsiteId=t.params.id),g.addNewChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.chatCannedAnswer).$promise.then(function(e){g.chatCannedAnswers.unshift(e.toJSON()),o.success({title:"ChatCannedAnswer properly created",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.chatCannedAnswer.id},g.chatCannedAnswer).$promise.then(function(e){var t=_.find(g.chatCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatCannedAnswer properly saved!",msg:g.chatCannedAnswer.name?g.chatCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatCannedAnswer will be deleted.").ariaLabel("Delete ChatCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.chatCannedAnswer.id}).$promise.then(function(){_.remove(g.chatCannedAnswers,{id:g.chatCannedAnswer.id}),o.success({title:"ChatCannedAnswer properly deleted!",msg:(g.chatCannedAnswer.name||"chatCannedAnswer")+" has been deleted!"}),v(g.chatCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatCannedAnswers","chatCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteChatDispositions={count:0,rows:[]},c.selectedChatWebsiteChatDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteChatDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatDisposition?").htmlContent("<b>"+(e.name||"chatDisposition")+"</b> will be deleted.").ariaLabel("delete chatDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteChatDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getDispositions(c.query,p).$promise},c.createOrEditChatWebsiteChatDisposition=function(e,t){s.show({controller:"CreateOrEditChatDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatDisposition:t,chatDispositions:c.chatWebsiteChatDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteChatDispositions=function(){var e=angular.copy(c.selectedChatWebsiteChatDispositions);return c.selectedChatWebsiteChatDispositions=[],e},c.deleteChatWebsiteChatDisposition=g,c.deleteSelectedChatWebsiteChatDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected chatDispositions?").htmlContent("<b>"+c.selectedChatWebsiteChatDispositions.length+" selected</b> will be deleted.").ariaLabel("delete chatDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteChatDispositions.forEach(function(e){g(e)}),c.selectedChatWebsiteChatDispositions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteChatDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteChatDispositions.rows,{id:e.id}),c.chatWebsiteChatDispositions.count-=1,c.chatWebsiteChatDispositions.rows.length||c.getChatWebsiteChatDispositions(),r.success({title:"ChatDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteChatDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteChatDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATDISPOSITION",g.chatDisposition=angular.copy(l),g.chatDispositions=r,g.newChatDisposition=!1,g.chatDisposition||(g.chatDisposition={},g.title="CHAT.NEW_CHATDISPOSITION",g.newChatDisposition=!0),t.params.id&&(g.chatDisposition.ChatWebsiteId=t.params.id),g.addNewChatDisposition=function(){g.errors=[],d.disposition.save(g.chatDisposition).$promise.then(function(e){g.chatDispositions.unshift(e.toJSON()),o.success({title:"ChatDisposition properly created",msg:g.chatDisposition.name?g.chatDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatDisposition=function(){g.errors=[],d.disposition.update({id:g.chatDisposition.id},g.chatDisposition).$promise.then(function(e){var t=_.find(g.chatDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatDisposition properly saved!",msg:g.chatDisposition.name?g.chatDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatDisposition will be deleted.").ariaLabel("Delete ChatDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.chatDisposition.id}).$promise.then(function(){_.remove(g.chatDispositions,{id:g.chatDisposition.id}),o.success({title:"ChatDisposition properly deleted!",msg:(g.chatDisposition.name||"chatDisposition")+" has been deleted!"}),v(g.chatDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chatDispositions","chatDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.offlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.offlineForm)&&(i.chatWebsite.offlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.offlineForm.items[t-1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t-1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey--:i.chatWebsite.offlineForm.fromKey===t-1&&i.chatWebsite.offlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.offlineForm.items.length-1){var n=i.chatWebsite.offlineForm.items[t+1];i.chatWebsite.offlineForm.items[t]=n,i.chatWebsite.offlineForm.items[t+1]=angular.copy(e),i.chatWebsite.offlineForm.fromKey===t?i.chatWebsite.offlineForm.fromKey++:i.chatWebsite.offlineForm.fromKey===t+1&&i.chatWebsite.offlineForm.fromKey--}},i.add=function(e){i.chatWebsite.offlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.offlineForm.items.splice(e,1)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteofflineFormController",e)}(),function(){"use strict";function e(n,e,a){var i=this;i.chatWebsite={},i.onlineForm={},i.buttons=[{type:"label",name:"Label",icon:"icon-label"},{type:"chooseFromList",name:"Select",icon:"icon-playlist-plus"},{type:"input",name:"Input",icon:"icon-keyboard"},{type:"textarea",name:"Textarea",icon:"icon-format-text"},{type:"multipleChoices",name:"Radio Buttons",icon:"icon-radiobox-marked"},{type:"checkboxes",name:"Checkboxes",icon:"icon-checkbox-multiple-marked-outline"},{type:"agreement",name:"Agreement",icon:"icon-checkbox-marked-outline"}],i.init=function(e){i.fields=[],i.customFields=[],i.uselessFields=["id","createdAt","updatedAt","ListId","CompanyId","$promise","$resolved"],i.chatWebsite=e,_.isEmpty(i.chatWebsite.onlineForm)&&(i.chatWebsite.onlineForm={items:[],fromKey:null});a.cmList.getCustomFields({id:i.chatWebsite.ListId}).$promise.then(function(e){for(var t=0;t<e.rows.length;t++)i.customFields.push({key:"cf_"+e.rows[t].id,value:e.rows[t].alias});return a.cmContact.describe().$promise}).then(function(e){for(var t=_.keys(e),n=0;n<t.length;n++)_.includes(i.uselessFields,t[n])||_.startsWith(t[n],"cf_")||i.fields.unshift({key:t[n],value:t[n]});return a.variable.get().$promise}).then(function(e){i.variables=e.rows}).catch(function(e){console.error(e)})},i.up=function(e,t){if(0!==t){var n=i.chatWebsite.onlineForm.items[t-1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t-1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey--:i.chatWebsite.onlineForm.fromKey===t-1&&i.chatWebsite.onlineForm.fromKey++}},i.down=function(e,t){if(t!==i.chatWebsite.onlineForm.items.length-1){var n=i.chatWebsite.onlineForm.items[t+1];i.chatWebsite.onlineForm.items[t]=n,i.chatWebsite.onlineForm.items[t+1]=angular.copy(e),i.chatWebsite.onlineForm.fromKey===t?i.chatWebsite.onlineForm.fromKey++:i.chatWebsite.onlineForm.fromKey===t+1&&i.chatWebsite.onlineForm.fromKey--}},i.add=function(e){i.chatWebsite.onlineForm.items.push({type:e,cmField:null,variable:null})},i.remove=function(e){var t=n.confirm().title("The component will be deleted.").textContent("Are you sure?").ariaLabel("Lucky day").ok("Ok").cancel("Cancel");n.show(t).then(function(){i.chatWebsite.onlineForm.fromKey===e&&(i.chatWebsite.onlineForm.fromKey=null),i.chatWebsite.onlineForm.items.splice(e,1),i.chatWebsite.onlineForm.items.length||(i.chatWebsite.onlineForm.fromKey=null)})}}e.$inject=["$mdDialog","$document","api"],angular.module("app.chat").controller("ChatWebsiteonlineFormController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/customer_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitecustomerAvatarController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteInteractions={count:0,rows:[]},c.selectedChatWebsiteInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,UserId,ContactId,ChatWebsiteId,id,closedAt,Contact.firstName,Owner.name,disposition,ratingValue,ratingType,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.getChatWebsiteInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.chatInteractionDownload=function(s,e,t){return l.chatInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="chat-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatWebsite.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getChatWebsiteInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getInteractions(c.query,p).$promise},c.createOrEditChatWebsiteInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,interaction:t,interactions:c.chatWebsiteInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spychatInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"chat",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedChatWebsiteInteractions=function(){var e=angular.copy(c.selectedChatWebsiteInteractions);return c.selectedChatWebsiteInteractions=[],e},c.deleteChatWebsiteInteraction=g,c.deleteSelectedChatWebsiteInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedChatWebsiteInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteInteractions.forEach(function(e){g(e)}),c.selectedChatWebsiteInteractions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteInteractions=e||{count:0,rows:[]}}function g(e){l.chatInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteInteractions.rows,{id:e.id}),c.chatWebsiteInteractions.count-=1,c.chatWebsiteInteractions.rows.length||c.getChatWebsiteInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteInteractionsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/logo".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitelogoController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteOfflineMessages={count:0,rows:[]},c.selectedChatWebsiteOfflineMessages=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId",sort:"-createdAt",limit:10,page:1},c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.getChatWebsiteOfflineMessages()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the offlineMessage?").htmlContent("<b>"+(e.name||"offlineMessage")+"</b> will be deleted.").ariaLabel("delete offlineMessage").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteOfflineMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getOfflineMessages(c.query,p).$promise},c.createOrEditChatWebsiteOfflineMessage=function(e,t){s.show({controller:"CreateOrEditOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,offlineMessage:t,offlineMessages:c.chatWebsiteOfflineMessages.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.showOfflineMessageChatWebsiteOfflineMessage=function(e,n){s.show({controller:"ShowOfflineMessageOfflineMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,resolve:{message:["apiResolver","$stateParams",function(e,t){return e.resolve("chatOfflineMessage@get",{fields:"id,body",id:n.id})}]}})},c.exportSelectedChatWebsiteOfflineMessages=function(){var e=angular.copy(c.selectedChatWebsiteOfflineMessages);return c.selectedChatWebsiteOfflineMessages=[],e},c.deleteChatWebsiteOfflineMessage=g,c.deleteSelectedChatWebsiteOfflineMessages=function(e){var t=s.confirm().title("Are you sure want to delete the selected offlineMessages?").htmlContent("<b>"+c.selectedChatWebsiteOfflineMessages.length+" selected</b> will be deleted.").ariaLabel("delete offlineMessages").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteOfflineMessages.forEach(function(e){g(e)}),c.selectedChatWebsiteOfflineMessages=[]})},l.cmContact.get({fields:"id,firstName,lastName",nolimit:"true"}).$promise.then(function(e){c.contacts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTACTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.chatWebsiteOfflineMessages=e||{count:0,rows:[]}}function g(e){l.chatOfflineMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteOfflineMessages.rows,{id:e.id}),c.chatWebsiteOfflineMessages.count-=1,c.chatWebsiteOfflineMessages.rows.length||c.getChatWebsiteOfflineMessages(),r.success({title:"OfflineMessage deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteOfflineMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteOfflineMessagesController",e)}(),function(){"use strict";function e(t,e){this.title="CHAT.OFFLINE_MESSAGE",this.message=e,this.closeDialog=function(e){t.hide(e)}}e.$inject=["$mdDialog","message"],angular.module("app.chat").controller("ShowOfflineMessageOfflineMessageDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.chatWebsite={},c.chatWebsiteProactiveActions={count:0,rows:[]},c.selectedChatWebsiteProactiveActions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name,type,selector,timeout",limit:10,page:1},c.arraytype=_.keyBy([{option:"MouseOver",value:"'mouseOver'"},{option:"Timeout",value:"'timeout'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.chatWebsite=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.chatWebsite.id,c.query.ChatWebsiteId=c.chatWebsite.id,c.getChatWebsiteProactiveActions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the chatProactiveAction?").htmlContent("<b>"+(e.name||"chatProactiveAction")+"</b> will be deleted.").ariaLabel("delete chatProactiveAction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getChatWebsiteProactiveActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.chatWebsite.getProactiveActions(c.query,p).$promise},c.createOrEditChatWebsiteChatProactiveAction=function(e,t){s.show({controller:"CreateOrEditChatProactiveActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatWebsite:c.chatWebsite,chatProactiveAction:t,proactive:c.chatWebsiteProactiveActions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedChatWebsiteProactiveActions=function(){var e=angular.copy(c.selectedChatWebsiteProactiveActions);return c.selectedChatWebsiteProactiveActions=[],e},c.deleteChatWebsiteChatProactiveAction=g,c.deleteSelectedChatWebsiteProactiveActions=function(e){var t=s.confirm().title("Are you sure want to delete the selected proactive?").htmlContent("<b>"+c.selectedChatWebsiteProactiveActions.length+" selected</b> will be deleted.").ariaLabel("delete proactive").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedChatWebsiteProactiveActions.forEach(function(e){g(e)}),c.selectedChatWebsiteProactiveActions=[]})};var m=!0,u=1;function p(e){c.chatWebsiteProactiveActions=e||{count:0,rows:[]}}function g(e){l.chatProactiveAction.delete({id:e.id}).$promise.then(function(){_.remove(c.chatWebsiteProactiveActions.rows,{id:e.id}),c.chatWebsiteProactiveActions.count-=1,c.chatWebsiteProactiveActions.rows.length||c.getChatWebsiteProactiveActions(),r.success({title:"ChatProactiveAction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETchatWebsite"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getChatWebsiteProactiveActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.chat").controller("ChatWebsiteProactiveActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CHAT.EDIT_CHATPROACTIVEACTION",g.chatProactiveAction=angular.copy(l),g.proactive=r,g.newChatProactiveAction=!1,g.chatProactiveAction||(g.chatProactiveAction={type:"mouseOver"},g.title="CHAT.NEW_CHATPROACTIVEACTION",g.newChatProactiveAction=!0),t.params.id&&(g.chatProactiveAction.ChatWebsiteId=t.params.id),g.addNewChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.save(g.chatProactiveAction).$promise.then(function(e){g.proactive.unshift(e.toJSON()),o.success({title:"ChatProactiveAction properly created",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveChatProactiveAction=function(){g.errors=[],d.chatProactiveAction.update({id:g.chatProactiveAction.id},g.chatProactiveAction).$promise.then(function(e){var t=_.find(g.proactive,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ChatProactiveAction properly saved!",msg:g.chatProactiveAction.name?g.chatProactiveAction.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteChatProactiveAction=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chatProactiveAction will be deleted.").ariaLabel("Delete ChatProactiveAction").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.chatProactiveAction.delete({id:g.chatProactiveAction.id}).$promise.then(function(){_.remove(g.proactive,{id:g.chatProactiveAction.id}),o.success({title:"ChatProactiveAction properly deleted!",msg:(g.chatProactiveAction.name||"chatProactiveAction")+" has been deleted!"}),v(g.chatProactiveAction)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.chatProactiveAction.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatProactiveAction.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","proactive","chatProactiveAction","api","Auth","license","setting","crudPermissions"],angular.module("app.chat").controller("CreateOrEditChatProactiveActionDialogController",e)}(),function(){"use strict";function e(e){var t=this;t.chatWebsite={},t.init=function(e){t.chatWebsite=e,t.start="\n\x3c!-- START Motion Chat Script --\x3e",t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>',t.end="\n\x3c!-- START Motion Chat Script --\x3e"},t.info={},e.$watch("vm_ac.chatWebsite.remote",function(e){t.script='\n <script src="'+t.chatWebsite.remote+"/api/chat/websites/"+t.chatWebsite.id+"/snippet?token="+t.chatWebsite.token+'"><\/script>'})}e.$inject=["$scope"],angular.module("app.chat").controller("ChatWebsiteScriptController",e)}(),function(){"use strict";function e(e,a){var i=this;i.chatWebsite={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.chatWebsite.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.chatWebsite.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.chatWebsite=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="/api/chat/websites/:id/system_avatar".replace(":id",i.chatWebsite.id),i.chatWebsite.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.chat").controller("ChatWebsitesystemAvatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.chatWebsite=c||e.params.chatWebsite||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"ChatWebsiteagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{chatWebsite:e,chatWebsites:u.chatWebsites?u.chatWebsites.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoChatWebsites=function(){e.go("app.chat.chatWebsites")},u.saveChatWebsite=function(){r.chatWebsite.update({id:u.chatWebsite.id},u.chatWebsite).$promise.then(function(){l.success({title:"ChatWebsite updated!",msg:u.chatWebsite.name?u.chatWebsite.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatWebsite",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.chatWebsite&&(n=_.find(u.lists,{id:Number(u.chatWebsite.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.chatWebsite&&(a=_.find(u.lists,{id:Number(u.chatWebsite.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.chatWebsite&&(n=_.find(u.interval,{id:Number(u.chatWebsite.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.chatWebsite&&(a=_.find(u.interval,{id:Number(u.chatWebsite.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","chatWebsite","userProfileSection"],angular.module("app.chat").controller("ChatWebsiteController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"chat",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsChatRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.chatQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].ChatQueueId].paused++,g.queues[e[t].rows[n].ChatQueueId].loggedInDb++,g.queues[e[t].rows[n].ChatQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].ChatQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"chat",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.chatQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="ChatQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditChatQueue=function(e,t){a.show({controller:"CreateOrEditChatQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"ChatQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{chatQueue:t,chatQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.chatQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.ChatQueueId]&&g.queues[e.ChatQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.ChatQueueId]&&g.queues[e.ChatQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.ChatQueueId]&&(g.queues[e.ChatQueueId].loggedInDb+=1,g.queues[e.ChatQueueId].agents[e.UserId]=e.ChatQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.ChatQueueId]&&0<g.queues[e.ChatQueueId].loggedInDb&&(g.queues[e.ChatQueueId].loggedInDb-=1,delete g.queues[e.ChatQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("chat_queue:save",g.onSave),d.on("userChatQueue:save",g.onSaveMember),d.on("userChatQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("chat_queue:save"),d.removeAllListeners("userChatQueue:remove"),d.removeAllListeners("userChatQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.chat").controller("QueuesChatRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.chat.realtime.agents":this.selectedTab=0;break;case"app.chat.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.chat.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.chat.realtime.agents");break;case 1:n.go("app.chat.realtime.queues");break;default:n.go("app.chat.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.chat").controller("ChatRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.companies=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="companies",b.listOrder="",b.listOrderAsc=null,b.selectedCompanies=[],b.query={fields:"createdAt,updatedAt,id,name,phone,vat,fax,companyId,type,website,emailDomain,email,description,sStreet,sPostalCode,sCity,sCountry,street,postalCode,city,country",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){a.go("app.contactmanager.companies.edit",{id:e.id,company:e,crudPermissions:b.crudPermissions})},b.gotocontactsgoto=function(n,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{CompanyId:n.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:n.id})}},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("company")+"?").htmlContent("<b>"+(e.name||"company")+"</b> will be deleted.").ariaLabel("delete company").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCompanies=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmCompany.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Companies",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCompany=function(e,t){i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{company:t,companies:b.companies.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCompany=S,b.exportSelectedCompanies=function(){var e=angular.copy(b.selectedCompanies);return b.selectedCompanies=[],e},b.deleteSelectedCompanies=function(e){var t=i.confirm().title("Are you sure want to delete the selected companies?").htmlContent("<b>"+b.selectedCompanies.length+" selected</b> will be deleted.").ariaLabel("delete Companys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCompanies.forEach(function(e){S(e)}),b.selectedCompanies=[]})},b.deselectCompanies=function(){b.selectedCompanies=[]},b.selectAllCompanies=function(){b.selectedCompanies=b.companies.rows};var E=!0,A=1;function y(e){b.companies=e||{count:0,rows:[]}}function S(e){m.cmCompany.delete({id:e.id}).$promise.then(function(){_.remove(b.companies.rows,{id:e.id}),b.companies.count-=1,b.companies.rows.length||b.getCompanies(),p.success({title:_.startCase("Company")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCompany"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCompany",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCompanies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","companies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("CompaniesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_COMPANY",g.company=angular.copy(l),g.companies=r,g.newCompany=!1,g.company||(g.company={},g.title="CONTACTMANAGER.NEW_COMPANY",g.newCompany=!0),g.addNewCompany=function(){g.errors=[],d.cmCompany.save(g.company).$promise.then(function(e){g.companies.unshift(e.toJSON()),o.success({title:"Company properly created",msg:g.company.name?g.company.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCompany=function(){g.errors=[],d.cmCompany.update({id:g.company.id},g.company).$promise.then(function(e){var t=_.find(g.companies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Company properly saved!",msg:g.company.name?g.company.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCompany=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The company will be deleted.").ariaLabel("Delete Company").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmCompany.delete({id:g.company.id}).$promise.then(function(){_.remove(g.companies,{id:g.company.id}),o.success({title:"Company properly deleted!",msg:(g.company.name||"company")+" has been deleted!"}),v(g.company)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCompany.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCompany.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","companies","company","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCompanyDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.company=c||a.params.company||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(n,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{CompanyId:n.id}):l.info({title:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:i.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{CompanyId:n.id})}},u.alert=l.info,u.gotoCompanies=function(){a.go("app.contactmanager.companies")},u.saveCompany=function(){r.cmCompany.update({id:u.company.id},u.company).$promise.then(function(){l.success({title:"Company updated!",msg:u.company.name?u.company.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmCompany",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","company","userProfileSection"],angular.module("app.contactmanager").controller("CompanyController",e)}(),function(){"use strict";function e(t,i,n,a,e,s,o,r,l,d,c,m,u,p,g,v,h,f,b){var E=this;E.currentUser=f.getCurrentUser(),E.license=b,E.userProfile=r,E.userProfileSection=l&&1==l.count?l.rows[0]:null,E.crudPermissions=f.parseCrudPermissions(E.userProfileSection?E.userProfileSection.crudPermissions:null);var A=60,y=1024*A*1024;E.ngFlowOptions={target:"api/cm/contacts/upload",singleFile:!0,maxChunkRetries:1,chunkSize:y,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},E.contacts=c||{count:0,rows:[]},E.options={hidden:!1,hover:!1,isOpen:!1},E.table="cm_contacts",E.selectedContacts=[],E.lists=m||{rows:[],count:0},E.companies=p||{rows:[],count:0},E.tags=v||{rows:[],count:0},E.listsMap=u,E.companiesMap=g,E.selectedTags=[],E.selectedList=null,E.selectedCompany=null,E.query=_.merge({includeAll:!0,sort:"-updatedAt",limit:10,offset:0,page:1},e),E.editdialog=function(e,t){a.go("app.contactmanager.contacts.edit",{id:e.id,crudPermissions:E.crudPermissions})},E.deleteconfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the contact?").htmlContent("<b>"+(e.firstName||e.email||e.phone||"Contact")+"</b> will be deleted.").ariaLabel("delete contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){C(e)})},E.success=I,E.getContacts=function(){E.query.offset=(E.query.page-1)*E.query.limit,f.hasRole("admin")?E.promise=d.cmContact.get(E.query,I).$promise:(E.query.id=E.userProfile.id,E.query.section="Contacts",E.promise=d.userProfile.getResources(E.query,I).$promise)},E.getAssignedCompanies=function(){if(!f.hasRole("admin")){var e=_(E.contacts.rows).map(function(e){return{id:e.CompanyId}}).uniqBy("id").pullAllBy(E.companies.rows,"id").value();if(!_.isEmpty(e)){for(var t=[],n=0;n<e.length;n++)t.push(d.cmCompany.get({id:e[n].id,fields:"id,name"}).$promise);o.all(t).then(function(e){e.forEach(function(e){var t=e.toJSON();t.canSelect=!1,E.companies.rows.push(t);var n={};n[t.id]=t.name,E.companiesMap=_.assignIn(E.companiesMap,n)})}).catch(function(e){h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}}},E.mergeContact=function(e,t){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:E.contacts.rows}})},E.duplicateContact=function(e,t){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}]},locals:{contacts:E.contacts.rows}})},E.createOrEditContact=function(e,t){t&&t.dateOfBirth&&(t.dateOfBirth=new Date(t.dateOfBirth));s.show({controller:"CreateOrEditContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ListId:E.query.ListId||a.params.ListId,CompanyId:E.query.CompanyId||a.params.CompanyId,contact:t,contacts:E.contacts.rows,setting:null,crudPermissions:E.crudPermissions},resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name",nolimit:!0}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Lists",fields:"id,name",nolimit:!0})}],companies:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmCompany@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:t.getCurrentUser().userProfileId,section:"Companies",fields:"id,name"})}]}})},E.deleteContact=C,E.exportSelectedContacts=function(){var e=angular.copy(E.selectedContacts);return E.selectedContacts=[],e},E.deleteSelectedContacts=function(e){var t=s.confirm().title("Are you sure want to delete the selected contacts?").htmlContent("<b>"+E.selectedContacts.length+" selected</b> will be deleted.").ariaLabel("delete Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){E.selectedContacts.forEach(function(e){C(e)}),E.selectedContacts=[]})},E.deselectContacts=function(){E.selectedContacts=[]},E.selectAllContacts=function(){E.selectedContacts=E.contacts.rows},E.createTag=function(e){var t=s.prompt().title("What would you name your tag?").placeholder("Tag name").ariaLabel("Tag name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.tag.save({name:e});h.error({title:"Error creating tag!",msg:"Invalid tag name."})}).then(function(e){e&&(E.tags.rows.push(e),h.success({title:"Tag properly created!",msg:e.tag?e.name+" has been created!":""}))})},E.createList=function(e){var t=s.prompt().title("What would you name your list?").placeholder("List name").ariaLabel("List name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.cmList.save({name:e});h.error({title:"Error creating list!",msg:"Invalid list name."})}).then(function(e){e&&(E.lists.rows.push(e),h.success({title:"List properly created!",msg:e.name?e.name+" has been created!":""}))})},E.createCompany=function(e){var t=s.prompt().title("What would you name your company?").placeholder("Company name").ariaLabel("Company name").targetEvent(e).ok("Ok").cancel("Cancel");return s.show(t).then(function(e){if(e)return d.cmCompany.save({name:e});h.error({title:"Error creating company!",msg:"Invalid company name."})}).then(function(e){e&&(E.companies.rows.push(e),h.success({title:"Company properly created!",msg:e.name?e.name+" has been created!":""}))})},E.importContacts=function(e,t,n){var a=JSON.parse(t);s.show({controller:"ImportContactsDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/import/import.html",parent:angular.element(i.body),clickOutsideToClose:!1,locals:{lists:m,companies:p,file:a.file,fields:a.fields,license:E.license}}).then(function(){E.getContacts()}).catch(function(e){console.error()})},E.hasPermission=function(){return f.hasPermission(303)||f.hasRole("admin")},E.fileAdded=function(e){var t=["csv"];if(!_.includes(t,e.getExtension()))return h.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>y)return h.error({title:"File too big",msg:"The max allowed size is "+A+"MB"}),!1;return!0},a.params.ListId&&(E.selectedList=a.params.ListId),a.params.CompanyId&&(E.selectedCompany=a.params.CompanyId),t.$watch("vm.options.isOpen",function(e){e?n(function(){t.tooltipVisible=E.options.isOpen},600):t.tooltipVisible=E.options.isOpen});var S=!0,T=1;function I(e){E.contacts=e||{count:0,rows:[]}}function C(e){d.cmContact.delete({id:e.id}).$promise.then(function(){_.remove(E.contacts.rows,{id:e.id}),E.contacts.count-=1,E.contacts.rows.length||E.getContacts(),h.success({title:"Contact deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){E.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}];for(var t=0;t<e.data.errors.length;t++)h.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else h.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm.query.filter",function(e,t){S?n(function(){S=!1}):(t||(T=E.query.page),e!==t&&(E.query.page=1),e||(E.query.page=T),E.getContacts())},!0),t.$watch("vm.selectedList",function(e,t){e!==t&&(E.query.ListId=E.selectedList||void 0,E.getContacts())}),t.$watch("vm.selectedCompany",function(e,t){e!==t&&(E.query.CompanyId=E.selectedCompany||void 0,E.getContacts())}),t.$watch("vm.selectedTags",function(e,t){(e.length||t.length)&&E.getContacts()})}e.$inject=["$scope","$document","$timeout","$state","$stateParams","$mdDialog","$q","userProfile","userProfileSection","api","contacts","lists","listsMap","companies","companiesMap","tags","toasty","Auth","license"],angular.module("app.contactmanager").controller("ContactsController",e)}(),function(){"use strict";function e(n,a,e,t,i,s,o,r,l,d){var c=this;function m(){n.hide()}c.errors=[],c.title="CONTACTMANAGER.EDIT_CONTACT",c.crudPermissions=d,c.contact=angular.copy(s),c.contacts=e||{rows:[],count:0},c.lists=t||{rows:[],count:0},c.companies=i||{rows:[],count:0},c.customFields={rows:[],count:0},c.newContact=!1,c.contact?(delete c.contact.List,c.ListId=c.contact.ListId||void 0):(c.contact={ListId:o?parseInt(o,10):void 0,CompanyId:r?parseInt(r,10):void 0},c.title="CONTACTMANAGER.NEW_CONTACT",c.newContact=!0),c.addNewContact=function(){c.errors=[],l.cmContact.save(c.contact).$promise.then(function(e){c.contacts.unshift(e),a.success({title:"Contact properly created",msg:c.contact.name?c.contact.name+" has been created!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contacts.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.saveContact=function(){c.errors=[],l.cmContact.update({id:c.contact.id},c.contact).$promise.then(function(e){var t=_.find(c.contacts,{id:e.id});t&&_.merge(t,e),a.success({title:"Contact properly saved!",msg:c.contact.name?c.contact.name+" has been saved!":""}),m()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.update"}];for(var t=0;t<e.data.errors.length;t++)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.deleteContact=function(e){c.errors=[];var t=n.confirm().title("Are you sure?").content("The contact will be deleted.").ariaLabel("Delete Contact").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){l.cmContact.delete({id:c.contact.id}).$promise.then(function(){_.remove(c.contacts,{id:c.contact.id}),a.success({title:"Contact properly deleted!",msg:c.contact.name?c.contact.name+" has been deleted!":""}),m()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.contact.delete"}]})},function(){})},c.closeDialog=m,c.getCustomFields=function(e){{if(e)return l.cmList.getCustomFields({id:e}).$promise.then(function(e){e&&(c.customFields=e)}).catch(function(e){console.error(e)});c.customFields={rows:[],count:0}}},c.getDateFromString=function(e){return null===e?void 0:new Date(e)}}e.$inject=["$mdDialog","toasty","contacts","lists","companies","contact","ListId","CompanyId","api","crudPermissions"],angular.module("app.tools").controller("CreateOrEditContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.title="CONTACTMANAGER.COPY_CONTACT",o.contact=angular.copy(n),o.lists=i||{rows:[],count:0},o.addNewContact=function(){o.errors=[],delete o.contact.id,o.contact.tags&&!o.contact.tags.length&&delete o.contact.tags;s.cmContact.save(o.contact).$promise.then(function(e){a.unshift(e),t.success({title:"Contact properly created",msg:o.contact.name?o.contact.name+" has been created!":""}),r()}).catch(function(e){console.error(e),o.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("DuplicateContactDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="CONTACTMANAGER.EDIT_HOPPER",d.hopper=angular.copy(o),d.hoppers=s,d.newHopper=!1,d.crudPermissions=l,d.hopper||(d.hopper={},d.title="CONTACTMANAGER.NEW_HOPPER",d.newHopper=!0),d.saveHopper=function(){d.errors=[],r.cmHopper.update({id:d.hopper.id},d.hopper).$promise.then(function(e){var t=_.find(d.hoppers,{id:e.id});t&&_.merge(t,e),i.success({title:"Hopper properly saved!",msg:d.hopper.name?d.hopper.name+" has been saved!":""}),c(e)}).catch(function(e){console.error(e),d.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}]})},d.getDateFromString=function(e){return null===e?void 0:new Date(e)},d.closeDialog=c}e.$inject=["$scope","$state","$location","$mdDialog","toasty","hoppers","hopper","api","crudPermissions"],angular.module("app.contactmanager.contacts").controller("EditHopperDialogController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E){var A=this;A.currentUser=b.getCurrentUser(),A.license=f,A.journey=[],A.contact=r||{},A.hoppers=l||{rows:[],count:0},A.finals=d||{rows:[],count:0},A.histories=c||{rows:[],count:0},A.companies=u||{rows:[],count:0},A.lists=p||{rows:[],count:0},A.customFields=g||{rows:[],count:0},A.tags=v||{rows:[],count:0},A.jscriptySessions=h||{rows:[],count:0},A.timelineOptions={scrollEl:"#interaction-content"},A.userProfileSection=E&&1==E.count?E.rows[0]:null,A.crudPermissions=b.parseCrudPermissions(A.userProfileSection?A.userProfileSection.crudPermissions:null),A.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),A.queryHopper={fields:"id,phone,scheduledat,priority,recallme,VoiceQueueId,CampaignId,UserId",sort:"-updatedAt",limit:10,page:1},A.queryFinal={fields:"id,uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-id",limit:10,page:1},A.queryHistory={fields:"id,uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-id",limit:10,page:1},A.queryJscriptySession={fields:"id,starttime,endtime,membername,projectname",sort:"-starttime",limit:10,page:1},A.selectedTab=t.params.tab||0,A.onInit=function(){b.hasRole("admin")||(function(){if(!_.some(A.companies.rows,{id:A.contact.CompanyId}))o.cmCompany.get({id:A.contact.CompanyId,fields:"id,name"}).$promise.then(function(e){var t=e.toJSON();t.canSelect=!1,A.companies.rows.push(t)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"GET_COMPANY",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}(),function(){var e=_.map(A.contact.Tags,function(e){return{id:e.id,name:e.name}});if(!_.isEmpty(e))for(var t=0;t<e.length;t++)_.some(A.tags.rows,{id:e.id})||(e[t].canSelect=!1,A.tags.rows.push(e[t]))}());return o.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){A.users=e||{count:0,rows:[]},A.usersMap=_.mapValues(_.keyBy(A.users.rows,"id"),"fullname"),A.Tags=_.map(A.contact.Tags,"id")}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)o[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(I);o.voiceCallReport.get({fields:"id,uniqueid,type,source,destination,callerid,starttime,endtime,duration,disposition,amaflags,note,UserId,ContactId",ContactId:e.id,includeAll:!0}).$promise.then(I).catch(function(e){console.error(e)})}}(r))},A.gotoContacts=function(){t.go("app.contactmanager.contacts",{},{reload:!0,notify:!0})},A.duplicateContact=function(e){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,resolve:{lists:["apiResolver","Auth",function(e,t){return t.hasRole("admin")?e.resolve("cmList@get",{fields:"id,name"}):e.resolve("userProfile@getResources",{id:A.currentUser.userProfileId,section:"Lists",fields:"id,name"})}]},locals:{contacts:m.rows,contact:r}})},A.saveContact=function(){o.cmContact.update({id:A.contact.id},A.contact).$promise.then(function(){s.success({title:"Contact updated!",msg:A.contact.name?A.contact.name+" has been updated!":""})}).then(function(){return o.cmContact.setTags({id:A.contact.id,ids:A.Tags}).$promise}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEcontact",msg:e.data?JSON.stringify(e.data):e.toString()})})},A.editCompany=function(e,t){var n=_.find(A.companies.rows,{id:t});i.show({controller:"CreateOrEditCompanyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/companies/create/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{companies:[],license:null,setting:null,crudPermissions:!1===n.canSelect?{readOnly:!0,canEdit:!1,canDelete:!1}:o.userProfileSection.get({userProfileId:A.currentUser.userProfileId,sectionId:302}).$promise.then(function(e){var t=e.rows?e.rows[0]:null;return b.parseCrudPermissions(t?t.crudPermissions:null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"API:GET_COMPANY_SECTION",msg:e.data?JSON.stringify(e.data):e.toString()})})},resolve:{company:["apiResolver",function(e){return e.resolve("cmCompany@get",{id:t})}]}})},A.onSelectList=function(e){if(A.contact.ListId){var t=i.confirm().title("You are selecting the list number: "+A.contact.ListId).textContent("Warning! You won't select a different list for the contact "+A.contact.firstName||A.contact.lastName||A.contact.id).targetEvent(e).ok("Ok").cancel("Cancel");return i.show(t).then(A.onSelectListSuccess).catch(function(){A.contact.ListId=null})}},A.onSelectListSuccess=function(){return o.cmList.getCustomFields({id:A.contact.ListId}).$promise.then(function(e){A.customFields=e||{rows:[],count:0}}).catch(function(e){console.error(e)})},A.getDateFromString=function(e){return null===e?void 0:new Date(e)},A.getHoppers=function(){A.queryHopper.offset=(A.queryHopper.page-1)*A.queryHopper.limit,A.queryHopper.id=A.contact.id,A.promise=o.cmContact.getHoppers(A.queryHopper,T("hoppers")).$promise},A.getFinals=function(){A.queryFinal.offset=(A.queryFinal.page-1)*A.queryFinal.limit,A.queryFinal.id=A.contact.id,A.promise=o.cmContact.getHopperFinals(A.queryFinal,T("finals")).$promise},A.getHistories=function(){A.queryHistory.offset=(A.queryHistory.page-1)*A.queryHistory.limit,A.queryHistory.id=A.contact.id,A.promise=o.cmContact.getHopperHistories(A.queryHistory,T("histories")).$promise},A.getJscriptySessions=function(){A.queryJscriptySession.offset=(A.queryJscriptySession.page-1)*A.queryJscriptySession.limit,A.queryJscriptySession.id=A.contact.id,A.promise=o.cmContact.getJscriptySessions(A.queryJscriptySession,T("jscriptySessions")).$promise},A.deleteconfirm=function(t,e){var n=i.confirm().title("Are you sure want to delete the agent?").htmlContent("<b>"+(t.phone||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(e).ok("OK").cancel("CANCEL");i.show(n).then(function(){var e;e=t,o.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(A.hoppers.rows,{id:e.id}),A.hoppers.count--,A.hoppers.rows.length||A.getHoppers(),s.success({title:"Hopper deleted!",msg:e.phone?e.phone+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEhopper",msg:e.data?JSON.stringify(e.data):e.toString()})})},function(){console.log("CANCEL")})},A.editHopper=function(e,t){i.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:A.hoppers.rows,license:null,setting:null,crudPermissions:A.crudPermissions}})},A.createOrEditIvrCampaignHopper=function(e,t){i.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{hopper:t,hoppers:A.hoppers.rows,license:null,setting:null,crudPermissions:A.crudPermissions}})},A.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}(t)};var y=!0,S=1;function T(t){return function(e){A[t]=e||{count:0,rows:[]}}}function I(e){e&&e.count&&e.rows.length&&(A.journey=_.concat(A.journey,e.rows))}e.$watch("vm.queryHopper.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryHopper.page),e!==t&&(A.queryHopper.page=1),e||(A.queryHopper.page=S),A.getHoppers())}),e.$watch("vm.queryFinal.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryFinal.page),e!==t&&(A.queryFinal.page=1),e||(A.queryFinal.page=S),A.getFinals())}),e.$watch("vm.queryHistory.filter",function(e,t){y?n(function(){y=!1}):(t||(S=A.queryHistory.page),e!==t&&(A.queryHistory.page=1),e||(A.queryHistory.page=S),A.getHistories())})}e.$inject=["$scope","$timeout","$state","$document","$mdDialog","toasty","api","contact","hoppers","finals","histories","contacts","companies","lists","customFields","tags","jscriptySessions","license","Auth","userProfileSection"],angular.module("app.contactmanager.contacts").controller("ContactController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;g.processing=!1,g.stopping=!0,g.license=p,g.pid=0,g.result={finish:!1,rows:0,affectedRows:0,failedRows:0,duplicatedRows:0,errors:[]},g.contactFields=[{key:"firstName",required:!0},{key:"lastName",required:!1},{key:"phone",required:!0},{key:"mobile",required:!1},{key:"email",required:!1},{key:"dateOfBirth",required:!1},{key:"country",required:!1},{key:"city",required:!1},{key:"street",required:!1},{key:"postalCode",required:!1},{key:"fax",required:!1}],g.motionBullFields=[{key:"UserId",required:!1},{key:"scheduledat",required:!1},{key:"priority",required:!1}],g.binding={},g.duplicate=[],g.lists=s||{rows:[],count:0},g.companies=o||{rows:[],count:0},g.customFields={rows:[],count:0},g.fields=u||[],g.closeDialog=function(){d.removeAllListeners("contact:import:"+v),t.hide()},g.onChangeList=function(){return l.cmList.getCustomFields({id:g.ListId}).$promise.then(function(e){g.customFields=e}).catch(function(e){console.error(e)})},g.uploadCsv=function(){g.processing=moment(),l.cmContact.import({id:m.filename,binding:g.binding,ListId:g.ListId,CompanyId:g.CompanyId,duplicates:g.duplicates,socket_timestamp:v}).$promise.then(function(e){g.stopping=!1,e&&e.pid&&(g.pid=e.pid)}).catch(function(e){g.processing=!1,r.error({title:"Import process failed!",msg:"Please retry with a new file"})})},g.getHeaderErrors=function(){var e=u;return e.push("contact_import_error"),e},g.getArrayErrors=function(){for(var e=[],t=0;t<g.result.errors.length;t+=1){var n=g.result.errors[t].row;n.contact_import_error=g.result.errors[t].message,e.push(n)}return e},g.stopUpload=function(){if(g.stopping=!0,g.pid)return l.system.killProcess({pid:g.pid}).$promise.then(function(e){r.success({title:"CSV import process stopped!",msg:"Import has been stopped!"})}).catch(function(e){r.error({title:"CSV stop import process failed!",msg:"pid is unknown"})})};var v=moment().unix();d.on("contact:import:"+v,function(n){i(function(){if(g.result.rows=n.rows,n.errors)for(var e=0;e<n.errors.length;e++)g.result.errors.push(n.errors[e]);if(n.finish){g.result.finish=!0,g.result.affectedRows=n.affectedRows,g.result.failedRows=g.result.errors.length;var t=g.result.rows-g.result.affectedRows-g.result.errors.length;t&&0<t&&(g.duplicates.length?g.result.duplicatedRows=t:g.result.failedRows+=t),g.result.elapsed=moment().diff(g.processing,"seconds")}})}),c.$on("$destroy",function(){d.removeAllListeners("contact:import:"+v)})}e.$inject=["$cookies","$mdDialog","$interval","$q","$timeout","lists","companies","toasty","api","socket","$scope","file","fields","license"],angular.module("app.tools").controller("ImportContactsDialogController",e)}(),function(){"use strict";function e(i,e,s,t,o,n,r){var a=this;a.errors=[],a.title="CONTACTMANAGER.MERGE_CONTACT",a.contact=angular.copy(t),a.lists=n||[],a.change=function(){a.searchTerm?r.cmContact.get({fields:"id,firstName,lastName,phone,email",filter:a.searchTerm,ListId:t.ListId}).$promise.then(function(e){a.contacts=e.rows}).catch(function(e){console.error(e)}):a.contacts=[]},a.showConfirm=function(e,t,n){var a=i.confirm({skipHide:!0}).title("Would you like to merge your contacs?").textContent("All unfilled values of the contact #"+n.id+" will be overwritten by the fields of the contact #"+t.id+".").targetEvent(e).ok("Ok").cancel("Cancel");i.show(a).then(function(){return r.cmContact.merge({to:n.id,from:t.id}).$promise}).then(function(e){i.hide({new:e,to:n,from:t}),_.remove(o,{id:n.id}),_.remove(o,{id:t.id}),o.unshift(e)}).then(function(){s.success({title:"Contact properly merged!"})}).catch(function(e){e&&e.status&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:MERGE_CONTACT",msg:e.data?JSON.stringify(e.data):e.toString()})})},a.closeDialog=function(){i.hide()}}e.$inject=["$mdDialog","$scope","toasty","contact","contacts","lists","api"],angular.module("app.tools").controller("MergeContactDialogController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.globalCustomFieldForm.$pristine=!1}},g.globalCustomField=l,g.globalCustomFields=r,g.newGlobalCustomField=!1,g.globalCustomField||(g.globalCustomField={type:"text"},g.title="CONTACTMANAGER.NEW_GLOBALCUSTOMFIELD",g.newGlobalCustomField=!0),a.$watch("vm.globalCustomField.type",function(e,t){if(e!==t)switch(e){case"text":g.globalCustomField.values="";break;case"select":g.globalCustomField.values=[]}}),g.addNewGlobalCustomField=function(){g.errors=[],d.cmCustomField.save(g.globalCustomField).$promise.then(function(e){g.globalCustomFields.unshift(e.toJSON()),o.success({title:"GlobalCustomField properly created",msg:g.globalCustomField.name?g.globalCustomField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGlobalCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.globalCustomField.id},g.globalCustomField).$promise.then(function(e){var t=_.find(g.globalCustomFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"GlobalCustomField properly saved!",msg:g.globalCustomField.name?g.globalCustomField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGlobalCustomField=function(e){g.errors=[];var t=n.confirm().title("Are you sure?").content("The globalCustomField will be deleted.").ariaLabel("Delete GlobalCustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){d.cmCustomField.delete({id:g.globalCustomField.id}).$promise.then(function(){_.remove(g.globalCustomFields,{id:g.globalCustomField.id}),o.success({title:"GlobalCustomField properly deleted!",msg:(g.globalCustomField.name||"globalCustomField")+" has been deleted!"}),v(g.globalCustomField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.globalCustomFieldForm.$pristine=!1},g.removeItem=function(e,t){e.splice(t,1),a.globalCustomFieldForm.$pristine=!1},g.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.globalCustomFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","globalCustomFields","globalCustomField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditGlobalCustomFieldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.globalCustomFields=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="globalCustomFields",b.listOrder="",b.listOrderAsc=null,b.selectedGlobalCustomFields=[],b.query={fields:"createdAt,updatedAt,id,alias,type,values,required",sort:"-updatedAt",ListId:"null",limit:10,page:1},b.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{globalCustomField:e,globalCustomFields:b.globalCustomFields.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("globalCustomField")+"?").htmlContent("<b>"+(e.name||"globalCustomField")+"</b> will be deleted.").ariaLabel("delete globalCustomField").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getGlobalCustomFields=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmCustomField.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="GlobalCustomFields",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditGlobalCustomField=function(e,t){i.show({controller:"CreateOrEditGlobalCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{globalCustomField:t,globalCustomFields:b.globalCustomFields.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteGlobalCustomField=S,b.exportSelectedGlobalCustomFields=function(){var e=angular.copy(b.selectedGlobalCustomFields);return b.selectedGlobalCustomFields=[],e},b.deleteSelectedGlobalCustomFields=function(e){var t=i.confirm().title("Are you sure want to delete the selected globalCustomFields?").htmlContent("<b>"+b.selectedGlobalCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete GlobalCustomFields").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedGlobalCustomFields.forEach(function(e){S(e)}),b.selectedGlobalCustomFields=[]})},b.deselectGlobalCustomFields=function(){b.selectedGlobalCustomFields=[]},b.selectAllGlobalCustomFields=function(){b.selectedGlobalCustomFields=b.globalCustomFields.rows};var E=!0,A=1;function y(e){b.globalCustomFields=e||{count:0,rows:[]}}function S(e){m.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(b.globalCustomFields.rows,{id:e.id}),b.globalCustomFields.count-=1,b.globalCustomFields.rows.length||b.getGlobalCustomFields(),p.success({title:_.startCase("GlobalCustomField")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmCustomField"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmCustomField",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getGlobalCustomFields())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","globalCustomFields","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("GlobalCustomFieldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_LIST",g.list=angular.copy(l),g.lists=r,g.newList=!1,g.list||(g.list={},g.title="CONTACTMANAGER.NEW_LIST",g.newList=!0),g.addNewList=function(){g.errors=[],d.cmList.save(g.list).$promise.then(function(e){g.lists.unshift(e.toJSON()),o.success({title:"List properly created",msg:g.list.name?g.list.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveList=function(){g.errors=[],d.cmList.update({id:g.list.id},g.list).$promise.then(function(e){var t=_.find(g.lists,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"List properly saved!",msg:g.list.name?g.list.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteList=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The list will be deleted.").ariaLabel("Delete List").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmList.delete({id:g.list.id}).$promise.then(function(){_.remove(g.lists,{id:g.list.id}),o.success({title:"List properly deleted!",msg:(g.list.name||"list")+" has been deleted!"}),v(g.list)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmList.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmList.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","lists","list","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditListDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.cmList.getAgents({id:c.list.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserList?"penalty "+e.UserList.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.list=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.cmList.removeAgents({id:c.list.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.cmList.addAgents({id:c.list.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("CONTACTMANAGER.ALL_AGENTS"),labelSelected:r.instant("CONTACTMANAGER.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","list","lists","realtime","$translate","Auth","crudPermissions"],angular.module("app.contactmanager").controller("ListagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listCustomFields={count:0,rows:[]},c.selectedListCustomFields=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,alias,type,values,required",limit:10,page:1},c.arraytype=_.keyBy([{option:"Text",value:"'text'"},{option:"Select",value:"'select'"},{option:"Number",value:"'number'"},{option:"Switch",value:"'switch'"},{option:"Datetime",value:"'datetime'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.list=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListCustomFields()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the customField?").htmlContent("<b>"+(e.name||"customField")+"</b> will be deleted.").ariaLabel("delete customField").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListCustomFields=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getCustomFields(c.query,p).$promise},c.createOrEditListCustomField=function(e,t){s.show({controller:"CreateOrEditCustomFieldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,customField:t,customFields:c.listCustomFields.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedListCustomFields=function(){var e=angular.copy(c.selectedListCustomFields);return c.selectedListCustomFields=[],e},c.deleteListCustomField=g,c.deleteSelectedListCustomFields=function(e){var t=s.confirm().title("Are you sure want to delete the selected customFields?").htmlContent("<b>"+c.selectedListCustomFields.length+" selected</b> will be deleted.").ariaLabel("delete customFields").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedListCustomFields.forEach(function(e){g(e)}),c.selectedListCustomFields=[]})};var m=!0,u=1;function p(e){c.listCustomFields=e||{count:0,rows:[]}}function g(e){l.cmCustomField.delete({id:e.id}).$promise.then(function(){_.remove(c.listCustomFields.rows,{id:e.id}),c.listCustomFields.count-=1,c.listCustomFields.rows.length||c.getListCustomFields(),r.success({title:"CustomField deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListCustomFields())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListCustomFieldsController",e)}(),function(){"use strict";function e(a,e,t,n,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){n.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_CUSTOMFIELD",g.sortable={animation:800,sort:!0,onSort:function(e){a.customFieldForm.$pristine=!1}},g.customField=l,g.customFields=r,g.newCustomField=!1,g.customField||(g.customField={type:"text"},g.title="CONTACTMANAGER.NEW_CUSTOMFIELD",g.newCustomField=!0),e.params.id&&(g.customField.ListId=e.params.id),a.$watch("vm.customField.type",function(e,t){if(e!==t)switch(e){case"text":g.customField.values="";break;case"select":g.customField.values=[]}}),g.addNewCustomField=function(){g.errors=[],d.cmList.addCustomField({id:e.params.id},g.customField).$promise.then(function(e){g.customFields.unshift(e.toJSON()),o.success({title:"CustomField properly created",msg:g.customField.name?g.customField.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomField=function(){g.errors=[],d.cmCustomField.update({id:g.customField.id},g.customField).$promise.then(function(e){var t=_.find(g.customFields,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CustomField properly saved!",msg:g.customField.name?g.customField.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomField=function(e){g.errors=[];var t=n.confirm().title("Are you sure?").content("The customField will be deleted.").ariaLabel("Delete CustomField").ok("Delete").cancel("Cancel").targetEvent(e);n.show(t).then(function(){d.cmCustomField.delete({id:g.customField.id}).$promise.then(function(){_.remove(g.customFields,{id:g.customField.id}),o.success({title:"CustomField properly deleted!",msg:(g.customField.name||"customField")+" has been deleted!"}),v(g.customField)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmCustomField.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmCustomField.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.addItem=function(e){e.push({value:"New Item"}),a.customFieldForm.$pristine=!1},g.removeItem=function(e,t){e.splice(t,1),a.customFieldForm.$pristine=!1},g.removeItems=function(e){for(var t=e.length,n=0;n<t;n++)e.splice(0,1);a.customFieldForm.$pristine=!1},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customFields","customField","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditCustomFieldDialogController",e)}(),function(){"use strict";function e(a,e,n,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.list=c||a.params.list||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=a.params.tab||0,u.gotogoto=function(n,e){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{ListId:n.id}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:n.id})}},u.agentadddialog=function(e,t){n.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:u.lists?u.lists.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoLists=function(){a.go("app.contactmanager.lists")},u.saveList=function(){r.cmList.update({id:u.list.id},u.list).$promise.then(function(){l.success({title:"List updated!",msg:u.list.name?u.list.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","list","userProfileSection"],angular.module("app.contactmanager").controller("ListController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.list={},c.listVoiceDispositions={count:0,rows:[]},c.selectedListVoiceDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.list=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.list.id,c.query.ListId=c.list.id,c.getListVoiceDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the voiceDisposition?").htmlContent("<b>"+(e.name||"voiceDisposition")+"</b> will be deleted.").ariaLabel("delete voiceDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getListVoiceDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.cmList.getDispositions(c.query,p).$promise},c.createOrEditListVoiceDisposition=function(e,t){s.show({controller:"CreateOrEditVoiceDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:c.list,voiceDisposition:t,voiceDispositions:c.listVoiceDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedListVoiceDispositions=function(){var e=angular.copy(c.selectedListVoiceDispositions);return c.selectedListVoiceDispositions=[],e},c.deleteListVoiceDisposition=g,c.deleteSelectedListVoiceDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected voiceDispositions?").htmlContent("<b>"+c.selectedListVoiceDispositions.length+" selected</b> will be deleted.").ariaLabel("delete voiceDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedListVoiceDispositions.forEach(function(e){g(e)}),c.selectedListVoiceDispositions=[]})};var m=!0,u=1;function p(e){c.listVoiceDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.listVoiceDispositions.rows,{id:e.id}),c.listVoiceDispositions.count-=1,c.listVoiceDispositions.rows.length||c.getListVoiceDispositions(),r.success({title:"VoiceDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcmList"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getListVoiceDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.contactmanager").controller("ListVoiceDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="CONTACTMANAGER.EDIT_VOICEDISPOSITION",g.voiceDisposition=angular.copy(l),g.voiceDispositions=r,g.newVoiceDisposition=!1,g.voiceDisposition||(g.voiceDisposition={},g.title="CONTACTMANAGER.NEW_VOICEDISPOSITION",g.newVoiceDisposition=!0),t.params.id&&(g.voiceDisposition.ListId=t.params.id),g.addNewVoiceDisposition=function(){g.errors=[],d.disposition.save(g.voiceDisposition).$promise.then(function(e){g.voiceDispositions.unshift(e.toJSON()),o.success({title:"VoiceDisposition properly created",msg:g.voiceDisposition.name?g.voiceDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceDisposition=function(){g.errors=[],d.disposition.update({id:g.voiceDisposition.id},g.voiceDisposition).$promise.then(function(e){var t=_.find(g.voiceDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceDisposition properly saved!",msg:g.voiceDisposition.name?g.voiceDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceDisposition will be deleted.").ariaLabel("Delete VoiceDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.voiceDisposition.id}).$promise.then(function(){_.remove(g.voiceDispositions,{id:g.voiceDisposition.id}),o.success({title:"VoiceDisposition properly deleted!",msg:(g.voiceDisposition.name||"voiceDisposition")+" has been deleted!"}),v(g.voiceDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceDispositions","voiceDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.contactmanager").controller("CreateOrEditVoiceDispositionDialogController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.lists=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="lists",b.listOrder="",b.listOrderAsc=null,b.selectedLists=[],b.query={fields:"createdAt,updatedAt,id,name,description,dialPrefix",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){a.go("app.contactmanager.lists.edit",{id:e.id,list:e,crudPermissions:b.crudPermissions})},b.gotocontactsgoto=function(n,e){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:303}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?a.go("app.contactmanager.contacts",{ListId:n.id}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});a.go("app.contactmanager.contacts",{ListId:n.id})}},b.exportcsvcontactsexport=function(i,e){return m.cmList.getContactsCsv({id:i.id,nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download","exportContacts_"+i.id+".csv"),a.click()}else p.info({title:"EXPORT",msg:"The list is empty"})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcmList",msg:e.data?JSON.stringify(e.data):e.toString()})})},b.agentadddialog=function(e,t){i.show({controller:"ListagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{list:e,lists:b.lists?b.lists.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("list")+"?").htmlContent("<b>"+(e.name||"list")+"</b> will be deleted.").ariaLabel("delete list").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getLists=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cmList.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Lists",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditList=function(e,t){i.show({controller:"CreateOrEditListDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/lists/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{list:t,lists:b.lists.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteList=S,b.exportSelectedLists=function(){var e=angular.copy(b.selectedLists);return b.selectedLists=[],e},b.deleteSelectedLists=function(e){var t=i.confirm().title("Are you sure want to delete the selected lists?").htmlContent("<b>"+b.selectedLists.length+" selected</b> will be deleted.").ariaLabel("delete Lists").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedLists.forEach(function(e){S(e)}),b.selectedLists=[]})},b.deselectLists=function(){b.selectedLists=[]},b.selectAllLists=function(){b.selectedLists=b.lists.rows};var E=!0,A=1;function y(e){b.lists=e||{count:0,rows:[]}}function S(e){m.cmList.delete({id:e.id}).$promise.then(function(){_.remove(b.lists.rows,{id:e.id}),b.lists.count-=1,b.lists.rows.length||b.getLists(),p.success({title:_.startCase("List")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcmList"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcmList",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getLists())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","lists","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.contactmanager").controller("ListsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;d.currentUser=s.getCurrentUser(),d.userProfile=r,d.userProfileSection=l&&1==l.count?l.rows[0]:null,d.crudPermissions=s.parseCrudPermissions(d.userProfileSection?d.userProfileSection.crudPermissions:null),d.customDashboard={},d.voiceQueues=o&&o.count?o:{count:0,rows:[]},d.voiceQueuesSelected=o&&o.count?_.map(o.rows,"id"):[],d.interval=t(function(){},1e3),d.onChangeVoiceQueues=function(){for(var e=0;e<d.customDashboard.widgets.length;e+=1)d.customDashboard.widgets[e].voiceQueuesSelected=d.voiceQueuesSelected},d.goToEdit=function(){e.go("app.tools.customDashboards.edit",{id:d.customDashboard.id,tab:1})},i.onWithoutApply("voice_queue:save",function(e){var t=_.find(d.voiceQueues.rows,{id:e.id});t&&_.merge(t,_.pick(e,_.keys(t)))}),a.dashboard.get({id:e.params.id}).$promise.then(function(e){if(e)return d.customDashboard=e,d.customDashboard.widgets=[],d.customDashboard.preview=!0,d.customDashboard.draggable={enabled:!1},d.customDashboard.resizable={enabled:!1},a.dashboard.getItems({id:d.customDashboard.id}).$promise}).then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",e.rows[t].voiceQueues=d.voiceQueues,e.rows[t].voiceQueuesSelected=d.voiceQueuesSelected,d.customDashboard.widgets.push(e.rows[t])}).catch(function(e){d.customDashboard=void 0}),n.$on("$destroy",function(){i.removeAllListeners("voice_queue:save"),d.interval&&t.cancel(d.interval)})}e.$inject=["$state","$interval","$scope","api","socket","Auth","voiceQueues","userProfile","userProfileSection"],angular.module("app.dashboards.custom").controller("DashboardCustomController",e)}(),function(){"use strict";function e(e,a,i,o,s,t,l,n,r,d,c,m,u,p,g,v,h){var f=this;f.license=p,f.setting=g;function b(e){var t={};for(var n in f.tabs)f.tabs.hasOwnProperty(n)&&(t[n]=f.tabs[n],f.tabs[n].interaction&&(t[n].interaction=_.pick(f.tabs[n].interaction,["id","OpenchannelAccountId","MailAccountId","ChatWebsiteId","FaxAccountId","SmsAccountId","closed","draft"])));i.localStorage.setItem("motion2.user:"+f.user.id,JSON.stringify({tabs:t,currentTab:f.currentTab})),E(e)}function E(e){if(_.isNil(e)||e&&"interaction"===e.type){var t={id:f.user.id,online:!0,capacity:{mail:0,fax:0,sms:0,openchannel:0,chat:0},interaction:{mail:[],fax:[],sms:[],openchannel:[],chat:[]}};for(var n in f.tabs)f.tabs.hasOwnProperty(n)&&t.capacity.hasOwnProperty(f.tabs[n].channel)&&f.tabs[n].interaction&&!f.tabs[n].interaction.closed&&(t.capacity[f.tabs[n].channel]+=1,t.interaction[f.tabs[n].channel].push(f.tabs[n].interaction.id));if(!_.isEqual(f.agentCapacity,t.capacity))return f.agentCapacity=t.capacity,l.rpc.setAgentCapacity(t)}}function A(t){if(f.tabs[t.id]&&(function(e){if(e.channel&&e.interaction)l.user["remove"+_.upperFirst(e.channel)+"Interactions"]({id:f.user.id,ids:[e.interaction.id]}).$promise.catch(function(e){console.error(e)})}(f.tabs[t.id]),delete f.tabs[t.id],f.currentTab=0,b(t),"interaction"===t.type))return l[t.channel+"Interaction"].get({id:t.interaction.id}).$promise.then(function(e){return l.user["remove"+_.upperFirst(t.channel)+"Interactions"]({id:f.user.id,ids:[e.id]}).$promise}).catch(function(e){console.error(e)})}function y(e){e.id=_.random(1e10),e.openedAt=new Date,e.saved=!1,e.badges=0,f.tabs[e.id]=e,f.currentTab=e.id,b(e)}function S(t,n){var e={type:"interaction",title:t?t.toUpperCase():"openchannel",icon:function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}}(t),color:function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"grey"}}(t),channel:t,interaction:n},a=_.find(f.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id===n.id&&e.channel===t});a?f.currentTab=a.id:y(e)}function T(e){e&&e.uniqueid&&f.notifications[e.uniqueid]&&(r.clear(f.notifications[e.uniqueid]),delete f.notifications[e.uniqueid])}function I(e,t){return 0<=t&&(e.calls[t].disposedAt=new Date,n.removeAllListeners("voice_queue_channel:remove"),n.removeAllListeners("voice_outbound_channel:remove"),!0)}function C(){return function(e){if(404===e.status)r.warning({title:o.instant("DASHBOARDS.ATTENTION"),msg:o.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}f.detectBrowser=h.detectBrowser(),f.user=t.getCurrentUser(),f.currentTab=0,f.notifications={},f.tabs={},f.agentCapacity={},f.globalUserLists=d||{count:0,rows:[]},f.globalLists=c||{count:0,rows:[]},f.globalCompanies=m||{count:0,rows:[]},f.globalTags=u||{count:0,rows:[]},f.onContactManager=function(t){var e={ListId:t.ListId,limit:1,offset:0,sort:"-updatedAt"},n=!1,a=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum||t.uniqueid,i=t.calleridnum;_.isNil(t["xmd-contactid"])?_.isNil(t.routeId)?e.phone=t.calleridnum:(e.phone=t.destcalleridnum,a=t.destcalleridname&&"<unknown>"!==t.destcalleridname?t.destcalleridname:t.destcalleridnum||t.uniqueid,i=t.destcalleridnum):(e.id=t["xmd-contactid"],n=!0,_.isNil(t["xmd-listid"])||parseInt(t["xmd-listid"],10)===t.ListId||t["xmd-contactid2"]&&(e.id=t["xmd-contactid2"]));return l.cmContact.get(e).$promise.then(function(e){n?e&&f.addContactTab(e,t):e.count&&e.rows[0]?f.addContactTab(e.rows[0],t):f.addContactTab({firstName:a,ListId:t.ListId,phone:i},t)}).catch(C())},f.onJscripty=function(n){return l.jscriptyProject.get({id:n.ProjectId}).$promise.then(function(t){if(t){if(!_.isUndefined(n["xmd-contactid"]))return l.cmContact.get({id:n["xmd-contactid"]}).$promise.then(function(e){try{t.formData=Mustache.render(t.formData,_.merge(n,{user:f.user,contact:e}))}catch(e){console.error(e)}y({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n,contact:e})}).catch(C());try{t.formData=Mustache.render(t.formData,_.merge(n,{user:f.user}))}catch(e){console.error(e)}y({type:"jscripty",title:t.name,icon:"icon-script",color:"grey",project:t,call:n})}}).catch(C())},f.onBot=function(t){var n=t.calleridname&&"<unknown>"!==t.calleridname?t.calleridname:t.calleridnum,a=t.calleridnum;return l.squareMessage.get({fields:"id",limit:1,offset:0,uniqueid:t.uniqueid}).$promise.then(function(e){e.count&&y({type:"bot",title:n+" <"+a+">",icon:"fas fa-robot",color:"pink",data:{uniqueid:t.uniqueid}})})},f.onBrowserUrl=function(e){if(e&&e.uri)if(e.uri=_.replace(e.uri,"<%3B",""),e.uri=_.replace(e.uri,"=>%3B=",""),e.uriLocation)switch(e.uriLocation){case"0":i.open(e.uri);break;case"1":i.open(e.uri,"_blank","width="+(e.windowWidth||"800")+",height="+e.windowHeight||"600");break;default:i.open(e.uri)}else i.open(e.uri)},f.onBrowserPopup=function(e){e&&e.html&&y({type:"popup",title:e.calleridnum||"popup",icon:"icon-tablet",color:"grey",html:e.html})},f.onNotificationSave=function(e){if(e&&e.uniqueid){n=e,v.isSupported()?v.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"../../../../../../../assets/images/avatars/customer.png",body:(e=n).queue?"Queue: "+e.queue:"",focusOnclick:!0,closeOnClick:!0},v.show(e.title,t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.");var t=f.alreadyExistsTab(e);if(t){if(l[e.channel+"Message"])return f.currentTab!==t.id&&(t.badges+=1),l[e.channel+"Message"].accept({id:e.id,UserId:f.user.id}).$promise.catch(C())}else r.wait({title:e.title,msg:e.msg||"",showClose:!1,clickToClose:!1,timeout:!1,sound:e.sound,html:!0,shake:e.shake||!1,onAdd:function(){f.notifications[e.uniqueid]=this.id},onAccept:function(){if(T(e),l[e.channel+"Message"])return l[e.channel+"Message"].accept({id:e.id,UserId:f.user.id,manual:!0}).$promise.then(function(e){S(e.channel,e.interaction),r.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(C())},onReject:function(){if(T(e),l[e.channel+"Message"])return l[e.channel+"Message"].reject({id:e.id,UserId:f.user.id}).$promise.then(function(e){r.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(C())}})}var n},f.onNotificationRemove=T,f.onVoiceChannelRemove=function(t){var e=f.currentTab?f.tabs[f.currentTab]:null;e||(e=_.find(f.tabs,{calls:[{uniqueid:t.uniqueid}]}));var n=_.findLastIndex(e.calls,function(e){return e.uniqueid===t.uniqueid});if(!I(e,n)){var a=_.find(f.tabs,{calls:[{uniqueid:t.uniqueid}]});if(a){var i=_.findLastIndex(a.calls,function(e){return e.uniqueid===t.uniqueid});I(a,i)}}f.contact&&f.contact.id&&$timeout((s=t.uniqueid,o=f.contact.id,r=e,function(){var e=_.find(r.calls,function(e){return e.uniqueid===s});if(e)return l.voiceCallReport.update({id:s,ContactId:o}).$promise.catch(function(e){console.error(e)})}),1e3);var s,o,r},f.onClickTab=function(e){f.currentTab=e,b(f.tabs[e])},f.isActiveTab=function(e){return e===f.currentTab},f.alreadyExistsTab=function(t){return _.find(f.tabs,function(e){return"interaction"===e.type&&e.interaction&&e.interaction.id==t.interactionId&&e.channel==t.channel})},f.addContactTab=function(t,n){var a={type:"contact",title:t?function(e){var t="";e&&(e.firstName||e.lastName?(e.firstName&&(t+=e.firstName+" "),e.lastName&&(t+=e.lastName)):e.phone&&(t=e.phone));return t}(t):o.instant("DASHBOARDS.NEW_CONTACT"),icon:"icon-account-circle",color:"red",contact:t,userLists:d,lists:c,companies:m,tags:u,calls:n?[n]:[],autoCreate:n?n.autoCreate:0};if(n){if(n["xmd-cdrtype"]&&"dialer"===n["xmd-cdrtype"])n.answeredAt=n.agentcalledAt?moment(n.agentcalledAt,"YYYY-MM-DD HH:mm:ss").toDate():new Date;else if(n.uniqueid){var e=n.uniqueid.split(".")[0];n.answeredAt=e?new Date(1e3*parseInt(e)):new Date}(n.agentcompleteAt||n.endtime)&&(n.disposedAt=new Date)}if(t){var i=_.find(f.tabs,function(e){return e.contact&&e.contact.id?"contact"===e.type&&e.contact&&e.contact.id==t.id:"contact"===e.type&&e.contact&&e.contact.phone==t.phone});if(i){if(n)if(i.calls){var s=_.find(i.calls,function(e){return e.uniqueid===n.uniqueid});s||i.calls.push(n)}else i.calls=[n];f.currentTab=i.id}else{if(t.ListId)return l.disposition.get({ListId:t.ListId}).$promise.then(function(e){return a.dispositions=e,l.cmList.getCustomFields({id:t.ListId}).$promise}).then(function(e){a.customFields=e}).catch(C()).finally(function(){y(a)});y(a)}}else y(a)},f.addInteractionTab=S,f.addTab=y,f.removeTab=A,f.updateLocalStorage=b,f.closeTab=function(e){var t=a.confirm().title("interaction"===e.type?"Do you want to close the interaction?":"Are you sure want to close the "+e.type+"?").textContent("interaction"===e.type?"":"The "+e.type+" has been modified. Closing will lose all changes!").ariaLabel("Close Contact").ok("interaction"===e.type?"YES":"OK").cancel("interaction"===e.type?"NO":"CANCEL");{if(!e.saved)return a.show(t).then(function(){"interaction"===e.type&&a.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{user:f.user,channel:e.channel,interaction:e.interaction}}),A(e)}).catch(function(){"interaction"===e.type&&A(e)});var n=!1;if(_.forEach(e.calls,function(e){e.mandatoryDisposition&&(n=!0)}),"contact"===e.type&&0<e.calls.length){if(!n)return t._options.textContent="There is a call that hasn't been disposed yet.",a.show(t).then(function(){A(e)});alert=a.alert().title("Warning").textContent("There is a call that hasn't been disposed yet.").ok("OK"),a.show(alert).finally(function(){alert=void 0})}else A(e)}},n.on("trigger:contactmanager",f.onContactManager),n.on("trigger:jscripty",f.onJscripty),n.on("trigger:bot",f.onBot),n.on("trigger:browser:url",f.onBrowserUrl),n.on("trigger:browser:popup",f.onBrowserPopup),n.on("notification:save",f.onNotificationSave),n.on("notification:remove",f.onNotificationRemove),function(){var e=i.localStorage.getItem("motion2.user:"+f.user.id);if(e)try{e=JSON.parse(e),f.tabs=e.tabs?e.tabs:{},f.currentTab=e.currentTab?e.currentTab:0,E(f.tabs[f.currentTab])}catch(e){console.error(e)}}(),e.$on("$destroy",function(){for(var e in f.notifications)f.notifications.hasOwnProperty(e)&&T({uniqueid:e});n.removeAllListeners("trigger:contactmanager"),n.removeAllListeners("trigger:jscripty"),n.removeAllListeners("trigger:browser:url"),n.removeAllListeners("trigger:browser:popup"),n.removeAllListeners("notification:save"),n.removeAllListeners("notification:remove")})}e.$inject=["$scope","$mdDialog","$window","$translate","$document","Auth","api","socket","toasty","globalUserLists","globalLists","globalCompanies","globalTags","license","setting","desktopNotification","msUtils"],angular.module("app.dashboards").controller("AgentDashboardGeneralController",e)}(),function(){"use strict";angular.module("app.dashboards").provider("desktopNotification",function(){var f={autoClose:!0,duration:5,showOnPageHidden:!1};return{config:function(e){for(var t in e)f.hasOwnProperty(t)&&null!=e[t]&&(f[t]=e[t])},$get:["$q","$timeout","$window","PERMISSIONS",function(e,u,t,p){var g=t.Notification||t.mozNotification||t.webkitNotification;return{isSupported:v,currentPermission:h,requestPermission:function(){if(!v())return e.reject("Notification API not supported");var n=e.defer();Promise.resolve(g.requestPermission)==g.requestPermission?g.requestPermission().then(function(e){p.GRANTED===e?n.resolve(e):n.reject(e)}):g.requestPermission(function(e,t){p.GRANTED===e?n.resolve(e):n.reject(e)});return n.promise},show:function(e,t){if(t=t||{},!v()||(n=e,a=t,i=angular.isString(n),s=!a.onClick||angular.isFunction(a.onClick),!i||!s)||function(e){if(e||f.showOnPageHidden)return!(window.document.hidden||window.document.mozHidden||window.document.webkitHidden)}(t.showOnPageHidden)||h()!==p.GRANTED)return;var n,a,i,s;var o=new g(e,t),r=t.duration||f.duration,l=void 0===t.autoClose?f.autoClose:t.autoClose;o.onclick=function(){t.onClick&&t.onClick(),t.focusOnclick&&window.focus(),t.closeOnClick&&o.close()},l&&(d=o,c=r,m=1e3*c,u(d.close.bind(d),m,!1));var d,c,m;return o},permissions:{default:p.DEFAULT,granted:p.GRANTED,denied:p.DENIED}};function v(){return!(void 0===g)}function h(){return(g||{}).permission}}]}}).provider("msNavigationAgentService",function(){var r=angular.injector(["ng"]).get("$log"),l=[];function t(e,t){if(angular.isString(e)){for(var n=e.split("."),a=n[n.length-1],i=function(e){var t=l;if(1===e.length)return t;e.pop();for(var n=0;n<e.length;n++){for(var a=e[n],i=!0,s=0;s<t.length;s++)if(t[s]._id===a){t=t[s].children,i=!1;break}if(i){var o={_id:a,_path:e.join("."),title:a,weight:1,children:[]};t.push(o),t=o.children}}return t}(n),s=!1,o=0;o<i.length;o++)if(i[o]._id===a){s=i[o];break}s?(angular.extend(s,t),s.uisref=d(s)):(t.children=[],!angular.isUndefined(t.weight)&&angular.isNumber(t.weight)||(t.weight=1),t._id=a,t._path=e,t.uisref=d(t),i.push(t))}else r.error("path must be a string (eg. `dashboard.project`)")}function d(e){var t="";return angular.isDefined(e.state)&&(t=e.state,angular.isDefined(e.stateParams)&&angular.isObject(e.stateParams)&&(t=t+"("+angular.toJson(e.stateParams)+")")),t}this.saveItem=t,this.deleteItem=function(e){if(!angular.isString(e))return void r.error("path must be a string (eg. `dashboard.project`)");for(var t=l,n=e.split("."),a=0;a<n.length;a++)for(var i=n[a],s=0;s<t.length;s++)if(t[s]._id===i){if(t[s]._path===e)return t.splice(s,1),!0;t=t[s].children;break}return!1},this.$get=function(){var e={saveItem:t,getNavigation:function(e){if(e){for(var t=0;t<l.length;t++)if(l[t]._id===e)return[l[t]];return null}return l}};return e}}).constant("PERMISSIONS",{DEFAULT:"default",GRANTED:"granted",DENIED:"denied"})}(),function(){"use strict";function e(n){var a=this;a.setting={},a.messages={count:0,rows:[]},a.showInteraction=!1,a.init=function(e,t){{if(a.setting=t,a.tab=e,a.tab.saved=!0,a.tab&&a.tab.data&&a.tab.data.uniqueid)return n.squareMessage.get({uniqueid:a.tab.data.uniqueid}).$promise.then(function(e){a.messages=e}).finally(function(){a.showInteraction=!0});a.showInteraction=!0}},a.getMessagesAlignment=function(e){switch(a.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}}}e.$inject=["api"],angular.module("app.dashboards").controller("AgentGeneralBotController",e)}(),function(){"use strict";function e(o,r,n,l,d,c,t,e,a,i){var m=this;function s(e){e&&e.count&&e.rows.length&&(m.journey=_.concat(m.journey,e.rows))}m.user=t.getCurrentUser(),m.detectBrowser=i.detectBrowser(),m.journey=[],m.queryHopper={fields:"id,phone,scheduledat",sort:"-updatedAt",limit:10,page:1},m.queryFinal={fields:"uniqueid,calleridnum,statedesc,starttime,disposition",sort:"-updatedAt",limit:10,page:1},m.queryHistory={fields:"uniqueid,calleridnum,statedesc,scheduledat,starttime,endtime",sort:"-updatedAt",limit:10,page:1},m.hoppers={rows:[],count:0},m.finals={rows:[],count:0},m.histories={rows:[],count:0},m.addNewContact=function(){m.errors=[],d.cmContact.save(m.contact).$promise.then(function(e){return m.contact.id=e.id,m.newContact=!1,m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly created",msg:m.contact.firstName?m.contact.firstName+" has been created!":""})}).then(function(){return d.cmContact.setTags({id:m.contact.id,ids:m.tab.Tags}).$promise}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.saveContact=function(){m.errors=[],d.cmContact.update({id:m.contact.id},m.contact).$promise.then(function(e){return m.tab.title=e.firstName||e.phone,m.tab.contact=m.contact,l.$parent.vm.updateLocalStorage(),d.user.addContacts({id:t.getCurrentUser().id,ids:[e.id]})}).then(function(){return d.cmContact.setTags({id:m.contact.id,ids:m.tab.Tags}).$promise}).then(function(){m.detailForm.$pristine=!0,m.customFieldsForm.$pristine=!0,c.success({title:"Contact properly updated!",msg:m.contact.name?m.contact.name+" has been updated!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getCustomFields=function(e){return d.cmList.getCustomFields({id:e}).$promise.then(function(e){m.tab.customFields=e}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"LIST:GETCustomFields",msg:e.data?JSON.stringify(e.data):e.toString()})})},m.call=l.$parent.vm.call,m.disposeCall=function(e,t){if(m.newContact)return void c.error({title:"ATTENTION",msg:"Please save the contact before disposing!"});o.show({controller:"DisposeCallDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",parent:angular.element(r.body),targetEvent:t,clickOutsideToClose:!1,resolve:{globalDispositions:["apiResolver",function(e){return e.resolve("disposition@get",{MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null"})}]},locals:{dispositions:m.tab.dispositions,contact:m.contact,call:t}}).then(function(e){e&&("BLACKLIST"===e?c.success({title:a.instant("DASHBOARDS.INFO"),msg:a.instant("DASHBOARDS.CALL_DISPOSED")+" "+e}):"RECALLME"===e||"RESCHEDULE"===e||c.success({title:a.instant("DASHBOARDS.INFO"),msg:a.instant("DASHBOARDS.CALL_SAVED")})),_.remove(m.tab.calls,function(e){return e.uniqueid==t.uniqueid})})},m.duplicateContact=function(e){o.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}})},m.mergeContact=function(e){o.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(r.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:m.contact.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:t.getCurrentUser().id,fields:"id,name"})}]},locals:{contacts:[]}}).then(function(e){if(e){for(var t in l.$parent.$parent.$parent.vm.tabs)if(l.$parent.$parent.$parent.vm.tabs.hasOwnProperty(t)){var n=l.$parent.$parent.$parent.vm.tabs[t];n&&n.contact&&(e.from&&e.from.id&&e.from.id===n.contact.id&&l.$parent.$parent.$parent.vm.removeTab(n),e.to&&e.to.id&&e.to.id===n.contact.id&&l.$parent.$parent.$parent.vm.removeTab(n))}e.new&&l.$parent.$parent.$parent.vm.addContactTab(e.new)}})},m.getDateFromString=function(e){return null===e?void 0:new Date(e)},m.addJscriptyTab=function(e){try{e.formData=Mustache.render(e.formData,{contact:m.contact,user:m.user})}catch(e){console.error(e)}try{l.$parent.$parent.$parent.vm.addTab({type:"jscripty",title:e.name,icon:"icon-script",color:"grey",project:e,contact:m.contact})}catch(e){c.error({title:"ERROR OPENING JSCRIPTY PROJECT",msg:"The project cannot be started"+JSON.stringify(e)})}},m.getHoppers=function(){m.contact&&m.contact.id&&(m.queryHopper.ContactId=m.contact.id,m.queryHopper.offset=(m.queryHopper.page-1)*m.queryHopper.limit,m.promise=d.cmHopper.get(m.queryHopper,g("hoppers")).$promise)},m.getFinals=function(){m.contact&&m.contact.id&&(m.queryFinal.ContactId=m.contact.id,m.queryFinal.offset=(m.queryFinal.page-1)*m.queryFinal.limit,m.promise=d.cmHopperFinal.get(m.queryFinal,g("finals")).$promise)},m.getHistories=function(){m.contact&&m.contact.id&&(m.queryHistory.ContactId=m.contact.id,m.queryHistory.offset=(m.queryHistory.page-1)*m.queryHistory.limit,m.promise=d.cmHopperHistory.get(m.queryHistory,g("histories")).$promise)},m.getJscriptyProjects=function(){d.jscriptyProject.get({fields:"createdAt,updatedAt,id,name,description,createdAt,formData,enableUncompleteSave",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){m.jscriptyProjects=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.jscripty.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscripty.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getMailAccounts=function(){d.user.getMailAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.mailAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getFaxAccounts=function(){d.user.getFaxAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.faxAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.fax.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.fax.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getSmsAccounts=function(){d.user.getSmsAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.smsAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sms.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getOpenchannelAccounts=function(){d.user.getOpenchannelAccounts({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.openchannelAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.sms.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannel.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getChatWebsites=function(){d.user.getChatWebsites({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.chatAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.chatAccounts.account"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatAccounts.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getLists=function(){d.user.getLists({id:m.user.id,nolimit:!0}).$promise.then(function(e){m.lists=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.cm.lists"}];for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cm.lists",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.composeInteraction=function(e,i,t,n){var s=i.toLowerCase();o.show({controller:"Compose"+i+"InteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/compose"+i+"/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!1,locals:{account:t,message:{to:"mail"==s?n:n.split(",")},type:"new",interaction:{Contact:m.contact}},fullscreen:!0}).then(function(a){return d[s+"Account"].send({id:t.id},a).$promise.then(function(e){if("Mail"===i){var t=e;if(t&&t.Messages&&t.Messages.length){if(a.attachments&&a.attachments.length)for(var n=0;n<a.attachments.length;n+=1)d.attachment.update({id:a.attachments[n].id},{MailMessageId:_.head(t.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),t.closed?(t.disposition=null,o.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(r.body),clickOutsideToClose:!0,locals:{user:m.user,channel:"mail",interaction:t}})):l.$parent.vm.addInteractionTab("mail",t)}}else c.success({title:"Message properly sent!",msg:"Message has been sent!"}),l.$parent.vm.addInteractionTab(s,e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else"fax"===s?c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()}):c.error({title:e.status?"API:"+e.status+" - "+e.statusText:i.toUpperCase()+"ACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.init=function(e,t){m.tab=e,l.$watchGroup(["vm.detailForm.$pristine","vm.customFieldsForm.$pristine"],function(e){m.tab.saved=e[0]&&e[1]}),m.license=t,m.contact=m.tab.contact,m.newContact=!1,m.currentTab=0,m.contact&&m.contact.id?(d.user.addContacts({id:m.user.id,ids:[m.contact.id]}),m.contact.ListId&&(m.tab.userLists.rows=_.unionBy(m.tab.userLists.rows,_.filter(m.tab.lists.rows,{id:m.contact.ListId}),"id"),m.list=_.find(m.tab.userLists.rows,{id:m.contact.ListId})),m.getHoppers(),m.getFinals(),m.getHistories(),m.getMailAccounts(),m.getFaxAccounts(),m.getSmsAccounts(),m.getOpenchannelAccounts(),m.getChatWebsites(),m.getLists()):(m.newContact=!0,e.autoCreate&&(console.log("autoCreate"),m.addNewContact()));d.user.get({fields:"id,fullname",nolimit:!0}).$promise.then(function(e){m.users=e||{count:0,rows:[]},m.usersMap=_.mapValues(_.keyBy(m.users.rows,"id"),"fullname")}).then(function(){if(m.contact&&m.contact.id)return d.cmContact.getTags({id:m.contact.id}).$promise}).then(function(e){e&&(m.tab.Tags=_.map(e.rows,"id"))}).then(function(e){var t=["mail","chat","sms","openchannel","fax"];if(e&&e.id){for(var n=0;n<t.length;n++)d[t[n]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(s);d.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(s).catch(function(e){console.error(e)})}}(m.contact))},m.hasPermission=function(e){return t.hasPermission(e)},m.openInteraction=function(e,t){try{if(t.MailAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return l.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return l.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){c.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},m.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return function(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}(t)},m.isMyAccount=function(e){{if(e.FaxAccountId)return _.includes(_.map(m.faxAccounts?m.faxAccounts.rows:[],"id"),e.FaxAccountId);if(e.OpenchannelAccountId)return _.includes(_.map(m.openchannelAccounts?m.openchannelAccounts.rows:[],"id"),e.OpenchannelAccountId);if(e.SmsAccountId)return _.includes(_.map(m.smsAccounts?m.smsAccounts.rows:[],"id"),e.SmsAccountId);if(e.MailAccountId)return _.includes(_.map(m.mailAccounts?m.mailAccounts.rows:[],"id"),e.MailAccountId);if(e.ChatWebsiteId)return _.includes(_.map(m.chatAccounts?m.chatAccounts.rows:[],"id"),e.ChatWebsiteId);if(e.amaflags)return!0}return!1},e.on("voice_queue_channel:remove",l.$parent.vm.onVoiceChannelRemove),e.on("voice_outbound_channel:remove",l.$parent.vm.onVoiceChannelRemove),m.getJscriptyProjects(),l.$watch("currentTab",function(e,t){1===m.currentTab&&(m.getHoppers(),m.getFinals(),m.getHistories())});var u=!0,p=1;function g(t){return function(e){m[t]=e||{count:0,rows:[]}}}l.$watch("queryHopper.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryHopper.page),e!==t&&(m.queryHopper.page=1),e||(m.queryHopper.page=p),m.getHoppers())}),l.$watch("queryFinal.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryFinal.page),e!==t&&(m.queryFinal.page=1),e||(m.queryFinal.page=p),m.getFinals())}),l.$watch("queryHistory.filter",function(e,t){u?n(function(){u=!1}):(t||(p=m.queryHistory.page),e!==t&&(m.queryHistory.page=1),e||(m.queryHistory.page=p),m.getHistories())}),l.$on("$destroy",function(){})}e.$inject=["$mdDialog","$document","$timeout","$scope","api","toasty","Auth","socket","$translate","msUtils"],angular.module("app.dashboards").controller("AgentGeneralContactController",e)}(),function(){"use strict";function e(t,i,s,o,e,n,a,r,l,d){var c=this;function m(){var e=c.choice?c.choice.toLowerCase():void 0;return{id:c.call.uniqueid,disposition:c.choice,dispositionat:moment(),amd:"amd"===e,fax:"fax"===e,blacklist:"blacklist"===e,recallme:"recallme"===e,UserId:"recallme"===e?l.getCurrentUser().id:null,OwnerId:l.getCurrentUser().id}}c.choice=null,c.isReschedule=!1,c.recallme=!1,c.queueCampaigns={count:0,rows:[]},c.queueCampaign=void 0,c.dispositions=e,c.globalDispositions=n,c.contact=r,c.call=a,c.note=c.call.note||void 0,c.dialerCall=!1,c.hasBlackLists=!1,c.hopper={minDate:new Date,dateTime:new Date},c.call&&c.call.variables&&c.call.variables["xmd-voicequeueid"]?(c.dialerCall=!0,o.voiceQueue.getBlackLists({id:c.call.variables["xmd-voicequeueid"]}).$promise.then(function(e){e&&e.rows&&0<e.rows.length&&(c.hasBlackLists=!0)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.getBlackLists",msg:e.data?JSON.stringify(e.data):e.toString()})})):o.user.getQueues({id:l.getCurrentUser().id,fields:"id,name,dialActive",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){c.queueCampaigns=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),c.saveDisposition=function(e){c.choice=_.isNil(e)?c.choice:e,c.call.note=c.note,o.user.unpause({id:l.getCurrentUser().id}).$promise.then(function(e){}).catch(function(e){console.error(e)}),o.voiceCallReport.update({id:c.call.uniqueid,userDisposition:c.choice,note:c.note,UserId:l.getCurrentUser().id,ContactId:c.contact.id}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICECALLREPORT",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.voiceRecording.get({uniqueid:c.call.uniqueid}).$promise.then(function(e){if(e)for(var t=0;t<e.rows.length;t+=1)o.voiceRecording.update({id:e.rows[t].id,userDisposition:c.choice}).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEVOICERECORDING",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.dialerCall&&(o.cmHopperFinal.update(m()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERFINAL",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.cmHopperHistory.update(m()).$promise.catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECMHOPPERHISTORY",msg:e.data?JSON.stringify(e.data):e.toString()})}));if(_.isNil(c.choice))t.hide(c.choice?c.choice.toUpperCase():"");else switch(c.choice.toLowerCase()){case"blacklist":c.call&&c.call.variables&&c.call.variables["xmd-voicequeueid"]&&function(e){if(e)o.voiceQueue.getBlackLists({id:e,type:"outbound",fields:"id"}).$promise.then(function(e){var t=[];if(e&&0<e.count){for(var n=0;n<e.rows.length;n+=1){var a=angular.copy(c.contact);delete a.id,a.ListId=e.rows[n].id,t.push(o.cmContact.save(a).$promise)}return i.all(t)}s.success({title:d.instant("DASHBOARDS.INFO"),msg:d.instant("DASHBOARDS.NOTAVAILABLE")+" "+c.choice}),c.choice=void 0}).then(function(e){e&&t.hide(c.choice?c.choice.toUpperCase():"")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATEBLACKLIST",msg:e.data?JSON.stringify(e.data):e.toString()}),t.hide(c.choice?c.choice.toUpperCase():"")})}(c.call.variables["xmd-voicequeueid"]);break;case"reschedule":c.isReschedule=!0,c.recallme=!1;break;case"recallme":c.isReschedule=!0,c.recallme=!0;break;default:t.hide(c.choice?c.choice.toUpperCase():"")}},c.closeDialog=function(){t.cancel()},c.saveReschedule=function(){return c.disable=!0,o.cmHopper.save({phone:c.contact.phone,UserId:c.recallme?l.getCurrentUser().id:null,ContactId:c.contact.id,ListId:c.contact.ListId,VoiceQueueId:c.dialerCall?Number(c.call["xmd-voicequeueid"]):c.queueCampaign?c.queueCampaign.id:null,scheduledat:moment(c.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c.recallme,OwnerId:l.getCurrentUser().id}).$promise.then(function(){c.dialerCall&&o.cmHopperFinal.update({id:c.call.uniqueid,rescheduled:!0,rescheduledat:moment(c.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c.recallme}).$promise.catch(function(e){console.log(e)})}).then(function(){s.success({title:d.instant("DASHBOARDS.INFO"),msg:d.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c.recallme?d.instant("DASHBOARDS.RECALLME"):d.instant("DASHBOARDS.RESCHEDULE"))})}).catch(function(e){t.hide(c.choice?c.choice.toUpperCase():"")}).finally(function(){c.disable=!1,t.hide(c.choice?c.choice.toUpperCase():"")})}}e.$inject=["$mdDialog","$q","toasty","api","dispositions","globalDispositions","call","contact","Auth","$translate"],angular.module("app.staff").controller("DisposeCallDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.call=l,u.contact=r,u.hopper={minDate:new Date,dateTime:new Date},u.closeDialog=function(){a.cancel()},u.saveDialog=function(){return u.disable=!0,o.cmHopper.save({phone:u.contact.phone,UserId:c?d.getCurrentUser().id:null,ContactId:u.contact.id,ListId:u.contact.ListId,VoiceQueueId:Number(u.call["xmd-voicequeueid"]),scheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),priority:3,recallme:c,OwnerId:d.getCurrentUser().id}).$promise.then(function(){o.cmHopperFinal.update({id:u.call.uniqueid,rescheduled:!0,rescheduledat:moment(u.hopper.dateTime).format("YYYY-MM-DD HH:mm:ss"),recallme:c}).$promise}).then(function(){s.success({title:m.instant("DASHBOARDS.INFO"),msg:m.instant("DASHBOARDS.CALL_DISPOSED")+" "+(c?m.instant("DASHBOARDS.RECALLME"):m.instant("DASHBOARDS.RESCHEDULE"))}),a.hide()}).catch(function(e){a.cancel(e)}).finally(function(){u.disable=!1})}}e.$inject=["$scope","$state","$location","$mdDialog","$timeout","toasty","api","contact","call","Auth","recallme","$translate"],angular.module("app.staff").controller("RescheduleCallDialogController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeAbandonedController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){var e=i.localStorage.getItem("motion2.home.abandoned.bull.calls:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),o.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null"}).$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getAbandonedCalls()})}function p(e){m.abandonedCalls=e||{count:0,rows:[]},!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition={count:0,rows:[]},m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null},m.queues={},m.abandonedCalls={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.pickerModel={dateStart:null},m.getAbandonedCalls()},m.getAbandonedCalls=function(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.bull.calls:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=o.voiceQueueReport.getVoiceQueuesReport(m.query,p).$promise},m.refreshAbandonedCalls=function(){m.showTooltip=!1,m.getAbandonedCalls()},m.onInit=u,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"outbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.abandonedCalls.rows,["id",e.id]);0<=t&&_.merge(m.abandonedCalls.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),u();var g=!0,v=1;e.$watch("vm_bull.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getAbandonedCalls())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this;function u(){var e=i.localStorage.getItem("motion2.home.abandoned.voice.calls:"+m.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(m.query=_.merge(e.query,_.omit(m.query,["sort","limit","page"])),m.query=_.omit(m.query,"filter")),o.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null"}).$promise.then(function(e){m.disposition=e?e.rows:[]}).catch(function(e){console.log(e)}),o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){m.queues=e||{count:0,rows:[]},m.queuesMap=_.mapValues(_.keyBy(m.queues.rows,"name"),"name"),m.defaultQueues=m.queues.rows?_.map(m.queues.rows,"name").join(","):void 0}).catch(function(e){console.error(e)}).finally(function(){m.getAbandonedCalls()})}function p(e){m.abandonedCalls=e||{count:0,rows:[]},!1,m.refresh=!0}m.showTooltip=!1,m.refresh=!0,m.disable=[],m.disposition={count:0,rows:[]},m.currentUser=r.getCurrentUser(),m.localizationMap=c,m.pickerModel={dateStart:null},m.queues={},m.abandonedCalls={count:0,rows:[]},m.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},m.clearAll=function(){m.pickerModel={dateStart:null},m.getAbandonedCalls()},m.getAbandonedCalls=function(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.query.queue=m.query.queue||m.defaultQueues,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.abandoned.voice.calls:"+m.currentUser.id,JSON.stringify({query:_.omit(m.query,"queue")})),m.promise=o.voiceQueueReport.getVoiceQueuesReport(m.query,p).$promise},m.refreshAbandonedCalls=function(){m.showTooltip=!1,m.getAbandonedCalls()},m.onInit=u,m.reserved=function(e,t){e&&(m.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:e.assigned?m.currentUser.name:null,assigned:e.assigned,disposition:t||null}).$promise.catch(function(e){console.log(e)}).finally(function(){m.disable[e.id]=!1}))},m.onSavevoiceQueueReport=function(e){m.queuesMap&&"inbound"===e.type&&m.queuesMap[e.queue]&&(m.showTooltip=!0)},m.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(m.abandonedCalls.rows,["id",e.id]);0<=t&&_.merge(m.abandonedCalls.rows[t],e)}},m.call=e.$parent.$parent.$parent.$parent.vm.call,m.transfer=e.$parent.$parent.$parent.$parent.vm.transfer,m.webcall=e.$parent.$parent.$parent.$parent.vm.webcall,m.webtransfer=e.$parent.$parent.$parent.$parent.vm.webtransfer,l.onWithoutApply("voiceQueueReport:save",m.onSavevoiceQueueReport),l.onWithoutApply("voiceQueueReport:update",m.onUpdatevoiceQueueReport),u();var g=!0,v=1;e.$watch("vm_voice.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getAbandonedCalls())}),e.$on("$destroy",function(){l.removeAllListeners("voiceQueueReport:save"),l.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeAbandonedVoiceController",e)}(),function(){"use strict";function e(t,e,a,n,i,s,o){var r=this;r.user=i.getCurrentUser(),r.license={},r.plugin={},r.setting={},r.sidebar="dashboard",r.navigation=o.getNavigation(),r.addContactTab=t.$parent.vm.addContactTab,r.addInteractionTab=t.$parent.vm.addInteractionTab,r.init=function(e,t){r.license=e,r.setting=t;var n=a.localStorage.getItem("motion2.home:"+r.user.id);if(n)try{n=JSON.parse(n),r.sidebar=n.currentSidebarTab?n.currentSidebarTab:"dashboard"}catch(e){console.error(e),r.sidebar="dashboard"}},r.changeSidebarTab=function(e){r.sidebar=e.view,"plugin"===r.sidebar&&(r.plugin=e.stateParams,r.pluginId=e.id,t.$broadcast("pluginUpdated",{plugin:r.plugin}));a.localStorage.setItem("motion2.home:"+r.user.id,JSON.stringify({currentSidebarTab:e.view}))},r.hasPermission=function(e){return i.hasPermission(e)}}e.$inject=["$scope","$timeout","$window","api","Auth","socket","msNavigationAgentService"],angular.module("app.dashboards").controller("AgentGeneralHomeController",e)}(),function(){"use strict";function e(n,a,e,t,i,s,o,r,l,d,c){var m=this;function u(e){m.chatInteractions=e||{count:0,rows:[]};for(var t=0;t<m.chatInteractions.rows.length;t+=1)g(m.chatInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.chatAccounts.rows.length?(_.includes(_.map(m.chatAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.ChatWebsiteId=m.query.account||_.map(m.chatAccounts.rows,"id").join()):m.query.ChatWebsiteId=-1,m.query.offset=(m.query.page-1)*m.query.limit,i.localStorage.setItem("motion2.home.chat:"+m.user.id,JSON.stringify({query:m.query})),m.promise=o.chatInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=r.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.chatInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getChatInteractions=p,m.showChatInteraction=function(e,t){n.$parent.vm.addInteractionTab("chat",t)},m.downloadChatInteraction=function(e,s,t){o.chatInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="chat-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadChatInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||"");var n=e.Account?e.Account.mapKey:void 0;return t+=n&&e.Contact[n]?" <"+e.Contact[n]+">":""}return s.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===r.getCurrentUser().id?s.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return s.instant("DASHBOARDS.NOT_ASSIGNED")},m.getChatWebsiteLabel=function(e){if(e.Account)return e.Account.key;return s.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getChatInteractions()},m.onInit=function(e,t){return m.license=e,m.setting=t,o.user["get"+_.upperFirst("ChatWebsites")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.chatAccounts=e||{count:0,rows:[]},o.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return o.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=i.localStorage.getItem("motion2.home.chat:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}l.on("chatInteraction:save",m.onChatInteractionSave),l.on("chatInteraction:update",m.onChatInteractionSave),l.on("chatInteractionTags:save",m.onChatInteractionTagsSave),l.on("chatMessage:save",m.onChatMessageSave),l.on("chatMessage:update",m.onChatMessageSave),l.on("user_has_chat_interactions:save",m.onChatInteractionOpen),l.on("user_has_chat_interactions:remove",m.onChatInteractionClose),m.getChatInteractions()})},m.onChatInteractionSave=function(e){if(e){var t=_.find(m.chatInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onChatInteractionTagsSave=function(e){if(e){var t=_.find(m.chatInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onChatMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onChatInteractionOpen=function(e){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onChatInteractionClose=function(e){var t=_.find(m.chatInteractions.rows,{id:e.ChatInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=c,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getChatInteractions())}),n.$on("$destroy",function(){l.removeAllListeners("chatMessage:save"),l.removeAllListeners("chatMessage:update"),l.removeAllListeners("chatInteraction:save"),l.removeAllListeners("chatInteractionTags:save"),l.removeAllListeners("chatInteraction:update"),l.removeAllListeners("user_has_chat_interactions:save"),l.removeAllListeners("user_has_chat_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeChatController",e)}(),function(){"use strict";function e(n,t,a,i,e,s,o,r){var l=this;l.currentUser=s.getCurrentUser(),l.lists={},l.contacts={count:0,rows:[]},l.tags={count:0,rows:[]},l.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1},l.getContacts=function(){l.query.ListId=l.getListId(),l.query.offset=(l.query.page-1)*l.query.limit,r.localStorage.setItem("motion2.home.contacts:"+l.currentUser.id,JSON.stringify({query:l.query})),l.promise=o.cmContact.get(l.query,m).$promise},l.refreshContacts=function(){l.getContacts()},l.mergeContact=function(e,t){i.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.duplicateContact=function(e,t){i.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:l.currentUser.id,fields:"id,name"})}]},locals:{contacts:l.contacts.rows}})},l.openContact=function(e){return o.cmContact.get({id:e}).$promise.then(function(e){t.$parent.vm.addContactTab(e)})},l.call=t.$parent.vm.call,l.onInit=u,l.getListId=function(){var e=_.toString(l.query.ListId);if(e){var t=e.split(","),n=l.defaultLists.split(",");_.isEqual(t,n)||(1<t.length?e=l.defaultLists:_.indexOf(n,t[0])<0&&(e=l.defaultLists))}else e=l.defaultLists;return e},u();var d=!0,c=1;function m(e){l.contacts=e||{count:0,rows:[]}}function u(){var e=r.localStorage.getItem("motion2.home.contacts:"+l.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(l.query=_.merge(l.query,e.query),l.query=_.omit(l.query,"filter")),o.user.getLists({id:l.currentUser.id,fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return l.lists=e||{count:0,rows:[]},l.listsMap=_.keyBy(l.lists.rows,"id"),l.defaultLists=l.lists.rows?_.map(l.lists.rows,"id").join(","):void 0,o.tag.get().$promise}).then(function(e){l.tags=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){l.getContacts()})}t.$watch("vm.query.filter",function(e,t){d?a(function(){d=!1}):(t||(c=l.query.page),e!==t&&(l.query.page=1),e||(l.query.page=c),l.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeContactsController",e)}(),function(){"use strict";function e(e,t){var n=t(function(){},999);e.$on("$destroy",function(){n&&(t.cancel(n),n=null)})}e.$inject=["$scope","$interval"],angular.module("app.dashboards").controller("AgentHomeDashboardController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"outbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"outbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.rpc.getVoiceQueues().$promise.then(function(e){return c.rpcVoiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,{type:"outbound",queuecallerleaveAt:null}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardBullController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcChatQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.chatQueuesTotal=e.count?e.count:0,c.chatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.chatQueues,function(e,t){c.rpcChatQueues[t]&&(c.chatQueues[t].waiting=c.rpcChatQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.chatQueues={},c.chatQueuesTotal=0,c.rpcChatQueues={},c.paginatedInteractions=[],c.deleteChatQueuesWaitingInteractions=[],c.rpcChatQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"chat",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getChatQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.chatQueues[e.id]&&c.rpcChatQueues[e.id]&&(_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onSaveChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]=_.pick(e,m))},c.onUpdateChatQueue=function(e){_.isNil(e)||(c.rpcChatQueues[e.id]&&_.merge(c.rpcChatQueues[e.id],_.pick(e,m)),c.chatQueues[e.id]&&_.merge(c.chatQueues[e.id],_.pick(e,m)))},c.onRemoveChatQueue=function(e){_.isNil(e)||(delete c.rpcChatQueues[e.id],delete c.chatQueues[e.id])},c.onSaveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onRemoveUserChatQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getChatQueues()},c.onSaveChatQueueChannel=function(e){c.chatQueues[e.queue_id]&&(c.rpcChatQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveChatQueueChannel=function(e){delete c.rpcChatQueuesWaitingInteractions[e.id],u&&c.deleteChatQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("chat_queue:save",c.onSaveQueue),l.onWithoutApply("chatQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("chatQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("chatQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userChatQueue:save",c.onSaveUserChatQueue),l.onWithoutApply("userChatQueue:remove",c.onRemoveUserChatQueue),l.onWithoutApply("chat_queue_waiting_interaction:save",c.onSaveChatQueueChannel),l.onWithoutApply("chat_queue_waiting_interaction:remove",c.onRemoveChatQueueChannel),o.rpc.getChatQueues().$promise.then(function(e){c.rpcChatQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"chat"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getChatQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcChatQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteChatQueuesWaitingInteractions.length;e+=1)delete c.rpcChatQueuesWaitingInteractions[c.deleteChatQueuesWaitingInteractions[e]];u=!1,c.deleteChatQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getChatQueues())}),e.$on("$destroy",function(){l.removeAllListeners("chat_queue:save"),l.removeAllListeners("chatQueue:save"),l.removeAllListeners("chatQueue:update"),l.removeAllListeners("chatQueue:remove"),l.removeAllListeners("userChatQueue:save"),l.removeAllListeners("userChatQueue:remove"),l.removeAllListeners("chat_queue_waiting_interaction:save"),l.removeAllListeners("chat_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelChatController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcFaxQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.faxQueuesTotal=e.count?e.count:0,c.faxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.faxQueues,function(e,t){c.rpcFaxQueues[t]&&(c.faxQueues[t].waiting=c.rpcFaxQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.faxQueues={},c.faxQueuesTotal=0,c.rpcFaxQueues={},c.paginatedInteractions=[],c.deleteFaxQueuesWaitingInteractions=[],c.rpcFaxQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"fax",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getFaxQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.faxQueues[e.id]&&c.rpcFaxQueues[e.id]&&(_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onSaveFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]=_.pick(e,m))},c.onUpdateFaxQueue=function(e){_.isNil(e)||(c.rpcFaxQueues[e.id]&&_.merge(c.rpcFaxQueues[e.id],_.pick(e,m)),c.faxQueues[e.id]&&_.merge(c.faxQueues[e.id],_.pick(e,m)))},c.onRemoveFaxQueue=function(e){_.isNil(e)||(delete c.rpcFaxQueues[e.id],delete c.faxQueues[e.id])},c.onSaveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onRemoveUserFaxQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getFaxQueues()},c.onSaveFaxQueueChannel=function(e){c.faxQueues[e.queue_id]&&(c.rpcFaxQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveFaxQueueChannel=function(e){delete c.rpcFaxQueuesWaitingInteractions[e.id],u&&c.deleteFaxQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("fax_queue:save",c.onSaveQueue),l.onWithoutApply("faxQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("faxQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("faxQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userFaxQueue:save",c.onSaveUserFaxQueue),l.onWithoutApply("userFaxQueue:remove",c.onRemoveUserFaxQueue),l.onWithoutApply("fax_queue_waiting_interaction:save",c.onSaveFaxQueueChannel),l.onWithoutApply("fax_queue_waiting_interaction:remove",c.onRemoveFaxQueueChannel),o.rpc.getFaxQueues().$promise.then(function(e){c.rpcFaxQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"fax"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getFaxQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcFaxQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteFaxQueuesWaitingInteractions.length;e+=1)delete c.rpcFaxQueuesWaitingInteractions[c.deleteFaxQueuesWaitingInteractions[e]];u=!1,c.deleteFaxQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getFaxQueues())}),e.$on("$destroy",function(){l.removeAllListeners("fax_queue:save"),l.removeAllListeners("faxQueue:save"),l.removeAllListeners("faxQueue:update"),l.removeAllListeners("faxQueue:remove"),l.removeAllListeners("userFaxQueue:save"),l.removeAllListeners("userFaxQueue:remove"),l.removeAllListeners("fax_queue_waiting_interaction:save"),l.removeAllListeners("fax_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelFaxController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcMailQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.mailQueuesTotal=e.count?e.count:0,c.mailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.mailQueues,function(e,t){c.rpcMailQueues[t]&&(c.mailQueues[t].waiting=c.rpcMailQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.mailQueues={},c.mailQueuesTotal=0,c.rpcMailQueues={},c.paginatedInteractions=[],c.deleteMailQueuesWaitingInteractions=[],c.rpcMailQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"mail",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getMailQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.mailQueues[e.id]&&c.rpcMailQueues[e.id]&&(_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onSaveMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]=_.pick(e,m))},c.onUpdateMailQueue=function(e){_.isNil(e)||(c.rpcMailQueues[e.id]&&_.merge(c.rpcMailQueues[e.id],_.pick(e,m)),c.mailQueues[e.id]&&_.merge(c.mailQueues[e.id],_.pick(e,m)))},c.onRemoveMailQueue=function(e){_.isNil(e)||(delete c.rpcMailQueues[e.id],delete c.mailQueues[e.id])},c.onSaveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onRemoveUserMailQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getMailQueues()},c.onSaveMailQueueChannel=function(e){c.mailQueues[e.queue_id]&&(c.rpcMailQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveMailQueueChannel=function(e){delete c.rpcMailQueuesWaitingInteractions[e.id],u&&c.deleteMailQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("mail_queue:save",c.onSaveQueue),l.onWithoutApply("mailQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("mailQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("mailQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userMailQueue:save",c.onSaveUserMailQueue),l.onWithoutApply("userMailQueue:remove",c.onRemoveUserMailQueue),l.onWithoutApply("mail_queue_waiting_interaction:save",c.onSaveMailQueueChannel),l.onWithoutApply("mail_queue_waiting_interaction:remove",c.onRemoveMailQueueChannel),o.rpc.getMailQueues().$promise.then(function(e){c.rpcMailQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"mail"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getMailQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcMailQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteMailQueuesWaitingInteractions.length;e+=1)delete c.rpcMailQueuesWaitingInteractions[c.deleteMailQueuesWaitingInteractions[e]];u=!1,c.deleteMailQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getMailQueues())}),e.$on("$destroy",function(){l.removeAllListeners("mail_queue:save"),l.removeAllListeners("mailQueue:save"),l.removeAllListeners("mailQueue:update"),l.removeAllListeners("mailQueue:remove"),l.removeAllListeners("userMailQueue:save"),l.removeAllListeners("userMailQueue:remove"),l.removeAllListeners("mail_queue_waiting_interaction:save"),l.removeAllListeners("mail_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelMailController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcOpenchannelQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.openchannelQueuesTotal=e.count?e.count:0,c.openchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.openchannelQueues,function(e,t){c.rpcOpenchannelQueues[t]&&(c.openchannelQueues[t].waiting=c.rpcOpenchannelQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.openchannelQueues={},c.openchannelQueuesTotal=0,c.rpcOpenchannelQueues={},c.paginatedInteractions=[],c.deleteOpenchannelQueuesWaitingInteractions=[],c.rpcOpenchannelQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"openchannel",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getOpenchannelQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.openchannelQueues[e.id]&&c.rpcOpenchannelQueues[e.id]&&(_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onSaveOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]=_.pick(e,m))},c.onUpdateOpenchannelQueue=function(e){_.isNil(e)||(c.rpcOpenchannelQueues[e.id]&&_.merge(c.rpcOpenchannelQueues[e.id],_.pick(e,m)),c.openchannelQueues[e.id]&&_.merge(c.openchannelQueues[e.id],_.pick(e,m)))},c.onRemoveOpenchannelQueue=function(e){_.isNil(e)||(delete c.rpcOpenchannelQueues[e.id],delete c.openchannelQueues[e.id])},c.onSaveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onRemoveUserOpenchannelQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getOpenchannelQueues()},c.onSaveOpenchannelQueueChannel=function(e){c.openchannelQueues[e.queue_id]&&(c.rpcOpenchannelQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveOpenchannelQueueChannel=function(e){delete c.rpcOpenchannelQueuesWaitingInteractions[e.id],u&&c.deleteOpenchannelQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("openchannel_queue:save",c.onSaveQueue),l.onWithoutApply("openchannelQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("openchannelQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("openchannelQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userOpenchannelQueue:save",c.onSaveUserOpenchannelQueue),l.onWithoutApply("userOpenchannelQueue:remove",c.onRemoveUserOpenchannelQueue),l.onWithoutApply("openchannel_queue_waiting_interaction:save",c.onSaveOpenchannelQueueChannel),l.onWithoutApply("openchannel_queue_waiting_interaction:remove",c.onRemoveOpenchannelQueueChannel),o.rpc.getOpenchannelQueues().$promise.then(function(e){c.rpcOpenchannelQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"openchannel"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getOpenchannelQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcOpenchannelQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteOpenchannelQueuesWaitingInteractions.length;e+=1)delete c.rpcOpenchannelQueuesWaitingInteractions[c.deleteOpenchannelQueuesWaitingInteractions[e]];u=!1,c.deleteOpenchannelQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getOpenchannelQueues())}),e.$on("$destroy",function(){l.removeAllListeners("openchannel_queue:save"),l.removeAllListeners("openchannelQueue:save"),l.removeAllListeners("openchannelQueue:update"),l.removeAllListeners("openchannelQueue:remove"),l.removeAllListeners("userOpenchannelQueue:save"),l.removeAllListeners("userOpenchannelQueue:remove"),l.removeAllListeners("openchannel_queue_waiting_interaction:save"),l.removeAllListeners("openchannel_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelOpenchannelController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["id","name","mapAgentsId","waiting"],u=!0;function p(){var e=(c.queryChannels.page-1)*c.queryChannels.limit;c.paginatedInteractions=_.orderBy(c.rpcSmsQueuesWaitingInteractions,["joinAt"],["desc"]),c.interactions=_.drop(c.paginatedInteractions,e).slice(0,c.queryChannels.limit)}function g(e){c.smsQueuesTotal=e.count?e.count:0,c.smsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.smsQueues,function(e,t){c.rpcSmsQueues[t]&&(c.smsQueues[t].waiting=c.rpcSmsQueues[t].waiting||0)})}function v(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,g).$promise}c.smsQueues={},c.smsQueuesTotal=0,c.rpcSmsQueues={},c.paginatedInteractions=[],c.deleteSmsQueuesWaitingInteractions=[],c.rpcSmsQueuesWaitingInteractions={},c.query={id:r.getCurrentUser().id,channel:"sms",fields:"id,name,mapAgentsId,waiting",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=g,c.getSmsQueues=v,c.getSize=function(e){return _.size(e)},c.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},c.paginate=p,c.onSaveQueue=function(e){c.smsQueues[e.id]&&c.rpcSmsQueues[e.id]&&(_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onSaveSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]=_.pick(e,m))},c.onUpdateSmsQueue=function(e){_.isNil(e)||(c.rpcSmsQueues[e.id]&&_.merge(c.rpcSmsQueues[e.id],_.pick(e,m)),c.smsQueues[e.id]&&_.merge(c.smsQueues[e.id],_.pick(e,m)))},c.onRemoveSmsQueue=function(e){_.isNil(e)||(delete c.rpcSmsQueues[e.id],delete c.smsQueues[e.id])},c.onSaveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onRemoveUserSmsQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getSmsQueues()},c.onSaveSmsQueueChannel=function(e){c.smsQueues[e.queue_id]&&(c.rpcSmsQueuesWaitingInteractions[e.id]=e,p())},c.onRemoveSmsQueueChannel=function(e){delete c.rpcSmsQueuesWaitingInteractions[e.id],u&&c.deleteSmsQueuesWaitingInteractions.push(e.id);p()},l.onWithoutApply("sms_queue:save",c.onSaveQueue),l.onWithoutApply("smsQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("smsQueue:update",c.onUpdateVoiceQueue),l.onWithoutApply("smsQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("userSmsQueue:save",c.onSaveUserSmsQueue),l.onWithoutApply("userSmsQueue:remove",c.onRemoveUserSmsQueue),l.onWithoutApply("sms_queue_waiting_interaction:save",c.onSaveSmsQueueChannel),l.onWithoutApply("sms_queue_waiting_interaction:remove",c.onRemoveSmsQueueChannel),o.rpc.getSmsQueues().$promise.then(function(e){c.rpcSmsQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}).then(function(e){return o.user.getQueues({id:r.getCurrentUser().id,channel:"sms"}).$promise}).then(function(e){return c.myQueues=e.rows,o.rpc.getSmsQueuesWaitingInteractions().$promise}).then(function(e){var t=_.filter(e.rows,function(e){return _.includes(c.myQueues,{id:e.queue_id})});e.rows=t,e.count=t.length,_.merge(c.rpcSmsQueuesWaitingInteractions,e?_.keyBy(e.rows?e.rows:[],"id"):{})}).catch(function(e){console.error(e)}).finally(function(){for(var e=0;e<c.deleteSmsQueuesWaitingInteractions.length;e+=1)delete c.rpcSmsQueuesWaitingInteractions[c.deleteSmsQueuesWaitingInteractions[e]];u=!1,c.deleteSmsQueuesWaitingInteractions=[],v(),p()});var h=!0,f=1;e.$watch("vm_dc.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=f),c.getSmsQueues())}),e.$on("$destroy",function(){l.removeAllListeners("sms_queue:save"),l.removeAllListeners("smsQueue:save"),l.removeAllListeners("smsQueue:update"),l.removeAllListeners("smsQueue:remove"),l.removeAllListeners("userSmsQueue:save"),l.removeAllListeners("userSmsQueue:remove"),l.removeAllListeners("sms_queue_waiting_interaction:save"),l.removeAllListeners("sms_queue_waiting_interaction:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardMultiChannelSmsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["type","waiting","dialMethod","dialActive"];function u(e){c.voiceQueuesTotal=e.count?e.count:0,c.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{},_.forIn(c.voiceQueues,function(e,t){c.rpcVoiceQueues[t]&&(c.voiceQueues[t].waiting=c.rpcVoiceQueues[t].waiting||0)})}c.voiceQueues={},c.voiceQueuesTotal=0,c.rpcVoiceQueues={},c.getVoiceQueues={},c.rpcVoiceQueuesChannels={},c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.load=!0,c.query={id:r.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",type:"inbound",limit:10,page:1},c.queryChannels={limit:10,page:1},c.success=u,c.getVoiceQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=o.user.getQueues(c.query,u).$promise},c.getSize=function(e){return _.size(e)},c.onSaveQueue=function(e){c.voiceQueues[e.id]&&c.rpcVoiceQueues[e.id]&&(c.rpcVoiceQueues[e.id]=e,_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onSaveChannel=function(e){"inbound"===e.type&&(e.queuecallerleaveAt?(delete c.rpcVoiceQueuesChannels[e.uniqueid],c.load&&c.deleteVoiceQueuesChannels.push(e.uniqueid)):(c.rpcVoiceQueuesChannels[e.uniqueid]=e,c.load&&(c.addVoiceQueuesChannels[e.uniqueid]=e)))},c.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===r.getCurrentUser().id&&c.getVoiceQueues()},c.onSaveVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]=_.pick(e,m))},c.onUpdateVoiceQueue=function(e){_.isNil(e)||(c.rpcVoiceQueues[e.id]&&_.merge(c.rpcVoiceQueues[e.id],_.pick(e,m)),c.voiceQueues[e.id]&&_.merge(c.voiceQueues[e.id],_.pick(e,m)))},c.onRemoveVoiceQueue=function(e){_.isNil(e)||(delete c.rpcVoiceQueues[e.id],delete c.voiceQueues[e.id])},l.onWithoutApply("voice_queue:save",c.onSaveQueue),l.onWithoutApply("voice_queue_channel:save",c.onSaveChannel),l.onWithoutApply("userVoiceQueue:save",c.onUserVoiceQueue),l.onWithoutApply("userVoiceQueue:remove",c.onUserVoiceQueue),l.onWithoutApply("voiceQueue:save",c.onSaveVoiceQueue),l.onWithoutApply("voiceQueue:remove",c.onRemoveVoiceQueue),l.onWithoutApply("voiceQueue:update",c.onUpdateVoiceQueue),o.user.getQueues(c.query).$promise.then(function(e){return c.myQueues=e,o.rpc.getVoiceQueues().$promise}).then(function(e){for(var t=e.rows,n=_.keyBy(t,"id"),a=0;a<c.myQueues.count;a++){var i=c.myQueues.rows[a];c.rpcVoiceQueues[i.id]=n[i.id]}return o.rpc.getVoiceQueuesChannels().$promise}).then(function(e){c.rpcVoiceQueuesChannels=e?_.keyBy(e.rows?_.filter(e.rows,function(e){return!("inbound"!==e.type||e.queuecallerleaveAt||!_.find(c.myQueues.rows,{name:e.queue}))}):[],"uniqueid"):{}}).catch(function(e){console.error(e)}).finally(function(){_.merge(c.rpcVoiceQueuesChannels,c.addVoiceQueuesChannels);for(var e=0;e<c.deleteVoiceQueuesChannels.length;e+=1)delete c.rpcVoiceQueuesChannels[c.deleteVoiceQueuesChannels[e]];c.load=!1,c.addVoiceQueuesChannels={},c.deleteVoiceQueuesChannels=[],c.getVoiceQueues()});var p=!0,g=1;e.$watch("vm_dc.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getVoiceQueues())}),e.$on("$destroy",function(){l.removeAllListeners("voice_queue:save"),l.removeAllListeners("voice_queue_channel:save"),l.removeAllListeners("userVoiceQueue:save"),l.removeAllListeners("userVoiceQueue:remove"),l.removeAllListeners("voiceQueue:save"),l.removeAllListeners("voiceQueue:update"),l.removeAllListeners("voiceQueue:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty"],angular.module("app.dashboards").controller("AgentHomeDashboardVoiceController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.faxInteractions=e||{count:0,rows:[]};for(var t=0;t<m.faxInteractions.rows.length;t+=1)g(m.faxInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.faxAccounts.rows.length?(_.includes(_.map(m.faxAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.FaxAccountId=m.query.account||_.map(m.faxAccounts.rows,"id").join()):m.query.FaxAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.fax:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.faxInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.faxInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getFaxInteractions=p,m.showFaxInteraction=function(e,t){n.$parent.vm.addInteractionTab("fax",t)},m.downloadFaxInteraction=function(e,s,t){l.faxInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="fax-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadFaxInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.fax||"unknown")+">"}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getFaxAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getFaxInteractions()},m.composeFaxInteraction=function(e,t){i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("faxAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.faxAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.fax:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("faxInteraction:save",m.onFaxInteractionSave),d.on("faxInteraction:update",m.onFaxInteractionSave),d.on("faxInteractionTags:save",m.onFaxInteractionTagsSave),d.on("faxMessage:save",m.onFaxMessageSave),d.on("faxMessage:update",m.onFaxMessageSave),d.on("user_has_fax_interactions:save",m.onFaxInteractionOpen),d.on("user_has_fax_interactions:remove",m.onFaxInteractionClose),m.getFaxInteractions()})},m.onFaxInteractionSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onFaxInteractionTagsSave=function(e){if(e){var t=_.find(m.faxInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onFaxMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onFaxInteractionOpen=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onFaxInteractionClose=function(e){var t=_.find(m.faxInteractions.rows,{id:e.FaxInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getFaxInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("faxMessage:save"),d.removeAllListeners("faxMessage:update"),d.removeAllListeners("faxInteraction:save"),d.removeAllListeners("faxInteractionTags:save"),d.removeAllListeners("faxInteraction:update"),d.removeAllListeners("user_has_fax_interactions:save"),d.removeAllListeners("user_has_fax_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeFaxController",e)}(),function(){"use strict";function e(a,n,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.mailInteractions=e||{count:0,rows:[]};for(var t=0;t<m.mailInteractions.rows.length;t+=1)g(m.mailInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.mailAccounts.rows.length?(_.includes(_.map(m.mailAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.MailAccountId=m.query.account||_.map(m.mailAccounts.rows,"id").join()):m.query.MailAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.mail:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.mailInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.mailInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getMailInteractions=p,m.showMailInteraction=function(e,t){a.$parent.vm.addInteractionTab("mail",t)},m.downloadMailInteraction=function(e,s,t){l.mailInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="mail-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadMailInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.to&&e.Account&&e.to.indexOf(e.Account.email)<0?t=e.to:t+=" <"+(e.Contact.email||"unknown")+">",t}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getMailAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getMailInteractions()},m.composeMailInteraction=function(e,t){i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(n){return l.mailAccount.send({id:t.id},n).$promise.then(function(e){if(e&&e.Messages&&e.Messages.length){if(n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)l.attachment.update({id:n.attachments[t].id},{MailMessageId:_.head(e.Messages).id});c.success({title:"Message properly sent!",msg:"Message has been sent!"}),e.closed?(e.disposition=null,i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!0,locals:{user:m.user,channel:"mail",interaction:e}})):a.$parent.vm.addInteractionTab("mail",e)}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"MAILACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("mailAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.mailAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).then(function(){return l.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){m.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.mail:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("mailInteraction:save",m.onMailInteractionSave),d.on("mailInteraction:update",m.onMailInteractionSave),d.on("mailInteractionTags:save",m.onMailInteractionTagsSave),d.on("mailMessage:save",m.onMailMessageSave),d.on("mailMessage:update",m.onMailMessageSave),d.on("user_has_mail_interactions:save",m.onMailInteractionOpen),d.on("user_has_mail_interactions:remove",m.onMailInteractionClose),m.getMailInteractions()})},m.onMailInteractionSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onMailInteractionTagsSave=function(e){if(e){var t=_.find(m.mailInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onMailMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onMailInteractionOpen=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onMailInteractionClose=function(e){var t=_.find(m.mailInteractions.rows,{id:e.MailInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;a.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getMailInteractions())}),a.$on("$destroy",function(){d.removeAllListeners("mailMessage:save"),d.removeAllListeners("mailMessage:update"),d.removeAllListeners("mailInteraction:save"),d.removeAllListeners("mailInteractionTags:save"),d.removeAllListeners("mailInteraction:update"),d.removeAllListeners("user_has_mail_interactions:save"),d.removeAllListeners("user_has_mail_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeMailController",e)}(),function(){"use strict";function e(n,a,i,s,e,t,o){var r=this;r.currentUser=e.getCurrentUser(),r.lists={},r.contacts={count:0,rows:[]},r.tags={count:0,rows:[]},r.query={includeAll:!0,id:r.currentUser.id,sort:"-updatedAt",limit:10,page:1},r.getContacts=function(){r.query.ListId=r.getListId(),r.query.offset=(r.query.page-1)*r.query.limit,o.localStorage.setItem("motion2.home.mycontacts:"+r.currentUser.id,JSON.stringify({query:r.query})),r.promise=t.user.getContacts(r.query,c).$promise},r.refreshContacts=function(){r.getContacts()},r.mergeContact=function(e,t){s.show({controller:"MergeContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/merge/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.duplicateContact=function(e,t){s.show({controller:"DuplicateContactDialogController",controllerAs:"vm",templateUrl:"app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,resolve:{contact:["apiResolver",function(e){return e.resolve("cmContact@get",{id:t.id})}],lists:["apiResolver",function(e){return e.resolve("user@getLists",{id:r.currentUser.id,fields:"id,name"})}]},locals:{contacts:r.contacts.rows}})},r.openContact=function(e,t){a.$parent.vm.addContactTab(t)},r.call=a.$parent.vm.call,r.onInit=function(){var e=o.localStorage.getItem("motion2.home.mycontacts:"+r.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(r.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}t.cmList.get({fields:"id,name,dialPrefix",sort:"name",nolimit:!0}).$promise.then(function(e){return r.lists=e||{count:0,rows:[]},r.listsMap=_.keyBy(r.lists.rows,"id"),r.defaultLists=r.lists.rows?_.map(r.lists.rows,"id").join(","):void 0,t.tag.get().$promise}).then(function(e){r.tags=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){r.getContacts()})},r.getListId=function(){var e=_.toString(r.query.ListId);if(e){var t=e.split(","),n=r.defaultLists.split(",");_.isEqual(t,n)||(1<t.length?e=r.defaultLists:_.indexOf(n,t[0])<0&&(e=r.defaultLists))}else e=r.defaultLists;return e};var l=!0,d=1;function c(e){r.contacts=e||{count:0,rows:[]}}a.$watch("vm.query.filter",function(e,t){l?i(function(){l=!1}):(t||(d=r.query.page),e!==t&&(r.query.page=1),e||(r.query.page=d),r.getContacts())})}e.$inject=["$document","$scope","$timeout","$mdDialog","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomeMyContactsController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.openchannelInteractions=e||{count:0,rows:[]};for(var t=0;t<m.openchannelInteractions.rows.length;t+=1)g(m.openchannelInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.openchannelAccounts.rows.length?(_.includes(_.map(m.openchannelAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.OpenchannelAccountId=m.query.account||_.map(m.openchannelAccounts.rows,"id").join()):m.query.OpenchannelAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.openchannel:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.openchannelInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.openchannelInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getOpenchannelInteractions=p,m.showOpenchannelInteraction=function(e,t){n.$parent.vm.addInteractionTab("openchannel",t)},m.downloadOpenchannelInteraction=function(e,s,t){l.openchannelInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="openchannel-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadOpenchannelInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),e.from&&(t=e.from),t}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getOpenchannelAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getOpenchannelInteractions()},m.composeOpenchannelInteraction=function(e,t){i.show({controller:"ComposeOpenchannelInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeOpenchannel/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.openchannelAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("openchannel",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"OPENCHANNELACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("openchannelAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.openchannelAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.openchannel:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("openchannelInteraction:save",m.onOpenchannelInteractionSave),d.on("openchannelInteraction:update",m.onOpenchannelInteractionSave),d.on("openchannelInteractionTags:save",m.onOpenchannelInteractionTagsSave),d.on("openchannelMessage:save",m.onOpenchannelMessageSave),d.on("openchannelMessage:update",m.onOpenchannelMessageSave),d.on("user_has_openchannel_interactions:save",m.onOpenchannelInteractionOpen),d.on("user_has_openchannel_interactions:remove",m.onOpenchannelInteractionClose),m.getOpenchannelInteractions()})},m.onOpenchannelInteractionSave=function(e){if(e){var t=_.find(m.openchannelInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onOpenchannelInteractionTagsSave=function(e){if(e){var t=_.find(m.openchannelInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onOpenchannelMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onOpenchannelInteractionOpen=function(e){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onOpenchannelInteractionClose=function(e){var t=_.find(m.openchannelInteractions.rows,{id:e.OpenchannelInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getOpenchannelInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("openchannelMessage:save"),d.removeAllListeners("openchannelMessage:update"),d.removeAllListeners("openchannelInteraction:save"),d.removeAllListeners("openchannelInteractionTags:save"),d.removeAllListeners("openchannelInteraction:update"),d.removeAllListeners("user_has_openchannel_interactions:save"),d.removeAllListeners("user_has_openchannel_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeOpenchannelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e,t,n){d.license=e,d.setting=t,d.plugin=n}d.currentUser=o.getCurrentUser(),d.plugin={},d.onInit=c,d.getTrustedURL=function(){return s.trustAsResourceUrl(d.plugin.agentUrl)},c(),t.$on("pluginUpdated",function(e,t){d.plugin=t.plugin})}e.$inject=["$document","$scope","$timeout","$mdDialog","$stateParams","$sce","Auth","api","$window"],angular.module("app.dashboards").controller("AgentHomePluginsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){p.voiceRecordings=e||{count:0,rows:[]}}p.currentUser=c.getCurrentUser(),p.voiceRecordings={},p.localizationMap=u,p.pickerModel={dateStart:null},p.table="voiceRecordings",p.query={UserId:p.currentUser.id,fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",sort:"-updatedAt",limit:10,page:1,type:null},p.downloadfile=function(i,e){return r.voiceRecording.download({id:i.id,exists:!0}).$promise.then(function(e){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download",i.uniqueid+i.format),a.click()}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceRecording",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.success=g,p.getVoiceRecordings=function(){if(p.pickerModel.dateStart){var e=moment(p.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();p.query.createdAt={$gte:p.pickerModel.dateStart,$lte:e}}else p.query.createdAt=void 0;p.query.offset=(p.query.page-1)*p.query.limit,t.localStorage.setItem("motion2.home.recordings:"+p.currentUser.id,JSON.stringify({query:p.query})),p.promise=r.voiceRecording.get(p.query,g).$promise},p.onInit=function(){var e=t.localStorage.getItem("motion2.home.recordings:"+p.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(p.query=_.omit(e.query,["filter","id"]),p.query.fields="createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,rating,audio,UserId",p.query.UserId=p.currentUser.id)}catch(e){console.error(e)}p.getVoiceRecordings()},p.clearAll=function(){p.pickerModel={dateStart:null},p.getVoiceRecordings()};var v=!0,h=1;e.$watch("vm.query.filter",function(e,t){v?o(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","api","msUtils","toasty","Auth","$translate","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeRecordingsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){d.scheduledCalls=e||{count:0,rows:[]}}d.currentUser=r.getCurrentUser(),d.priorities=["Lowest","Low","Medium","High","Highest"],d.localizationMap=l,d.pickerModel={dateStart:null},d.scheduledCalls={},d.query={id:d.currentUser.id,fields:"id,phone,scheduledat,recallme,priority,UserId,OwnerId",sort:"scheduledat",limit:10,page:1},d.queueCampaigns={rows:[],count:0},d.success=c,d.getScheduledCalls=function(){if(d.pickerModel.dateStart){var e=moment(d.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();d.query.scheduledat={$gte:d.pickerModel.dateStart,$lte:e}}else d.query.createdAt=void 0;d.query.id=d.currentUser.id,d.query.includeAll=!0,d.query.offset=(d.query.page-1)*d.query.limit,t.localStorage.setItem("motion2.home.scheduled:"+d.currentUser.id,JSON.stringify({query:d.query})),d.promise=o.user.getScheduledCalls(d.query,c).$promise},d.onInit=function(){var e=t.localStorage.getItem("motion2.home.scheduled:"+d.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(d.query=_.omit(e.query,["filter"]))}catch(e){console.error(e)}o.user.getQueues({id:r.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){d.queueCampaigns=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}).finally(function(){d.getScheduledCalls()})},d.clearAll=function(){d.pickerModel={dateStart:null},d.getScheduledCalls()},d.isDateBeforeToday=function(e){return moment(e).isBefore(moment())},d.createOrEditQueueCampaignHopper=function(e,t){a.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:null,hopper:t,hoppers:d.scheduledCalls.rows,license:null,setting:null}})},d.deleteConfirm=function(t,e){var n=a.confirm().title("Are you sure want to delete the scheduled call?").htmlContent("<b>Scheduled call</b> will be deleted.").ariaLabel("delete scheduled call").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){var e;e=t,o.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(d.scheduledCalls.rows,{id:e.id}),d.scheduledCalls.count-=1,d.scheduledCalls.rows.length||d.getScheduledCalls(),s.success({title:"Scheduled call deleted!",msg:e.name?"Scheduled call has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){d.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE_HOPPER"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETE_HOPPER",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})};var m=!0,u=1;e.$watch("vm.query.filter",function(e,t){m?n(function(){m=!1}):(t||(u=d.query.page),e!==t&&(d.query.page=1),e||(d.query.page=u),d.getScheduledCalls())})}e.$inject=["$scope","$window","$timeout","$mdDialog","$document","toasty","api","Auth","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeScheduledCallsController",e)}(),function(){"use strict";function e(n,a,i,s,o,r,l,t,d,c,e){var m=this;function u(e){m.smsInteractions=e||{count:0,rows:[]};for(var t=0;t<m.smsInteractions.rows.length;t+=1)g(m.smsInteractions.rows[t])}function p(){if(m.pickerModel.dateStart){var e=moment(m.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();m.query.createdAt={$gte:m.pickerModel.dateStart,$lte:e}}else m.query.createdAt=void 0;m.smsAccounts.rows.length?(_.includes(_.map(m.smsAccounts.rows,"id"),m.query.account)||(m.query.account=null),m.query.SmsAccountId=m.query.account||_.map(m.smsAccounts.rows,"id").join()):m.query.SmsAccountId=-1,m.query.offset=(m.query.page-1)*m.query.limit,o.localStorage.setItem("motion2.home.sms:"+m.user.id,JSON.stringify({query:m.query})),m.promise=l.smsInteraction.get(m.query,u).$promise}function g(e){e&&e.Messages?e.unread=_.filter(e.Messages||[],{direction:"in",read:!1}).length:e.unread=0}m.user=t.getCurrentUser(),m.license={},m.setting={},m.tags={count:0,rows:[]},m.smsInteractions={count:0,rows:[]},m.query={includeAll:!0,sort:"-updatedAt",limit:10,page:1,read:null,closed:null,account:null},m.success=u,m.getSmsInteractions=p,m.showSmsInteraction=function(e,t){n.$parent.vm.addInteractionTab("sms",t)},m.downloadSmsInteraction=function(e,s,t){l.smsInteraction.download({id:s.id,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="sms-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"downloadSmsInteraction",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},m.getContactLabel=function(e){if(e.Contact){var t="";return t+=(e.Contact.firstName||"")+""+(e.Contact.lastName||""),t+=" <"+(e.Contact.mobile||"unknown")+">"}return r.instant("DASHBOARDS.UNKNOWN")},m.getUserLabel=function(e){if(e.UserId)return e.UserId===t.getCurrentUser().id?r.instant("DASHBOARDS.ME"):m.usersByKey[e.UserId].fullname+" <"+m.usersByKey[e.UserId].internal+">";return r.instant("DASHBOARDS.NOT_ASSIGNED")},m.getSmsAccountLabel=function(e){if(e.Account)return e.Account.key;return r.instant("DASHBOARDS.UNKNOWN")},m.getColorByChannel=function(e){switch(e){case"chat":return"green-A700-bg";case"mail":return"teal-bg";case"sms":return"orange-bg";case"openchannel":return"amber-A200-bg";case"fax":return"blue-grey-A200-bg";default:return"white-bg"}},m.clearAll=function(){m.calendarModel={dateStart:null},m.pickerModel={dateStart:null},m.serviceModel={dateStart:null},m.getSmsInteractions()},m.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(s.body),clickOutsideToClose:!1,locals:{account:t,message:{},type:"new",interaction:{}},fullscreen:!0}).then(function(e){return l.smsAccount.send({id:t.id},e).$promise.then(function(e){c.success({title:"Message properly sent!",msg:"Message has been sent!"}),n.$parent.vm.addInteractionTab("sms",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)c.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SMSACCOUNT:SEND",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})},m.onInit=function(e,t){return m.license=e,m.setting=t,l.user["get"+_.upperFirst("smsAccounts")]({id:m.user.id,nolimit:!0}).$promise.then(function(e){return m.smsAccounts=e||{count:0,rows:[]},l.tag.get().$promise}).then(function(e){m.tags=e||{count:0,rows:[]}}).then(function(){return l.user.get({nolimit:!0,fields:"id,fullname,userpic,internal"}).$promise}).then(function(e){m.usersByKey=_.keyBy(e.rows,"id")}).catch(function(e){console.error(e)}).finally(function(){var e=o.localStorage.getItem("motion2.home.sms:"+m.user.id);if(e)try{(e=JSON.parse(e)).query&&(m.query=_.merge(m.query,e.query),m.query=_.omit(m.query,"filter"),m.query.sort&&0<=m.query.sort.indexOf("lastMessage")&&(m.query=_.omit(m.query,"sort")),m.query.includeAll=!0)}catch(e){console.error(e)}d.on("smsInteraction:save",m.onSmsInteractionSave),d.on("smsInteraction:update",m.onSmsInteractionSave),d.on("smsInteractionTags:save",m.onSmsInteractionTagsSave),d.on("smsMessage:save",m.onSmsMessageSave),d.on("smsMessage:update",m.onSmsMessageSave),d.on("user_has_sms_interactions:save",m.onSmsInteractionOpen),d.on("user_has_sms_interactions:remove",m.onSmsInteractionClose),m.getSmsInteractions()})},m.onSmsInteractionSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t?_.merge(t,_.pick(e,_.keys(t))):p(),g(e)}},m.onSmsInteractionTagsSave=function(e){if(e){var t=_.find(m.smsInteractions.rows,{id:e.id});t&&(t.Tags=e.tags||[],_.merge(t,_.pick(e,_.keys(t))))}},m.onSmsMessageSave=function(e){if(e&&!e.secret){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});if(t){var n=_.find(t.Messages,{id:e.id});n?_.merge(n,_.pick(e,_.keys(n))):(_.isNil(t.Messages)&&(t.Messages=[]),t.Messages.push(e)),g(t)}}},m.onSmsInteractionOpen=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&(_.find(t.Users,{id:e.UserId})||t.Users.push({id:e.UserId}))},m.onSmsInteractionClose=function(e){var t=_.find(m.smsInteractions.rows,{id:e.SmsInteractionId});t&&t.Users&&_.remove(t.Users,{id:e.UserId})},m.localizationMap=e,m.pickerModel={dateStart:null};var v=!0,h=1;n.$watch("vm.query.filter",function(e,t){v?a(function(){v=!1}):(t||(h=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=h),m.getSmsInteractions())}),n.$on("$destroy",function(){d.removeAllListeners("smsMessage:save"),d.removeAllListeners("smsMessage:update"),d.removeAllListeners("smsInteraction:save"),d.removeAllListeners("smsInteractionTags:save"),d.removeAllListeners("smsInteraction:update"),d.removeAllListeners("user_has_sms_interactions:save"),d.removeAllListeners("user_has_sms_interactions:remove")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","Auth","socket","toasty","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeSmsController",e)}(),function(){"use strict";function e(t,n,a,i,e,s,o,r,l,d){var c=this;function m(e){c.voiceCalls=e||{count:0,rows:[]}}c.currentUser=e.getCurrentUser(),c.voiceCalls={},c.localizationMap=d,c.pickerModel={dateStart:null},c.table="voiceCalls",c.query={UserId:c.currentUser.id,fields:"id,type,uniqueid,tag,starttime,endtime,source,destination,userDisposition,note,duration,billableseconds,answertime",sort:"-updatedAt",limit:10,page:1,type:null},c.success=m,c.getVoiceCalls=function(){if(c.pickerModel.dateStart){var e=moment(c.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();c.query.createdAt={$gte:c.pickerModel.dateStart,$lte:e}}else c.query.createdAt=void 0;c.query.offset=(c.query.page-1)*c.query.limit,o.localStorage.setItem("motion2.home.voice:"+c.currentUser.id,JSON.stringify({query:c.query})),c.promise=a.voiceCallReport.get(c.query,m).$promise},c.onInit=function(){return a.tag.get().$promise.then(function(e){c.tags=e||{count:0,rows:[]}}).catch(function(e){i.error({title:"Init error",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}),c.tags={count:0,rows:[]}}).finally(function(){var e=o.localStorage.getItem("motion2.home.voice:"+c.currentUser.id);if(e)try{(e=JSON.parse(e)).query&&(c.query=_.omit(e.query,"filter"))}catch(e){console.error(e)}c.getVoiceCalls()})},c.showDetails=function(e){t.show({controller:"AgentHomeVoiceDetailsController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{call:e}})},c.clearAll=function(){c.pickerModel={dateStart:null},c.getVoiceCalls()};var u=!0,p=1;r.$watch("vm.query.filter",function(e,t){u?l(function(){u=!1}):(t||(p=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=p),c.getVoiceCalls())})}e.$inject=["$mdDialog","$document","api","toasty","Auth","$translate","$window","$scope","$timeout","dateFilterLocalizationFactory"],angular.module("app.dashboards").controller("AgentHomeVoiceController",e)}(),function(){"use strict";function e(e,t){this.call=t,this.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","call"],angular.module("app.dashboards").controller("AgentHomeVoiceDetailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this,g=25,v=1024*g*1024;function h(){i.show({controller:"DisposeInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,locals:{user:p.user,channel:p.tab.channel,interaction:p.tab.interaction}}).then(function(e){p.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(p.tab)})}function f(e,t){p.tab.message||(p.tab.message=t),i.show({controller:"ComposeMailInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:p.tab.message,type:e,interaction:p.interaction},fullscreen:!0,skipHide:Boolean(p.tab.spy)}).then(function(t){t&&E(t),t.Interaction&&p.interaction&&p.interaction.id&&(t.Interaction.id=p.interaction.id,l.mailInteraction.update(t.Interaction).$promise.then(function(e){e&&e.closed?(p.tab.saved=!0,p.interaction.closed=!0,h()):null!==t.Interaction.substatus&&(p.tab.saved=!0,p.tab.interaction.substatus=t.Interaction.substatus,a.$parent.$parent.$parent.vm.closeTab(p.tab))}).catch(function(e){console.error(e)}))})}function b(){"mail"!==p.tab.channel&&t(function(){var e=angular.element(n.find("md-content[name*='interaction-content-"+p.tab.id+"']"));e&&e[0]&&(e[0].scrollTop=e[0].scrollHeight)},0)}function E(n){if(n)return n["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"]=p.interaction["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"],n[_.capitalize(p.tab.channel)+"InteractionId"]=p.interaction.id,n.UserId=p.user.id,n.ContactId=p.interaction.ContactId,n.direction="out",n.secret=Boolean(p.tab.spy||n.secret),l[p.tab.channel+"Message"].save(n).$promise.then(function(e){if(e&&e.id&&n.attachments&&n.attachments.length)for(var t=0;t<n.attachments.length;t+=1)l.attachment.update({id:n.attachments[t].id},{MailMessageId:e.id})}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SENDMESSAGE",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){p.tab.areaText="",b()})}function A(e){switch(e){case"chat":return"green-A700";case"mail":return"teal";case"sms":return"orange";case"openchannel":return"amber-A200";case"fax":return"blue-grey-A200";default:return"blue-A700"}}function y(e){e&&e.count&&e.rows.length&&(p.journey=_.concat(p.journey,e.rows))}p.showFooter=!1,p.showInteraction=!1,p.user=c.getCurrentUser(),p.detectBrowser=u.detectBrowser(),p.journey=[],p.acceptedMessages=[],p.omniChannels=["mail","chat","sms","openchannel","fax"],p.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:v,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},p.ngFlow={flow:{}},p.selectedMailShowDetails={},p.selectedMailShowSystemMessage={},p.setting={},p.ctrlMethods={},p.init=function(e,t){p.tab=e,p.tab.saved=!0,p.tab.badges=0,p.setting=t||{},p.tab&&p.tab.channel&&p.tab.interaction&&(p.interaction=p.tab.interaction,l[p.tab.channel+"Interaction"].get({id:p.tab.interaction.id,includeAll:!0}).$promise.then(function(e){return e&&(p.interaction=e,p.tab.interaction=e),p.tab.saved=p.interaction.closed,p.queryMessage={id:p.interaction.id,includeAll:!0},"mail"===p.tab.channel?(p.queryMessage.sort="-id",p.queryMessage.offset=0,p.queryMessage.limit=3):(p.queryMessage.sort="id",p.queryMessage.nolimit=!0),l[p.tab.channel+"Interaction"].getMessages(p.queryMessage).$promise}).then(function(e){return p.messages=e||{count:0,rows:[]},l["chat"===p.tab.channel?"chatWebsite":p.tab.channel+"Account"].get({id:p.interaction["chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId"]}).$promise}).then(function(e){if(p.account=e,p.tab.title=p.account.key||p.account.name,p.interaction.ContactId)return l.cmContact.get({id:p.interaction.ContactId}).$promise}).then(function(e){return e&&(p.contact=e),p.showInteraction=!0,p.contact?(!function(e){if(e&&e.id){for(var t=0;t<p.omniChannels.length;t++)l[p.omniChannels[t]+"Interaction"].get({ContactId:e.id,includeAll:!0}).$promise.then(y);l.voiceCallReport.get({ContactId:e.id,includeAll:!0}).$promise.then(y)}}(p.contact),p.tab.title+=" - "+p.contact.firstName):p.tab.title+=" - "+r.instant(p.tab.channel.toUpperCase()+".UNKNOWN"),l.user.get({fields:"id,fullname",nolimit:!0}).$promise}).then(function(e){p.users=e||{count:0,rows:[]},p.usersMap=_.mapValues(_.keyBy(p.users.rows,"id"),"fullname")}).then(function(){if(p.tab.channel&&p.interaction)return l.user["add"+_.upperFirst(p.tab.channel)+"Interactions"]({id:p.user.id,ids:[p.interaction.id]})}).then(function(){return l.mailSubstatus.get({nolimit:!0}).$promise}).then(function(e){p.subStatuses=e||{count:0,rows:[]}}).then(function(){return p.getMailAccounts()}).then(function(){return p.getFaxAccounts()}).then(function(){return p.getSmsAccounts()}).then(function(){return p.getOpenchannelAccounts()}).then(function(){return p.getChatWebsites()}).then(function(){return p.getLists()}).catch(function(e){console.error(e),p.showInteraction=!0}).finally(function(){!function(){if(!p.tab.spy&&!p.interaction.closed)for(var e=0;e<p.messages.rows.length;e+=1)"in"!==p.messages.rows[e].direction||p.messages.rows[e].read||(l[p.tab.channel+"Message"].accept({id:p.messages.rows[e].id,UserId:p.user.id}),p.acceptedMessages.push(p.messages.rows[e].id))}(),b(),m.on(p.tab.channel+"Message:save",p.onMessageSave),m.on(p.tab.channel+"Message:update",p.onMessageSave),m.on(p.tab.channel+"Interaction:save",p.onInteractionSave),m.on(p.tab.channel+"Interaction:update",p.onInteractionSave),m.on("user_has_"+p.tab.channel+"_interactions:save",p.onInteractionOpen),m.on("user_has_"+p.tab.channel+"_interactions:remove",p.onInteractionClose),p.tab.areaText=p.tab.areaText?p.tab.areaText:"",p.showFooter=!0}))},p.getLabelByMessage=function(e){var t="loading...";if(e)return"in"===e.direction?e.Contact?e.Contact.firstName||"Anonymous":t:e.UserId?p.usersMap?p.usersMap[e.UserId]:t:"System"},p.openContact=function(e,t){try{p.tab&&!p.tab.spy&&a.$parent.$parent.$parent.vm.addContactTab(t||p.contact)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Unable to open the contact"})}},p.openInteraction=function(e,t){try{if(t.MailAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("mail",t);if(t.ChatWebsiteId)return a.$parent.$parent.$parent.vm.addInteractionTab("chat",t);if(t.SmsAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("sms",t);if(t.OpenchannelAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("openchannel",t);if(t.FaxAccountId)return a.$parent.$parent.$parent.vm.addInteractionTab("fax",t)}catch(e){d.error({title:"ERROR OPEN INTERACTION",msg:"Customer Journey can't open the interaction"})}},p.disposeInteraction=h,p.tagInteraction=function(){i.show({controller:"TagInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!0,skipHide:Boolean(p.tab.spy),resolve:{tags:["apiResolver",function(e){return e.resolve("tag@get",{nolimit:!0,fields:"id,name,color"})}]},locals:{channel:p.tab.channel,interaction:p.tab.interaction}})},p.composeMailInteraction=function(t,e){if(e.inReplyTo){var n=_.find(p.messages.rows,{messageId:e.inReplyTo});if(!n)return l.mailMessage.get({messageId:e.inReplyTo}).$promise.then(function(e){f(t,e&&e.count?e.rows[0]:void 0)}).catch(function(e){console.error(e),f(t,void 0)});f(t,n)}else f(t,e)},p.composeFaxInteraction=function(e){var t={to:[]};t.to.push(p.contact.fax),i.show({controller:"ComposeFaxInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:t,type:e},fullscreen:!0}).then(function(e){return l.faxAccount.send({id:p.account.id},e).$promise.then(function(e){d.success({title:"Message properly sent!",msg:"Message has been sent!"}),a.$parent.vm.addInteractionTab("fax",e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:"FAX:SEND",msg:e.data?JSON.stringify(e.data):e.message||e.toString()})})})},p.composeSmsInteraction=function(e,t){i.show({controller:"ComposeSmsInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,message:t,type:e},fullscreen:!0,skipHide:Boolean(p.tab.spy)}).then(function(e){e&&E(e)})},p.transferLastMessage=function(){if(p.interaction){var e=_.findLast(p.messages.rows,function(e){return"in"===e.direction});e?i.show({controller:"TransferMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",parent:angular.element(n.body),clickOutsideToClose:!1,locals:{account:p.account,interaction:p.interaction,message:e,channel:p.tab.channel}}).then(function(e){p.tab.saved=Boolean(e),e&&a.$parent.$parent.$parent.vm.closeTab(p.tab)}):d.error({title:"Invalid transfer",msg:"Message not found!"})}},p.downloadMessage=function(s,e){p.tab.channel&&s.id&&l[p.tab.channel+"Message"].download({id:s.id,attachments:e}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=p.tab.channel+"-message"+s.id+".eml";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.downloadMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.downloadInteraction=function(s,e){p.tab.channel&&s.id&&l[p.tab.channel+"Interaction"].download({id:s.id,attachments:e}).$promise.then(function(e){var t=[e.buffer],n=p.tab.channel+"-interaction"+s.id+".zip",a=new Blob(t,{type:e.type}),i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.inteactionMessage.get",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.getMailAccounts=function(){l.user.getMailAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.mailAccounts=e||{count:0,rows:[]}})},p.getFaxAccounts=function(){l.user.getFaxAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.faxAccounts=e||{count:0,rows:[]}})},p.getSmsAccounts=function(){l.user.getSmsAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.smsAccounts=e||{count:0,rows:[]}})},p.getOpenchannelAccounts=function(){l.user.getOpenchannelAccounts({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.openchannelAccounts=e||{count:0,rows:[]}}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.mail.account"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mail.account",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.getChatWebsites=function(){l.user.getChatWebsites({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.chatAccounts=e||{count:0,rows:[]}})},p.getLists=function(){l.user.getLists({id:p.user.id,nolimit:!0}).$promise.then(function(e){p.voiceAccounts=e||{count:0,rows:[]}})},p.reply=function(e,t){if(e&&13===e.keyCode&&e.shiftKey)return;if(e&&13!==e.keyCode)return;if(""===t.trim())return;E(function(e){var t={},n="chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId";t[n]=p.interaction[n].toString(),t[_.capitalize(p.tab.channel)+"InteractionId"]=p.interaction.id,"sms"===p.tab.channel&&(t.phone=p.interaction.phone);e&&(t.UserId=p.user.id,t.ContactId=p.interaction.ContactId,t.body=e,t.createdAt=Date.now());return t}(t.replace(/\n$/,"")))},p.upload=function(){p.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},p.ngFlow.flow.upload()},p.fileAdded=function(e){if(e.size>v)return d.error({title:"File too big",msg:"The max allowed size is "+g+"MB"}),!1;return!0},p.fileSuccess=function(e,t){var n=JSON.parse(t),a=n.name;"chat"===p.tab.channel&&(a='<a href="'+(p.account.remote?p.account.remote:o.protocol()+"://"+o.host())+"/api/chat/interactions/"+p.interaction.id+"/attachment_download?attachId="+n.id+"&token="+p.account.token+'" target="_self">'+n.name+"</a>");E({body:a,AttachmentId:n.id})},p.onMessageSave=function(e){if(e&&p.interaction.id!=e[_.capitalize(p.tab.channel)+"InteractionId"])return;var t=!1;p.messages?t=_.find(p.messages.rows,{id:e.id}):p.messages={rows:[],count:0};t?_.merge(t,e):("mail"===p.tab.channel?p.messages.rows.unshift(e):p.messages.rows.push(e),b())},p.onInteractionSave=function(e){if(e&&p.interaction.id!==e.id)return;e.closed&&(p.tab.saved=!0);_.merge(p.interaction,e)},p.searchTextChange=function(t){var n=s.defer(),a=[],e={},i="chat"===p.tab.channel?"ChatWebsiteId":_.capitalize(p.tab.channel)+"AccountId";return e.filter=t,e[i]=p.account.id,l.cannedAnswer.get(e).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.user,account:p.account,interaction:p.interaction,contact:p.interaction&&p.interaction.Contact?p.interaction.Contact:{}};p.tab.areaText+=" "+e(n),p.ctrlMethods.setText(p.tab.areaText)}catch(e){p.tab.areaText+=" "+t.value,p.ctrlMethods.setText(p.tab.areaText)}p.selectedItem=null,p.changeDisplayCannedAnswerInputValue()}},p.getIconByChannel=function(e){switch(e){case"chat":return"icon-hangouts";case"mail":return"icon-email";case"sms":return"icon-message-text";case"openchannel":return"icon-google-earth";case"fax":return"icon-deskphone";default:return"icon-hangouts"}},p.getColorByChannel=A,p.getColorByItem=function(e){var t="";e.FaxAccountId?t="fax":e.OpenchannelAccountId?t="openchannel":e.SmsAccountId?t="sms":e.MailAccountId?t="mail":e.ChatWebsiteId?t="chat":e.amaflags&&(t="voice");return A(t)},p.getMessagesAlignment=function(e){if(e.secret&&p.user.id!=e.UserId)return"in";switch(p.setting.messagesAlignment){case"left":return"in"==e.direction?e.direction:"out-left-aligned";case"right":return"in"==e.direction?"in-right-aligned":e.direction;default:return e.direction}},p.displayCannedAnswerInput=!1,p.changeDisplayCannedAnswerInputValue=function(){p.displayCannedAnswerInput=!p.displayCannedAnswerInput},p.setAs=function(e){p.tab.channel&&p.interaction&&p.interaction.id&&l[p.tab.channel+"Interaction"].update({id:p.interaction.id,substatus:e}).$promise.catch(function(e){console.error(e)})},p.markAsUnread=function(){if(p.tab.channel&&p.interaction&&p.interaction.id)if(p.acceptedMessages.length)for(var e=0;e<p.acceptedMessages.length;e+=1)l[p.tab.channel+"Message"].update({id:p.acceptedMessages[e],read:!1,UserId:null});else for(var t=0;t<p.messages.rows.length;t+=1)if("in"===p.messages.rows[t].direction){p.messages.rows[t].UserId===p.user.id?l[p.tab.channel+"Message"].update({id:p.messages.rows[t].id,read:!1,UserId:null}):d.error({title:"You can't mark as unread",msg:"You are not the owner of the last message!"});break}p.tab.saved=!0,a.$parent.$parent.$parent.vm.closeTab(p.tab)},p.isMyAccount=function(e){{if(e.FaxAccountId)return _.includes(_.map(p.faxAccounts?p.faxAccounts.rows:[],"id"),e.FaxAccountId);if(e.OpenchannelAccountId)return _.includes(_.map(p.openchannelAccounts?p.openchannelAccounts.rows:[],"id"),e.OpenchannelAccountId);if(e.SmsAccountId)return _.includes(_.map(p.smsAccounts?p.smsAccounts.rows:[],"id"),e.SmsAccountId);if(e.MailAccountId)return _.includes(_.map(p.mailAccounts?p.mailAccounts.rows:[],"id"),e.MailAccountId);if(e.ChatWebsiteId)return _.includes(_.map(p.chatAccounts?p.chatAccounts.rows:[],"id"),e.ChatWebsiteId);if(e.amaflags)return!0}return!1},p.getAttachments=function(t){return l.attachment.get({MailMessageId:t.id}).$promise.then(function(e){e&&e.rows&&(t.attachments=e.rows)}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.getAttachment=function(i){return l.attachment.download({id:i.id}).$promise.then(function(e){if(e){var t=new Blob([e.buffer],{type:e.type}),n=document.createElement("a"),a=window.URL.createObjectURL(t);n.href=a,n.target="_self",n.download=i.name,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)},100)}}).catch(function(e){d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"ATTACHMENTS:GET",msg:e.data?JSON.stringify(e.data):e.toString()})})},p.htmlToPlaintext=function(e){return e?String(e).replace(/<[^>]+>/gm,""):""},p.onInteractionOpen=function(e){var t;p.interaction.id==e[_.upperFirst(p.tab.channel)+"InteractionId"]&&(p.interaction.Users&&(t=_.find(p.interaction.Users,{id:e.UserId})),t||p.interaction.Users.push({id:e.UserId}))},p.onInteractionClose=function(e){p.interaction.id==e[_.upperFirst(p.tab.channel)+"InteractionId"]&&p.interaction.Users&&_.remove(p.interaction.Users,{id:e.UserId})},p.loadNextPage=function(){var n=s.defer();if(p.queryMessage)return p.queryMessage.offset=p.messages.rows.length,l[p.tab.channel+"Interaction"].getMessages(p.queryMessage).$promise.then(function(e){for(var t=0;t<e.rows.length;t+=1)p.messages.rows.push(e.rows[t]),p.interaction.closed||"in"!==e.rows[t].direction||e.rows[t].read||(l[p.tab.channel+"Message"].accept({id:e.rows[t].id,UserId:p.user.id}),p.acceptedMessages.push(e.rows[t].id));return n.resolve(e)}).catch(function(e){return n.reject(e)});return n.reject()},p.timelineOptions={scrollEl:"#interaction-content"},a.$on("$destroy",function(){m.removeAllListeners(p.tab.channel+"Message:save"),m.removeAllListeners(p.tab.channel+"Message:update"),m.removeAllListeners(p.tab.channel+"Interaction:save"),m.removeAllListeners(p.tab.channel+"Interaction:update"),m.removeAllListeners("user_has_"+p.tab.channel+"_interactions:save"),m.removeAllListeners("user_has_"+p.tab.channel+"_interactions:remove")})}function t(a){return{scope:{ngBindHtmlUnsafe:"="},template:"<div ng-bind-html='trustedHtml'></div>",link:function(n){n.updateView=function(){var e,t=_.replace(n.ngBindHtmlUnsafe,'<div id="xm-mail-content"','<a style="cursor:pointer" class="toggle-details md-accent-color" onclick="document.getElementById(\''+(e="xm-mail-content-"+Math.floor(9999*Math.random()+1))+"').style.display='block'; this.parentNode.removeChild(this)\">See More</a><div id=\""+e+'" style="display:none"');n.trustedHtml=a.trustAsHtml(t)},n.$watch("ngBindHtmlUnsafe",function(e,t){n.updateView(e)})}}}e.$inject=["$cookies","$timeout","$document","$scope","$mdDialog","$q","$location","$translate","api","toasty","Auth","socket","msUtils"],t.$inject=["$sce"],angular.module("app.dashboards").directive("ngBindHtmlUnsafe",t).filter("getChannelByItem",function(){return function(e,t,n,a){for(var i=[],s=0;s<e.length;s+=1){var o=!0;switch(t){case"voice":o=Boolean(e[s].uniqueid);break;case"chat":o=Boolean(e[s].ChatWebsiteId);break;case"mail":o=Boolean(e[s].MailAccountId);break;case"sms":o=Boolean(e[s].SmsAccountId);break;case"fax":o=Boolean(e[s].FaxAccountId);break;case"openchannel":o=Boolean(e[s].OpenchannelAccountId);break;default:o=!0}o&&n&&a&&(o=moment(e[s].createdAt).isBetween(n,a)),o&&i.push(e[s])}return i}}).controller("AgentGeneralInteractionController",e)}(),function(){"use strict";angular.module("app.dashboards").factory("Emojis",function(){return{watchEmbedData:!1,sanitizeHtml:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank",pdf:{embed:!0},image:{embed:!0},audio:{embed:!0},basicVideo:!1,gdevAuth:"xxxxxxxx",video:{embed:!1,width:null,height:null,ytTheme:"dark",details:!1,thumbnailQuality:"medium",autoPlay:!0},twitchtvEmbed:!0,dailymotionEmbed:!0,tedEmbed:!0,dotsubEmbed:!0,liveleakEmbed:!0,ustreamEmbed:!0,soundCloudEmbed:!0,soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},spotifyEmbed:!0,tweetEmbed:!0,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},code:{highlight:!0,lineNumbers:!1},codepenEmbed:!0,codepenHeight:300,jsfiddleEmbed:!0,jsfiddleHeight:300,jsbinEmbed:!0,jsbinHeight:300,plunkerEmbed:!0,githubgistEmbed:!0,ideoneEmbed:!0,ideoneHeight:300}})}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this,m=25,u=1024*m*1024;c.separatorKeys=[a.KEY_CODE.ENTER,a.KEY_CODE.COMMA,a.KEY_CODE.TAB],c.message={from:i.localstationid,to:_.isNil(s.to)||_.isEmpty(s.to)?[]:s.to,attachments:[]},c.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:u,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},c.ngFlow={flow:{}},c.send=function(e){1===c.message.attachments.length?c.message.to.length?(s.draft=void 0,n.hide({from:c.message.from,to:c.message.to,attach:c.message.attachments.length,attachments:c.message.attachments})):l.error("To is mandatory"):l.error("Attachment is mandatory")},c.upload=function(){c.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},c.ngFlow.flow.upload()},c.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,c.message.attachments.push(t)}catch(e){console.error(e)}},c.fileAdded=function(e){var t=["pdf","tif"];if(!_.includes(t,e.getExtension()))return l.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extensions: "+t.join()}),!1;if(e.size>u)return l.error({title:"File too big",msg:"The max allowed size is "+m+"MB"}),!1;return!0},c.getContact=function(e){var t="";e.firstName&&e.firstName!==e.fax&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.fax&&(t+=e.lastName+" ");return t+="<"+e.fax+">"},c.contactSearch=function(e){return i&&i.ListId?r.cmContact.get({ListId:i.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,fax"}).$promise.then(function(e){return e.rows}):[]},c.transformContact=function(e){var t=e;if(_.isObject(e))return e.fax;if(n=t,!/[&\/\\#,()$~%.'":;*?<>{}\s\\|a-zA-Z\pS!òàùè…_§°çéì-]/.test(n))return t;var n;return l.error("Fax "+t+" is not valid"),null},c.closeDialog=function(){s.draft=c.message,n.cancel()}}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q"],angular.module("app.dashboards").controller("ComposeFaxInteractionDialogController",e)}(),function(){"use strict";function e(t,e,i,n,s,o,a,r,l,d,c,m){var u=this,p=25,g=1024*p*1024;switch(u.currentUser=c.getCurrentUser(),u.secret="note"===a,u.hiddenCC=!0,u.hiddenBCC=!0,u.verifySmtp=!0,u.errors=[],u.separatorKeys=[n.KEY_CODE.ENTER,n.KEY_CODE.COMMA,n.KEY_CODE.TAB],u.searchTextChange=function(t){var n=d.defer(),a=[];return r.cannedAnswer.get({filter:t,MailAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),r.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},u.selectedItemChange=function(t){if(t&&t.value&&u.ckEditorInstance)try{var e=_.template(t.value),n={user:u.currentUser,account:s,interaction:m,contact:m&&m.Contact?m.Contact:{}};u.ckEditorInstance.insertHtml(e(n))}catch(e){console.error(e),u.ckEditorInstance.insertHtml(t.value)}document.getElementById("html-area").focus(),u.selectedItem=null},u.onReadyEditor=function(e){try{u.ckEditorInstance=CKEDITOR.instances["html-area"]}catch(e){console.error("Unable to get Html Editor instance",e)}},_.templateSettings.interpolate=/{{([\s\S]+?)}}/g,u.fromTemplate=_.template("{{ name }} <{{ email }}>"),u.replyTemplate=_.template("On {{ date }}, at {{ time }}, {{ from }} wrote:"),u.forwardTemplate=_.template("Begin forwarded message:<br><br><strong>From:</strong> {{ from }}<br><strong>Subject:</strong> {{ subject }}<br><strong>Date:</strong> {{ date }}, at {{ time }}<br><strong>To:</strong> {{ to }}"),u.message={from:u.fromTemplate({name:s.name,email:s.email||s.Smtp.user}),to:[],cc:[],bcc:[],body:f(),type:a,attachments:[],showLastMessage:!0},u.ckeditor={skin:"office2013",startupFocus:!0,language:"en",allowedContent:!0,extraPlugins:"font,colorbutton,autogrow,autoembed,autocorrect,googlethisterm,pastebase64",toolbarGroups:[{name:"styles",groups:["styles"]},{name:"clipboard",groups:["undo"]},{name:"colors",groups:["colors"]},{name:"basicstyles",groups:["basicstyles"]},{name:"paragraph",groups:["list","indent","align"]}],autoGrow_onStartup:!0,autoGrow_minHeight:u.secret?160:300,autoGrow_maxHeight:e.innerHeight-400,autocorrect_enabled:!0,disableNativeSpellChecker:!1,font_defaultLabel:s.fontFamily?s.fontFamily.split(",")[0]:"Arial",fontSize_defaultLabel:s.fontSize||"12",removePlugins:"magicline"},u.ngFlowOptions={target:"api/attachments",singleFile:!0,maxChunkRetries:1,chunkSize:g,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},u.ngFlow={flow:{}},u.reply=function(e){angular.isDefined(o)&&(u.message.type="reply",u.message.to="in"===o.direction?o.from.split(","):o.to.split(","),u.message.subject=_.startsWith(o.subject,"Re:")?o.subject:"Re: "+o.subject,u.message.inReplyTo=o.messageId,u.message.body=o.draft&&o.draft.inReplyTo?o.draft.body:f(),u.message.attachments=o.draft?o.draft.attachments:[],e&&o.cc&&(u.hiddenCC=!1,u.message.cc=o.cc.split(",")),u.message.showLastMessage=!!o.draft&&o.draft.showLastMessage)},u.newMail=function(){angular.isDefined(o)&&(u.message.type="new",u.message.to=o.to?o.to.split(","):[])},u.forward=function(){if(angular.isDefined(o)){if(u.message.type="forward",u.message.subject=_.startsWith(o.subject,"Fwd:")?o.subject:"Fwd: "+o.subject,u.message.body=o.draft&&!o.draft.inReplyTo?o.draft.body:f(),o.Attachments&&o.Attachments.length)for(var e=0;e<o.Attachments.length;e++)u.message.attachments.push(o.Attachments[e]);u.message.showLastMessage=!!o.draft&&o.draft.showLastMessage}},u.send=function(e,t,n){if(u.message.to&&u.message.body)if(u.message.to.length)if(o.draft=void 0,_.isEmpty(u.message.subject)){var a=i.confirm({skipHide:!0}).title("Warning").textContent("This message has no subject. Are you sure you want to send it?").ariaLabel("Warning").targetEvent(e).ok("Send Anyway").cancel("Cancel");i.show(a).then(function(){v(t,n)})}else v(t,n);else l.error("To is mandatory")},u.note=function(){u.type="note",u.secret=!0,u.message.body='<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'px"><p></p></div>'},u.addNote=function(){u.message.body&&(u.message.draft=void 0,i.hide({secret:!0,body:u.message.body,attach:u.message.attachments.length,attachments:u.message.attachments}))},u.upload=function(e){u.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+t.get("motion.token")},u.ngFlow.flow.upload()},u.fileSuccess=function(e,t){try{(t=JSON.parse(t)).size=e.size,u.message.attachments.push(t)}catch(e){console.error(e)}},u.deleteAttachment=function(e){u.message.attachments=_.reject(u.message.attachments,{id:e.id}),r.attachment.delete({id:e.id}).$promise.then(function(){l.success({title:"Attachment deleted!",msg:e.name?e.name+" has been deleted!":""})})},u.fileAdded=function(e){if(e.size>g)return l.error({title:"File too big",msg:"The max allowed size is "+p+"MB"}),!1;return!0},u.getContact=function(e){var t="";e.firstName&&e.firstName!==e.email&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.email&&(t+=e.lastName+" ");return t+="<"+e.email+">"},u.contactSearch=function(e){return s&&s.ListId?r.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,email"}).$promise.then(function(e){return e.rows}):[]},u.transformContact=function(e,t){if(_.isObject(e))return e.email;if(_.isString(e)){if(h(e))return e;for(var n=e.split(","),a=0;a<n.length;a+=1)h(n[a])?_.isArray(t)&&_.indexOf(t,n[a])<0&&t.push(n[a]):l.error("Email "+n[a]+" is not valid");return null}return l.error("Email field is not valid"),null},u.closeDialog=function(){angular.isDefined(o)&&(o.draft=u.message);i.cancel()},u.loadLastMessage=function(){u.message.body+=b(u.message.type)},a){case"reply":u.reply(!1);break;case"replyAll":u.reply(!0);break;case"forward":u.forward();break;case"new":u.newMail();break;case"note":u.note()}function v(e,t){var n={from:u.message.from,to:u.message.to.join(","),cc:u.message.cc.join(","),bcc:u.message.bcc.join(","),subject:u.message.subject,body:u.message.showLastMessage?u.message.body:u.message.body+b(u.message.type),inReplyTo:u.message.inReplyTo,attach:u.message.attachments.length,attachments:u.message.attachments,Interaction:{lastMsgDirection:"out",lastMsgBody:u.message.body,substatus:t}};n.html='<div id="xm-mail-content">'+_.replace(n.body,'<div id="xm-mail-content"',"<div")+"</div>",e&&(n.Interaction.closed=!0),i.hide(n)}function h(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function f(){return'<div style="font-family:'+s.fontFamily+";font-size:"+s.fontSize+'px">'+function(){if(_.isNil(s.template))return"";try{return _.template(s.template)({user:u.currentUser,account:s,interaction:m,contact:m&&m.Contact?m.Contact:{}})}catch(e){return console.error(e),""}}()+"</div>"}function b(e){var t,n,a='<div id="xm-mail-content"><blockquote type="cite">';switch(e){case"reply":case"replyAll":a+=u.replyTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||""});break;case"forward":a+=u.forwardTemplate({date:moment(o.createdAt).format("D MMM YYYY")||"",time:moment(o.createdAt).format("HH:mm")||"",from:_.escape(o.from)||"",to:_.escape(o.to)||"",subject:_.escape(o.subject)||""})}return a+="<br><br>",a+=(t=o.body?_.replace(o.body,'<div id="xm-mail-content"',"<div"):"",(n=t.match(/\<body[^>]*\>([^]*)\<\/body/m))?n[1]:t),a+="</blockquote></div>",e?a:""}r.mailSubstatus.get({nolimit:!0}).$promise.then(function(e){u.subStatuses=e||{count:0,rows:[]}}).catch(function(e){console.error(e)}),u.secret||r.mailAccount.verifySmtp({id:s.id}).$promise.catch(function(e){u.verifySmtp=!1,u.errors.push({message:e.data,type:e.status}),u.errors.push({message:"You can't reply or send an email. Please contact the administrator!",type:"500"})})}e.$inject=["$cookies","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","Auth","interaction"],angular.module("app.dashboards").controller("ComposeMailInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,OpenchannelAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.currentUser,account:s};p.message.body+=" "+e(n),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+t.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(t=p.message.body,a.hide({to:p.message.to.join(","),body:t})):d.error("To is mandatory"));var t},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e[s.mapKey]&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e[s.mapKey]&&(t+=e.lastName+" ");return t+="<"+e[s.mapKey]+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId){var t="firstName,lastName,phone,mobile";return s.mapKey&&(t+=","+s.mapKey),l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:t}).$promise.then(function(e){return e.rows})}return[]},p.transformContact=function(e){var t=e;if(_.isObject(t))return e[s.mapKey];return t},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeOpenchannelInteractionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;switch(p.currentUser=u.getCurrentUser(),p.errors=[],p.separatorKeys=[i.KEY_CODE.ENTER,i.KEY_CODE.COMMA,i.KEY_CODE.TAB],p.searchTextChange=function(t){var n=c.defer(),a=[];return l.cannedAnswer.get({filter:t,SmsAccountId:s.id}).$promise.then(function(e){return a=_.concat(a,e.rows),l.cannedAnswer.get({filter:t}).$promise}).then(function(e){a=_.concat(a,_.filter(e.rows,function(e){return!(e.MailAccountId||e.FaxAccountId||e.SmsAccountId||e.OpenchannelAccountId||e.ChatWebsiteId)})),n.resolve(a)}).catch(function(e){n.reject(e)}),n.promise},p.selectedItemChange=function(t){if(t){try{_.templateSettings.interpolate=/{{([\s\S]+?)}}/g;var e=_.template(t.value),n={user:p.currentUser,account:s};p.message.body+=" "+e(n),p.ctrlMethods.setText(p.message.body)}catch(e){p.message.body+=" "+t.value,p.ctrlMethods.setText(p.message.body)}p.selectedItem=null}},p.note=function(){p.secret=!0},p.addNote=function(){p.message.body&&a.hide({secret:!0,body:p.message.body})},p.ctrlMethods={},p.message={from:s.phone,to:_.isNil(o.to)||_.isEmpty(o.to)?[]:o.to,body:""},p.send=function(e){p.message.to&&p.message.body&&(p.message.to.length?(t=p.message.body,a.hide({to:p.message.to.join(","),body:t})):d.error("To is mandatory"));var t},p.getContact=function(e){var t="";e.firstName&&e.firstName!==e.mobile&&(t+=e.firstName+" ");e.lastName&&e.lastName!==e.mobile&&(t+=e.lastName+" ");return t+="<"+e.mobile+">"},p.closeDialog=function(){a.cancel()},p.contactSearch=function(e){if(s&&s.ListId)return l.cmContact.get({ListId:s.ListId,nolimit:!0,filter:e,fields:"firstName,lastName,mobile"}).$promise.then(function(e){return e.rows});return[]},p.transformContact=function(e){var t=e;if(_.isObject(t))return e.mobile;if(n=t,/^(\+|\d)[0-9]{7,16}$/.test(n))return t;var n;return d.error("Mobile "+t+" is not valid"),null},r){case"note":p.note()}}e.$inject=["$cookies","$timeout","$window","$mdDialog","$mdConstant","account","message","type","api","toasty","$q","$translate","Auth"],angular.module("app.dashboards").controller("ComposeSmsInteractionDialogController",e)}(),function(){"use strict";function e(t,n,a,i,s,o){var r=this;function l(){r.mandatoryDisposition&&a.user.pause({id:o.id,type:r.mandatoryDispositionPause||"DEFAULT PAUSE"}).$promise.then(function(e){}).catch(function(e){console.error(e)})}function d(e){r.mandatoryDisposition&&a.user.unpause({id:o.id}).$promise.catch(function(e){console.error(e)}),t.hide(e)}r.errors=[],r.interaction=angular.copy(i),r.dispositions={count:0,rows:[]},r.globalDispositions={count:0,rows:[]},r.channel=s,r.apiRoute=r.channel+"Interaction",r.interaction.disposition||(r.interaction.disposition=null),r.mandatoryDisposition=!0,r.mandatoryDispositionPause="",r.saveDisposition=function(e){r.errors=[],r.interaction.UserId=o.id,r.interaction.closed=!0,r.interaction.closeReason="agent",a[r.apiRoute]?a[r.apiRoute].update(_.pick(r.interaction,["MailAccountId","FaxAccountId","SmsAccountId","ChatWebsiteId","OpenchannelAccountId","closed","closeReason","disposition","id","note","UserId"])).$promise.then(function(e){r.interaction=e,n.success({title:"Interaction properly closed!",msg:"Interaction has been closed!"})}).then(function(){d(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})}):d(!1)},r.closeDialog=d,function(){var e={fields:"id,name",sort:"name",nolimit:!0};switch(s){case"chat":e.ChatWebsiteId=i.ChatWebsiteId,a.chatWebsite.get({id:i.ChatWebsiteId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"mail":e[t=_.capitalize(s)+"AccountId"]=i[t],a.mailAccount.get({id:i.MailAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"sms":e[t=_.capitalize(s)+"AccountId"]=i[t],a.smsAccount.get({id:i.SmsAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"fax":e[t=_.capitalize(s)+"AccountId"]=i[t],a.faxAccount.get({id:i.FaxAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()});break;case"openchannel":var t;e[t=_.capitalize(s)+"AccountId"]=i[t],a.faxAccount.get({id:i.OpenchannelAccountId}).$promise.then(function(e){r.mandatoryDisposition=e.mandatoryDisposition,r.mandatoryDisposition&&(r.mandatoryDispositionPause=e.mandatoryDispositionPause.name)}).then(function(){l()})}a.disposition.get(e).$promise.then(function(e){r.dispositions=e}).catch(function(e){console.error(e)}),a.disposition.get({MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null"}).$promise.then(function(e){r.globalDispositions=e}).catch(function(e){console.error(e)})}()}e.$inject=["$mdDialog","toasty","api","interaction","channel","user"],angular.module("app.dashboards").controller("DisposeInteractionDialogController",e)}(),function(){"use strict";function e(t,n,e,a,i,s){var o=this;function r(e){t.hide(e)}o.errors=[],o.tags=s,o.interaction=angular.copy(a),o.interaction.Tags=_.map(o.interaction.Tags,function(e){return{id:e.id,name:e.name,color:e.color}}),o.channel=i,o.autocompleteRequireMatch=!0,o.saveTag=function(){{if(o.errors=[],e[o.apiRoute])return e[o.apiRoute].addTags({id:o.interaction.id,ids:_.map(o.interaction.Tags,"id")}).$promise.then(function(){n.success({title:"Interaction properly tagged!",msg:"Interaction has been tagged!"}),a.Tags=o.interaction.Tags,r(!0)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)n.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})});r(!1)}},o.closeDialog=r,o.apiRoute=o.channel+"Interaction"}e.$inject=["$mdDialog","toasty","api","interaction","channel","tags"],angular.module("app.dashboards").controller("TagInteractionDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;function d(e){t.hide(e)}l.currentUser=n.getCurrentUser(),l.channel=s.toLowerCase(),l.message=o,l.account=r,l.transfer={id:0,type:"queue"},l.agents=l.queues={count:0,rows:[]},l.queueMethod=l.channel+"Queue",l.queueNotifyMethod=l.channel+"QueueNotify",l.onTransfer=function(){d(!0),e(function(){return a.rpc["agent"===l.transfer.type?"agentNotify":l.queueNotifyMethod]({id:l.transfer.id,messageId:l.message.id,channel:l.channel}).$promise.then(function(e){i.success({title:"Trasfer properly done!",msg:"Transfer "+l.transfer.type+" has been done!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){l.errors=e.data.errors||[{message:e.toString(),type:"api.rpc.notify"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.rpc.notify",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},5e3)},l.closeDialog=d,l.init=function(){return a.user.get({fields:"id,name",role:"agent",nolimit:!0}).$promise.then(function(e){return l.agents=e||{count:0,rows:[]},a[l.queueMethod].get({fields:"id,name",nolimit:!0}).$promise}).then(function(e){l.queues=e||{count:0,rows:[]}}).catch(function(e){console.error(e)})},l.init()}e.$inject=["$mdDialog","$timeout","Auth","api","toasty","channel","message","account"],angular.module("app.dashboards").controller("TransferMessageDialogController",e)}(),function(){"use strict";function e(i,s,o,e,l,d,t,n,a,r,c){var m=this;function u(){try{i.$parent.$parent.$parent.vm.updateLocalStorage()}catch(e){d.error({title:"ERROR UPDATE LOCAL TABS",msg:"Error updating locally stored tabs"})}}function p(n,e){var r=t.getCurrentUser();l.jscriptySessionReport.save({starttime:m.starttime,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,VoiceQueueId:m.call&&m.call["xmd-voicequeueid"]?m.call["xmd-voicequeueid"]:void 0,ProjectId:m.project&&m.project.id?m.project.id:void 0,projectname:m.project&&m.project.name?m.project.name:void 0,ContactId:m.contact&&m.contact.id?m.contact.id:void 0,completed:e}).$promise.then(function(e){if(e)for(var t=m.getResponseSheetHeaders(),n=m.getResponseSheetRow(),a=m.getQuestionWithResponseList(),i=0;i<t.length;i+=1)if(!_.isEmpty(n[i])){l.jscriptyQuestionReport.save({question:t[i],answer:n[i],questionId:a[i].id,membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name});for(var s=n[i].toString().split(";"),o=0;o<s.length;o+=1)l.jscriptyAnswerReport.save({question:t[i],questionId:a[i].id,answer:s[o].trim(),membername:m.call&&m.call.membername?m.call.membername:r.name,calleridname:m.call&&m.call.calleridname?m.call.calleridname:void 0,calleridnum:m.call&&m.call.calleridnum?m.call.calleridnum:void 0,queue:m.call&&m.call.queue?m.call.queue:void 0,uniqueid:m.call&&m.call.uniqueid?m.call.uniqueid:void 0,SessionId:e.id,ProjectId:m.project.id,projectname:m.project.name})}return e}).then(function(e){e?n.resolve(!0):n.reject()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){m.errors=e.data.errors||[{message:e.toString(),type:"api.contact.save"}];for(var t=0;t<e.data.errors.length;t+=1)d.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.contact.save",msg:e.data?JSON.stringify(e.data.message):e.toString()});n.reject()})}m.formViewer={},m.showResetButton=!0,m.showIncompleteSubmitButton=!1,m.detectBrowser=c.detectBrowser(),m.onSubmit=function(e,t){var n=s.defer();if(t){var a=o.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("YES").cancel("NO");o.show(a).then(function(){p(n,!1)},function(){n.resolve()})}else p(n,!0);return n.promise.then(function(e){e&&(d.success({title:"Session saved",msg:"Your survey session has been properly saved!"}),function(e){try{i.$parent.$parent.$parent.vm.removeTab(e)}catch(e){d.error({title:"ERROR REMOVE TAB",msg:"Error while removing tab"})}}(m.tab))}).catch(function(e){d.error({title:"Session save error",msg:"There has been an error while trying to save your survey session!"})})},m.openContact=function(e,t){try{i.$parent.$parent.$parent.vm.addContactTab(t)}catch(e){d.error({title:"ERROR OPEN CONTACT",msg:"Jscripty can't open the contact"})}},m.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0},m.getResponseSheet=function(){return e.getResponseSheet(m.project.formData,m.project.responseData,!1)},m.getResponseSheetRow=function(){return e.getResponseSheetRow(m.project.formData,m.project.responseData)},m.getResponseSheetHeaders=function(){return e.getResponseSheetHeaders(m.project.formData,!1)},m.getQuestionWithResponseList=function(){return e.getQuestionWithResponseList(m.project.formData,m.project.responseData)},m.init=function(e){m.tab=e,m.tab&&(m.call=m.tab.call,m.starttime=m.tab.openedAt,m.contact=m.tab.contact,m.project=m.tab.project,m.project&&(_.isObjectLike(m.project.formData)?m.project.formData=m.project.formData:m.isJsonString(m.project.formData)?m.project.formData=JSON.parse(m.project.formData):m.project.formData=void 0,m.project.responseData=m.project.responseData||{},void 0!==m.project.currentPage&&r(function(){a.$broadcast("mwForm.pageEvents.changePage",{page:m.project.currentPage})}),i.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&(m.project.currentPage=t.currentPage.number-1,u(),m.project.enableUncompleteSave&&(1<=t.currentPage.number&&t.currentPage.number<m.project.formData.pages.length?m.showIncompleteSubmitButton=!0:m.showIncompleteSubmitButton=!1),m.project.formData&&m.project.formData.pages))for(var n=0,a=m.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&m.project.formData.pages[n].elements)for(var i=0,s=m.project.formData.pages[n].elements.length;i<s;i++)"question"===m.project.formData.pages[n].elements[i].type&&m.project.formData.pages[n].elements[i].question&&delete m.project.responseData[m.project.formData.pages[n].elements[i].question.id]})))},m.resetViewer=function(e){if(m.formViewer.reset){var t=o.confirm().title(n.instant("JSCRIPTY.DO_YOU_WANT_TO_RESET_SESSION")).content(n.instant("JSCRIPTY.ALL_SURVEY_DATA_WILL_BE_LOST")).textContent("").ariaLabel("survey").targetEvent(e).ok(n.instant("JSCRIPTY.YES")).cancel(n.instant("JSCRIPTY.NO"));o.show(t).then(function(){m.showIncompleteSubmitButton=!1,m.project.currentPage=void 0,u(),m.formViewer.reset()})}}}e.$inject=["$scope","$q","$mdDialog","mwFormResponseUtils","api","toasty","Auth","$translate","$rootScope","$timeout","msUtils"],angular.module("app.dashboards").controller("AgentGeneralJscriptyController",e)}(),function(){"use strict";function e(n,a,e,t,i){var s=this;function o(){return function(e){if(404===e.status)a.info({title:n.instant("DASHBOARDS.ATTENTION"),msg:n.instant("DASHBOARDS.ACCEPT_ELSEWHERE")});else if(e.data&&e.data.errors&&e.data.errors.length){s.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}}s.notification=e,s.user=i.getCurrentUser(),s.accept=function(e){{if(t[s.notification.channel+"Message"])return t[s.notification.channel+"Message"].accept({id:s.notification.id,UserId:s.user.id,manual:!0}).$promise.then(function(e){a.success({title:"Message properly accepted!",msg:"Message has been accepted!"})}).catch(o());a.error({title:"API:ERROR",msg:"API accept message not found: "+s.notification.channel+"Message"})}},s.reject=function(e){{if(t[s.notification.channel+"Message"])return t[s.notification.channel+"Message"].reject({id:s.notification.id,UserId:s.user.id}).$promise.then(function(e){a.success({title:"Message properly rejected!",msg:"Message has been rejected!"})}).catch(o());a.error({title:"API:ERROR",msg:"API reject message not found: "+s.notification.channel+"Message"})}}}e.$inject=["$translate","toasty","notification","api","Auth"],angular.module("app.dashboards").controller("NotificationController",e)}(),function(){"use strict";angular.module("app.dashboards").controller("AgentGeneralPopupController",function(){var t=this;t.init=function(e){t.tab=e,t.tab&&(t.tab.saved=!0,t.html=t.tab.html)}})}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&"abandoned"===e.disposition?(i.inbound.abandoned+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&!e.UserId&&e.disposition?(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)):e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.chatWebsites,{id:e.ChatWebsiteId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.chatWebsites=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateChatInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("chatInteraction:save",i.onSaveChatInteraction),t.on("chatInteraction:update",i.onUpdateChatInteraction),function(){if(0<Object.keys(i.chatWebsites).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("chatInteraction:save"),t.removeAllListeners("chatInteraction:update")})}e.$inject=["$scope","socket","chatInteractions","chatWebsites"],angular.module("app.dashboards").controller("UserChatDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){var l=this;function d(){s({queues:l.outboundQueues,rpcQueues:l.rpcQueues}).then(function(e){l.inbound=e})}function c(){o({rpcCampaigns:l.rpcCampaigns}).then(function(e){l.ivr=e})}l.outboundQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},l.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},l.rpcCampaigns=r?_.keyBy(r.rows?r.rows:[],"id"):{},l.ivr={originated:0,limitCalls:0},l.inbound={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0},l.onSaveQueue=function(e){l.outboundQueues[e.id]&&l.rpcQueues[e.id]&&(l.rpcQueues[e.id]=e)},l.onSaveCampaign=function(e){l.rpcCampaigns[e.id]&&(l.rpcCampaigns[e.id]=e)},n.onWithoutApply("voice_queue:save",l.onSaveQueue),l.interval=t(function(){d(),c()},999),n.onWithoutApply("campaign:save",l.onSaveCampaign),d(),c(),e.$on("$destroy",function(){n.removeAllListeners("voice_queue:save"),n.removeAllListeners("campaign:save"),l.interval&&t.cancel(l.interval)})}e.$inject=["$scope","$interval","socket","outboundQueues","rpcQueues","initializeRealtimeQueue","initializeRealtimeCampaign","rpcCampaigns"],angular.module("app.dashboards").controller("UserVoiceDashboardDialerController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.faxAccounts,{id:e.FaxAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.faxAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateFaxInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("faxInteraction:save",i.onSaveFaxInteraction),t.on("faxInteraction:update",i.onUpdateFaxInteraction),function(){if(0<Object.keys(i.faxAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("faxInteraction:save"),t.removeAllListeners("faxInteraction:update")})}e.$inject=["$scope","socket","faxInteractions","faxAccounts"],angular.module("app.dashboards").controller("UserFaxDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.mailAccounts,{id:e.MailAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.mailAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateMailInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("mailInteraction:save",i.onSaveMailInteraction),t.on("mailInteraction:update",i.onUpdateMailInteraction),function(){if(0<Object.keys(i.mailAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("mailInteraction:save"),t.removeAllListeners("mailInteraction:update")})}e.$inject=["$scope","socket","mailInteractions","mailAccounts"],angular.module("app.dashboards").controller("UserMailDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.openchannelAccounts,{id:e.OpenchannelAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.openchannelAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateOpenchannelInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("openchannelInteraction:save",i.onSaveOpenchannelInteraction),t.on("openchannelInteraction:update",i.onUpdateOpenchannelInteraction),function(){if(0<Object.keys(i.openchannelAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("openchannelInteraction:save"),t.removeAllListeners("openchannelInteraction:update")})}e.$inject=["$scope","socket","openchannelInteractions","openchannelAccounts"],angular.module("app.dashboards").controller("UserOpenchannelDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a){var i=this,s=[];function o(e,t){e.closed||e.UserId||!t||(i.inbound.waiting+=1),e.closed||!e.UserId||_.includes(s,e.id)||(i.inbound.talking+=1,s.push(e.id),!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),e.closed&&e.UserId&&(i.inbound.sumBillable+=moment(e.closedAt).diff(moment(e.read1stAt),i.config.unit),i.inbound.sumHoldTime+=moment(e.read1stAt).diff(moment(e.createdAt),i.config.unit),i.inbound.answered+=1,!t&&i.inbound.talking&&(i.inbound.talking-=1)),e.closed&&!e.UserId&&(i.inbound.unmanaged+=1,!t&&i.inbound.waiting&&(i.inbound.waiting-=1)),t&&(i.inbound.total+=1)}function r(){i.inbound.abandonRate=Math.round((i.inbound.abandoned+i.inbound.unmanaged)/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.answerRate=Math.round(i.inbound.answered/(i.inbound.total-i.inbound.talking-i.inbound.waiting)*100,-2),i.inbound.avgHoldTime=moment.duration(Math.round(i.inbound.sumHoldTime/i.inbound.answered),i.config.unit).format(i.config.format,i.config),i.inbound.avgTalkTime=moment.duration(Math.round(i.inbound.sumBillable/i.inbound.answered),i.config.unit).format(i.config.format,i.config)}function l(e){return!!_.some(i.smsAccounts,{id:e.SmsAccountId})}function d(e){return moment(e).isBetween(moment().startOf("day").toString(),moment().endOf("day").toString())}i.config={format:"hh:mm:ss",unit:"seconds",trim:!1},i.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},i.smsAccounts=a?_.keyBy(a.rows?a.rows:[],"id"):{},i.onSaveSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!0),r())},i.onUpdateSmsInteraction=function(e){l(e)&&d(e.createdAt)&&(o(e,!1),r())},t.on("smsInteraction:save",i.onSaveSmsInteraction),t.on("smsInteraction:update",i.onUpdateSmsInteraction),function(){if(0<Object.keys(i.smsAccounts).length)for(var e=0;e<n.rows.length;e+=1)if(l(n.rows[e])){var t=n.rows[e];o(t,!0),r()}}(),e.$on("$destroy",function(){t.removeAllListeners("smsInteraction:save"),t.removeAllListeners("smsInteraction:update")})}e.$inject=["$scope","socket","smsInteractions","smsAccounts"],angular.module("app.dashboards").controller("UserSmsDashboardGeneralController",e)}(),function(){"use strict";function e(n){var i=[],s=function(){var n=i[0],a={waiting:0,talking:0,pTalking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0,originated:0,outboundDropCallsDayCallersExit:0,outboundDropCallsDayTimeout:0};_.forIn(n.queues,function(e,t){n.rpcQueues[t]&&(a.waiting+=n.rpcQueues[t].waiting||0,a.talking+=(n.rpcQueues[t].talking||0)+(n.rpcQueues[t].pTalking||0),a.answered+=n.rpcQueues[t].answered||0,a.abandoned+=n.rpcQueues[t].abandoned||0,a.sumHoldTime+=n.rpcQueues[t].sumHoldTime||0,a.sumBillable+=n.rpcQueues[t].sumBillable||0,a.total+=n.rpcQueues[t].total||0,a.originated+=n.rpcQueues[t].originated||0,a.outboundDropCallsDayCallersExit+=n.rpcQueues[t].outboundDropCallsDayCallersExit||0,a.outboundDropCallsDayTimeout+=n.rpcQueues[t].outboundDropCallsDayTimeout||0)});var e=a.total-a.answered-a.abandoned;a.unmanaged=0<e?e:0,a.avgHoldTime=Math.round(0<a.total?a.sumHoldTime/a.total:0),a.avgHoldTime=new Date(1e3*a.avgHoldTime).toISOString().substr(11,8),a.avgTalkTime=Math.round(0<a.answered?a.sumBillable/a.answered:0),a.avgTalkTime=new Date(1e3*a.avgTalkTime).toISOString().substr(11,8),a.answerRate=Math.round((0<a.total?a.answered/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.abandonRate=Math.round((0<a.total?a.abandoned/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundDropRate=Math.round((0<a.total?a.outboundDropCallsDayTimeout/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundAbandonRate=Math.round((0<a.total?a.outboundDropCallsDayCallersExit/a.total*100:0)*Math.pow(10,1))/Math.pow(10,1),a.outboundanswerRate=0<100-a.outboundDropRate-a.outboundAbandonRate&&a.total?100-a.outboundDropRate-a.outboundAbandonRate:0,i.shift(),n.defer.resolve(a),0<i.length&&s()};return function(e){var t=n.defer();return i.push({queues:e.queues,rpcQueues:e.rpcQueues,defer:t}),1===i.length&&s(),t.promise}}function t(n){var i=[],s=function(){var n=i[0],a={originated:0,limitCalls:0};_.forIn(n.rpcCampaigns,function(e,t){n.rpcCampaigns[t]&&(a.originated+=n.rpcCampaigns[t].originated||0,a.limitCalls+=n.rpcCampaigns[t].limitCalls||0)}),i.shift(),n.defer.resolve(a),0<i.length&&s()};return function(e){var t=n.defer();return i.push({rpcCampaigns:e.rpcCampaigns,defer:t}),1===i.length&&s(),t.promise}}function n(e,o,t,n){var r=this;r.hasPermission=function(){return t.hasPermission(101)||t.hasRole("admin")},r.license=n,e.$on("$stateChangeSuccess",function(e,t,n,a,i){var s=[];r.license.voice&&s.push("app.dashboards.general.voice"),r.license.dialer&&s.push("app.dashboards.general.dialer"),r.license.chat&&s.push("app.dashboards.general.chat"),r.license.mail&&s.push("app.dashboards.general.mail"),r.license.messaging&&s.push("app.dashboards.general.sms"),r.license.openchannel&&s.push("app.dashboards.general.openchannel"),r.license.fax&&s.push("app.dashboards.general.fax"),r.selectedTab=_.indexOf(s,t.name),r.selectedTab<0&&(r.selectedTab=0)<s.length&&o.go(_.first(s))})}e.$inject=["$q"],t.$inject=["$q"],n.$inject=["$scope","$state","Auth","license"],angular.module("app.dashboards").filter("secToTime",function(){return function(e){return new Date(1e3*e).toISOString().substr(11,8)}}).factory("initializeRealtimeQueue",e).factory("initializeRealtimeCampaign",t).controller("UserDashboardGeneralController",n)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){s({queues:o.inboundQueues,rpcQueues:o.rpcQueues}).then(function(e){o.inbound=e})}o.inboundQueues=n?_.keyBy(n.rows?n.rows:[],"id"):{},o.rpcQueues=a?_.keyBy(a.rows?a.rows:[],"id"):{},o.inbound={waiting:0,talking:0,answered:0,abandoned:0,unmanaged:0,sumHoldTime:0,sumBillable:0,total:0,avgHoldTime:"00:00:00",avgTalkTime:"00:00:00",answerRate:0,abandonRate:0},o.outbound=i||{answered:0,sumBillable:0,sumDuration:0,sumHoldTime:0,total:0},o.onSaveQueue=function(e){o.inboundQueues[e.id]&&o.rpcQueues[e.id]&&(o.rpcQueues[e.id]=e,r())},o.onSaveOutbound=function(e){o.outbound=e},t.on("voice_queue:save",o.onSaveQueue),t.on("voice_outbound:save",o.onSaveOutbound),r(),e.$on("$destroy",function(){t.removeAllListeners("voice_queue:save"),t.removeAllListeners("voice_outbound:save")})}e.$inject=["$scope","socket","inboundQueues","rpcQueues","outbound","initializeRealtimeQueue"],angular.module("app.dashboards").controller("UserVoiceDashboardGeneralController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXACCOUNT",g.faxAccount=angular.copy(l),g.faxAccounts=r,g.newFaxAccount=!1,g.faxAccount||(g.faxAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="FAX.NEW_FAXACCOUNT",g.newFaxAccount=!0),t.params.id&&(g.faxAccount.FaxAccountId=t.params.id),g.addNewFaxAccount=function(){g.errors=[],d.faxAccount.addAccountApplications(g.faxAccount).$promise.then(function(e){g.faxAccounts.unshift(e.toJSON()),o.success({title:"FaxAccount properly created",msg:g.faxAccount.name?g.faxAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxAccount=function(){g.errors=[],d.faxAccount.updateAccountApplications(g.faxAccount).$promise.then(function(e){var t=_.find(g.faxAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxAccount properly saved!",msg:g.faxAccount.name?g.faxAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxAccount will be deleted.").ariaLabel("Delete FaxAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.faxAccount.delete({id:g.faxAccount.id}).$promise.then(function(){_.remove(g.faxAccounts,{id:g.faxAccount.id}),o.success({title:"FaxAccount properly deleted!",msg:(g.faxAccount.name||"faxAccount")+" has been deleted!"}),v(g.faxAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),n=null;if(g.faxAccount&&(n=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.trunks,{id:n.id});a.canSelect=!1,t.push(a)}g.trunks=t})}else{var n=[],a=null;g.faxAccount&&(a=_.find(g.trunks,{id:Number(g.faxAccount.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,n.push(g.trunks[i]));g.trunks=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.faxAccount&&(n=_.find(g.lists,{id:Number(g.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.faxAccount&&(a=_.find(g.lists,{id:Number(g.faxAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxAccounts","faxAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccountApp:n,faxAccount:r.faxAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.faxAccountApps.rows[t]=e:r.faxAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.faxAccountApps.rows.length;n++,0){var a=r.faxAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.faxAccount.context,a.exten=r.faxAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.faxAccount.addApplications({id:r.faxAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.faxAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.faxAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.faxAccount={},r.faxAccountApps={count:0,rows:[]},r.selectedFaxAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"FaxQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"faxQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:901}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.faxAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getFaxAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.faxAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getFaxAccountApps=function(){r.promise=o.faxAccount.getApplications(r.query,n).$promise},r.editFaxAccountApp=t,r.editInterval=function(e,t){if(r.faxAccountApps.rows.length){var n=r.faxAccountApps.rows[t]?r.faxAccountApps.rows[t]:r.faxAccountApps.rows[0];i.show({controller:"EditFaxAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteFaxAccountApp=function(e){_.remove(r.faxAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedFaxAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedFaxAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedFaxAccountApps.forEach(function(e){_.remove(r.faxAccountApps.rows,{id:e.id})}),r.selectedFaxAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.fax").controller("FaxAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxAccount.getAgents({id:c.faxAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserFaxAccount?"penalty "+e.UserFaxAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.faxAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxAccount.removeAgents({id:c.faxAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxAccount.addAgents({id:c.faxAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","faxAccount","faxAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditFaxAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("fax")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.faxQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:901}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="FAX.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveFaxAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","faxAccountApp","faxAccount","api","Auth","crudPermissions"],angular.module("app.fax").controller("EditFaxAccountApptagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountFaxDispositions={count:0,rows:[]},c.selectedFaxAccountFaxDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.faxAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.faxAccount.id,c.query.FaxAccountId=c.faxAccount.id,c.getFaxAccountFaxDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the faxDisposition?").htmlContent("<b>"+(e.name||"faxDisposition")+"</b> will be deleted.").ariaLabel("delete faxDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getFaxAccountFaxDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getDispositions(c.query,p).$promise},c.createOrEditFaxAccountFaxDisposition=function(e,t){s.show({controller:"CreateOrEditFaxDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,faxDisposition:t,faxDispositions:c.faxAccountFaxDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedFaxAccountFaxDispositions=function(){var e=angular.copy(c.selectedFaxAccountFaxDispositions);return c.selectedFaxAccountFaxDispositions=[],e},c.deleteFaxAccountFaxDisposition=g,c.deleteSelectedFaxAccountFaxDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected faxDispositions?").htmlContent("<b>"+c.selectedFaxAccountFaxDispositions.length+" selected</b> will be deleted.").ariaLabel("delete faxDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedFaxAccountFaxDispositions.forEach(function(e){g(e)}),c.selectedFaxAccountFaxDispositions=[]})};var m=!0,u=1;function p(e){c.faxAccountFaxDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountFaxDispositions.rows,{id:e.id}),c.faxAccountFaxDispositions.count-=1,c.faxAccountFaxDispositions.rows.length||c.getFaxAccountFaxDispositions(),r.success({title:"FaxDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountFaxDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountFaxDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXDISPOSITION",g.faxDisposition=angular.copy(l),g.faxDispositions=r,g.newFaxDisposition=!1,g.faxDisposition||(g.faxDisposition={},g.title="FAX.NEW_FAXDISPOSITION",g.newFaxDisposition=!0),t.params.id&&(g.faxDisposition.FaxAccountId=t.params.id),g.addNewFaxDisposition=function(){g.errors=[],d.disposition.save(g.faxDisposition).$promise.then(function(e){g.faxDispositions.unshift(e.toJSON()),o.success({title:"FaxDisposition properly created",msg:g.faxDisposition.name?g.faxDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxDisposition=function(){g.errors=[],d.disposition.update({id:g.faxDisposition.id},g.faxDisposition).$promise.then(function(e){var t=_.find(g.faxDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxDisposition properly saved!",msg:g.faxDisposition.name?g.faxDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxDisposition will be deleted.").ariaLabel("Delete FaxDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.faxDisposition.id}).$promise.then(function(){_.remove(g.faxDispositions,{id:g.faxDisposition.id}),o.success({title:"FaxDisposition properly deleted!",msg:(g.faxDisposition.name||"faxDisposition")+" has been deleted!"}),v(g.faxDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxDispositions","faxDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxDispositionDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.faxAccount={},c.faxAccountInteractions={count:0,rows:[]},c.selectedFaxAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,FaxAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.faxAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.faxAccount.id,c.getFaxAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.faxInteractionDownload=function(s,e,t){return l.faxInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="fax-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getFaxAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.faxAccount.getInteractions(c.query,p).$promise},c.createOrEditFaxAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:c.faxAccount,interaction:t,interactions:c.faxAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spyfaxInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"fax",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedFaxAccountInteractions=function(){var e=angular.copy(c.selectedFaxAccountInteractions);return c.selectedFaxAccountInteractions=[],e},c.deleteFaxAccountInteraction=g,c.deleteSelectedFaxAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedFaxAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedFaxAccountInteractions.forEach(function(e){g(e)}),c.selectedFaxAccountInteractions=[]})};var m=!0,u=1;function p(e){c.faxAccountInteractions=e||{count:0,rows:[]}}function g(e){l.faxInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.faxAccountInteractions.rows,{id:e.id}),c.faxAccountInteractions.count-=1,c.faxAccountInteractions.rows.length||c.getFaxAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getFaxAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.fax").controller("FaxAccountInteractionsController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.faxAccount=c||n.params.faxAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.accounts",{})}},u.agentadddialog=function(e,t){a.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:u.faxAccounts?u.faxAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxAccounts=function(){n.go("app.fax.faxAccounts")},u.saveFaxAccount=function(){r.faxAccount.updateAccountApplications(u.faxAccount).$promise.then(function(){l.success({title:"FaxAccount updated!",msg:u.faxAccount.name?u.faxAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),n=null;if(u.faxAccount&&(n=_.find(u.trunks,{id:Number(u.faxAccount.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.trunks,{id:n.id});a.canSelect=!1,t.push(a)}u.trunks=t})}else{var n=[],a=null;u.faxAccount&&(a=_.find(u.trunks,{id:Number(u.faxAccount.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,n.push(u.trunks[i]));u.trunks=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.faxAccount&&(n=_.find(u.lists,{id:Number(u.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.faxAccount&&(a=_.find(u.lists,{id:Number(u.faxAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxAccount","userProfileSection"],angular.module("app.fax").controller("FaxAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.faxAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="faxAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedFaxAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,headerinfo,TrunkId,localstationid,ListId,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,ecm,minrate,maxrate,modem,gateway,faxdetect,t38timeout,tech,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arrayecm=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayminrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymaxrate=_.keyBy([{option:"2400",value:"'2400'"},{option:"4800",value:"'4800'"},{option:"7200",value:"'7200'"},{option:"9600",value:"'9600'"},{option:"12000",value:"'12000'"},{option:"14400",value:"'14400'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytech=_.keyBy([{option:"SIP",value:"'SIP'"},{option:"IAX",value:"'IAX'"},{option:"DADHI",value:"'DADHI'"},{option:"KHOMP",value:"'KHOMP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,faxAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.fax.faxAccounts.edit",{id:e.id,tab:5})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.accounts",{})}},b.agentadddialog=function(e,t){i.show({controller:"FaxAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxAccount:e,faxAccounts:b.faxAccounts?b.faxAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("faxAccount")+"?").htmlContent("<b>"+(e.name||"faxAccount")+"</b> will be deleted.").ariaLabel("delete faxAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getFaxAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.faxAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FaxAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFaxAccount=function(e,t){i.show({controller:"CreateOrEditFaxAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxAccount:t,faxAccounts:b.faxAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFaxAccount=S,b.exportSelectedFaxAccounts=function(){var e=angular.copy(b.selectedFaxAccounts);return b.selectedFaxAccounts=[],e},b.deleteSelectedFaxAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxAccounts?").htmlContent("<b>"+b.selectedFaxAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FaxAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFaxAccounts.forEach(function(e){S(e)}),b.selectedFaxAccounts=[]})},b.deselectFaxAccounts=function(){b.selectedFaxAccounts=[]},b.selectAllFaxAccounts=function(){b.selectedFaxAccounts=b.faxAccounts.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})}),a=null;a=[],b.faxAccounts.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.trunks,{id:e.id});t.canSelect=!1,n.push(t)}}),b.trunks=n})}else{var n=[],a=[];b.faxAccounts.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)});for(var i=0;i<b.trunks.length;i++){_.some(a,{id:b.trunks[i].id})&&(b.trunks[i].canSelect=!1,n.push(b.trunks[i]))}b.trunks=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.faxAccount&&(n=_.find(b.lists,{id:Number(b.faxAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.faxAccount&&(a=_.find(b.lists,{id:Number(b.faxAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.faxAccounts=e||{count:0,rows:[]}}function S(e){m.faxAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.faxAccounts.rows,{id:e.id}),b.faxAccounts.count-=1,b.faxAccounts.rows.length||b.getFaxAccounts(),p.success({title:_.startCase("FaxAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFaxAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="FAX.EDIT_FAXQUEUE",g.faxQueue=angular.copy(l),g.faxQueues=r,g.newFaxQueue=!1,g.faxQueue||(g.faxQueue={strategy:"beepall",timeout:10},g.title="FAX.NEW_FAXQUEUE",g.newFaxQueue=!0),g.addNewFaxQueue=function(){g.errors=[],d.faxQueue.save(g.faxQueue).$promise.then(function(e){g.faxQueues.unshift(e.toJSON()),o.success({title:"FaxQueue properly created",msg:g.faxQueue.name?g.faxQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFaxQueue=function(){g.errors=[],d.faxQueue.update({id:g.faxQueue.id},g.faxQueue).$promise.then(function(e){var t=_.find(g.faxQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FaxQueue properly saved!",msg:g.faxQueue.name?g.faxQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFaxQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The faxQueue will be deleted.").ariaLabel("Delete FaxQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.faxQueue.delete({id:g.faxQueue.id}).$promise.then(function(){_.remove(g.faxQueues,{id:g.faxQueue.id}),o.success({title:"FaxQueue properly deleted!",msg:(g.faxQueue.name||"faxQueue")+" has been deleted!"}),v(g.faxQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.faxQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.faxQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","faxQueues","faxQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.fax").controller("CreateOrEditFaxQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxQueue.getAgents({id:c.faxQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserFaxQueue?"penalty "+e.UserFaxQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.faxQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.removeAgents({id:c.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.addAgents({id:c.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("FAX.ALL_AGENTS"),labelSelected:r.instant("FAX.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","faxQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.faxQueue.getTeams({id:l.faxQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.faxQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("FAX.ALL_TEAMS"),labelSelected:n.instant("FAX.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.removeTeams({id:l.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.faxQueue.addTeams({id:l.faxQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","faxQueue","$translate","Auth","crudPermissions"],angular.module("app.fax").controller("FaxQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.faxQueue=c||e.params.faxQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:u.faxQueues?u.faxQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoFaxQueues=function(){e.go("app.fax.faxQueues")},u.saveFaxQueue=function(){r.faxQueue.update({id:u.faxQueue.id},u.faxQueue).$promise.then(function(){l.success({title:"FaxQueue updated!",msg:u.faxQueue.name?u.faxQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","faxQueue","userProfileSection"],angular.module("app.fax").controller("FaxQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.faxQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="faxQueues",b.listOrder="",b.listOrderAsc=null,b.selectedFaxQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"fax",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.fax.faxQueues.edit",{id:e.id,faxQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"FaxQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:b.faxQueues?b.faxQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{faxQueue:e,faxQueues:b.faxQueues?b.faxQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("faxQueue")+"?").htmlContent("<b>"+(e.name||"faxQueue")+"</b> will be deleted.").ariaLabel("delete faxQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:910}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.fax.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.fax.realtime.queues",{})}},b.success=y,b.getFaxQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.faxQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FaxQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFaxQueue=function(e,t){i.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:b.faxQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFaxQueue=S,b.exportSelectedFaxQueues=function(){var e=angular.copy(b.selectedFaxQueues);return b.selectedFaxQueues=[],e},b.deleteSelectedFaxQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected faxQueues?").htmlContent("<b>"+b.selectedFaxQueues.length+" selected</b> will be deleted.").ariaLabel("delete FaxQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFaxQueues.forEach(function(e){S(e)}),b.selectedFaxQueues=[]})},b.deselectFaxQueues=function(){b.selectedFaxQueues=[]},b.selectAllFaxQueues=function(){b.selectedFaxQueues=b.faxQueues.rows};var E=!0,A=1;function y(e){b.faxQueues=e||{count:0,rows:[]}}function S(e){m.faxQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.faxQueues.rows,{id:e.id}),b.faxQueues.count-=1,b.faxQueues.rows.length||b.getFaxQueues(),p.success({title:_.startCase("FaxQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEfaxQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEfaxQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFaxQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","faxQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.fax").controller("FaxQueuesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.faxAccounts,function(e,t){p.rpcFaxAccounts[t]&&_.merge(e,p.rpcFaxAccounts[t])}),_.forIn(p.faxAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};s.faxAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",s.faxAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.faxAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcFaxAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getFaxAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.faxAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="FaxAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.faxAccounts[e.id]&&_.merge(p.faxAccounts[e.id],e)},p.onFaxMessageSave=function(e){p.faxAccounts[e.FaxAccountId]&&("in"==e.direction?(p.faxAccounts[e.FaxAccountId].in+=1,p.faxAccounts[e.FaxAccountId].lastIn=e.createdAt):(p.faxAccounts[e.FaxAccountId].out+=1,p.faxAccounts[e.FaxAccountId].lastOut=e.createdAt))},p.goToFaxAccount=function(e,t){i.go("app.fax.faxAccounts.edit",{id:t.id,faxAccount:t})},p.order=[],_.forIn(p.faxAccounts,function(e,t){p.order.push(e.id)}),o.on("faxAccount:save",p.onSave),o.on("faxAccount:update",p.onSave),o.on("faxMessage:save",p.onFaxMessageSave);var v=!0,h=1;function f(e){if(p.faxAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var t=0;t<e.rows.length;t++)p.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getFaxAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("faxAccount:save"),o.removeAllListeners("faxAccount:update"),o.removeAllListeners("faxMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","faxAccounts","rpcFaxAccounts","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("FaxAccountsRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"fax",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsFaxRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.faxQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].FaxQueueId].paused++,g.queues[e[t].rows[n].FaxQueueId].loggedInDb++,g.queues[e[t].rows[n].FaxQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].FaxQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"fax",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.faxQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="FaxQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditFaxQueue=function(e,t){a.show({controller:"CreateOrEditFaxQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"FaxQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{faxQueue:t,faxQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.faxQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.FaxQueueId]&&g.queues[e.FaxQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.FaxQueueId]&&g.queues[e.FaxQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.FaxQueueId]&&(g.queues[e.FaxQueueId].loggedInDb+=1,g.queues[e.FaxQueueId].agents[e.UserId]=e.FaxQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.FaxQueueId]&&0<g.queues[e.FaxQueueId].loggedInDb&&(g.queues[e.FaxQueueId].loggedInDb-=1,delete g.queues[e.FaxQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("fax_queue:save",g.onSave),d.on("userFaxQueue:save",g.onSaveMember),d.on("userFaxQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("fax_queue:save"),d.removeAllListeners("userFaxQueue:remove"),d.removeAllListeners("userFaxQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("QueuesFaxRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.fax.realtime.agents":this.selectedTab=0;break;case"app.fax.realtime.trunks":this.selectedTab=1;break;case"app.fax.realtime.queues":this.selectedTab=2;break;case"app.fax.realtime.accounts":this.selectedTab=3;break;default:this.selectedTab=0,n.go("app.fax.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.fax.realtime.agents");break;case 1:n.go("app.fax.realtime.trunks");break;case 2:n.go("app.fax.realtime.queues");break;case 3:n.go("app.fax.realtime.accounts");break;default:n.go("app.fax.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.fax").controller("FaxRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,t=0;t<u.trunks.length;t+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[t].id]))&&_.merge(u.trunks[t],_.pick(u.rpcTrunks[e],p))}function v(e,t,n){0<=t&&_.merge(e[t],_.pick(n,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},u.onSave=function(e){var t=_.findIndex(u.trunks,["id",e.id]),n=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,t,e),v(u.rpcTrunks,n,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.fax").controller("TrunksFaxRealtimeController",e)}(),function(){"use strict";function e(e,t){this.info=e,this.license=t}e.$inject=["info","license"],angular.module("app.help.about").controller("AboutController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKACCOUNT",g.deskAccount=angular.copy(l),g.deskAccounts=r,g.newDeskAccount=!1,g.deskAccount||(g.deskAccount={type:"integrationTab",authType:"basic",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_DESKACCOUNT",g.newDeskAccount=!0),g.addNewDeskAccount=function(){g.errors=[],d.intDeskAccount.save(g.deskAccount).$promise.then(function(e){g.deskAccounts.unshift(e.toJSON()),o.success({title:"DeskAccount properly created",msg:g.deskAccount.name?g.deskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskAccount=function(){g.errors=[],d.intDeskAccount.update({id:g.deskAccount.id},g.deskAccount).$promise.then(function(e){var t=_.find(g.deskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"DeskAccount properly saved!",msg:g.deskAccount.name?g.deskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The deskAccount will be deleted.").ariaLabel("Delete DeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDeskAccount.delete({id:g.deskAccount.id}).$promise.then(function(){_.remove(g.deskAccounts,{id:g.deskAccount.id}),o.success({title:"DeskAccount properly deleted!",msg:(g.deskAccount.name||"deskAccount")+" has been deleted!"}),v(g.deskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","deskAccounts","deskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.deskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="deskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedDeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,remoteUri,authType,username,password,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayauthType=_.keyBy([{option:"Basic",value:"'basic'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.deskAccounts.edit",{id:e.id,deskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intDeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"DeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"DeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("deskAccount")+"?").htmlContent("<b>"+(e.name||"deskAccount")+"</b> will be deleted.").ariaLabel("delete deskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intDeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="DeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDeskAccount=function(e,t){i.show({controller:"CreateOrEditDeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskAccount:t,deskAccounts:b.deskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDeskAccount=S,b.exportSelectedDeskAccounts=function(){var e=angular.copy(b.selectedDeskAccounts);return b.selectedDeskAccounts=[],e},b.deleteSelectedDeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected deskAccounts?").htmlContent("<b>"+b.selectedDeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete DeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDeskAccounts.forEach(function(e){S(e)}),b.selectedDeskAccounts=[]})},b.deselectDeskAccounts=function(){b.selectedDeskAccounts=[]},b.selectAllDeskAccounts=function(){b.selectedDeskAccounts=b.deskAccounts.rows};var E=!0,A=1;function y(e){b.deskAccounts=e||{count:0,rows:[]}}function S(e){m.intDeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.deskAccounts.rows,{id:e.id}),b.deskAccounts.count-=1,b.deskAccounts.rows.length||b.getDeskAccounts(),p.success({title:_.startCase("DeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","deskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("DeskAccountsController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.deskAccount={},o.deskConfiguration={},o.configurations=[],o.selectedDeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.deskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDeskAccount.getConfigurations({id:o.deskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDeskConfiguration=function(e){o.deskConfiguration=o.configurations[e],o.selectedDeskConfiguration=e,i.intDeskConfiguration.getSubjects({id:o.deskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDeskConfiguration.getDescriptions({id:o.deskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDeskConfiguration.getFields({id:o.deskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intDeskConfiguration.getTags({id:o.deskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDeskConfiguration=function(e,t){a.show({controller:"CreateOrEditDeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{deskConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDeskConfiguration(0)})},o.deleteDeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the deskConfiguration?").htmlContent("<b>"+(t.name||"deskConfiguration")+"</b> will be deleted.").ariaLabel("delete deskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"DeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.deskConfiguration.id},o.deskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intDeskConfiguration.setTags({id:o.deskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.deskConfiguration,account:o.deskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("DeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DESKCONFIGURATION",g.deskConfiguration=angular.copy(l),g.configurations=r,g.newDeskConfiguration=!1,g.deskConfiguration||(g.deskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_DESKCONFIGURATION",g.newDeskConfiguration=!0),g.addNewDeskConfiguration=function(){g.errors=[],d.intDeskAccount.addConfiguration({id:t.params.id},g.deskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"DeskConfiguration properly created",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDeskConfiguration=function(){g.errors=[],d.intDeskConfiguration.update({id:g.deskConfiguration.id},g.deskConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"DeskConfiguration properly saved!",msg:g.deskConfiguration.name?g.deskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The deskConfiguration will be deleted.").ariaLabel("Delete DeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDeskConfiguration.delete({id:g.deskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.deskConfiguration.id}),o.success({title:"DeskConfiguration properly deleted!",msg:(g.deskConfiguration.name||"deskConfiguration")+" has been deleted!"}),v(g.deskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","deskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.deskAccount=c||e.params.deskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDeskAccounts=function(){e.go("app.integrations.deskAccounts")},u.saveDeskAccount=function(){r.intDeskAccount.update({id:u.deskAccount.id},u.deskAccount).$promise.then(function(){l.success({title:"DeskAccount updated!",msg:u.deskAccount.name?u.deskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","deskAccount","userProfileSection"],angular.module("app.integrations").controller("DeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT",g.dynamics365Account=angular.copy(l),g.dynamics365Accounts=r,g.newDynamics365Account=!1,g.dynamics365Account||(g.dynamics365Account={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_DYNAMICS365ACCOUNT",g.newDynamics365Account=!0),g.addNewDynamics365Account=function(){g.errors=[],d.intDynamics365Account.save(g.dynamics365Account).$promise.then(function(e){g.dynamics365Accounts.unshift(e.toJSON()),o.success({title:"Dynamics365Account properly created",msg:g.dynamics365Account.name?g.dynamics365Account.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Account=function(){g.errors=[],d.intDynamics365Account.update({id:g.dynamics365Account.id},g.dynamics365Account).$promise.then(function(e){var t=_.find(g.dynamics365Accounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Dynamics365Account properly saved!",msg:g.dynamics365Account.name?g.dynamics365Account.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Account=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dynamics365Account will be deleted.").ariaLabel("Delete Dynamics365Account").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDynamics365Account.delete({id:g.dynamics365Account.id}).$promise.then(function(){_.remove(g.dynamics365Accounts,{id:g.dynamics365Account.id}),o.success({title:"Dynamics365Account properly deleted!",msg:(g.dynamics365Account.name||"dynamics365Account")+" has been deleted!"}),v(g.dynamics365Account)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Account.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Account.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dynamics365Accounts","dynamics365Account","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.dynamics365Accounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dynamics365Accounts",b.listOrder="",b.listOrderAsc=null,b.selectedDynamics365Accounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,remoteUri,tenantId,clientId,clientSecret,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.dynamics365Accounts.edit",{id:e.id,dynamics365Account:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intDynamics365Account.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"Dynamics365Account properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Dynamics365Account properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("dynamics365Account")+"?").htmlContent("<b>"+(e.name||"dynamics365Account")+"</b> will be deleted.").ariaLabel("delete dynamics365Account").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDynamics365Accounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intDynamics365Account.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dynamics365Accounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDynamics365Account=function(e,t){i.show({controller:"CreateOrEditDynamics365AccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Account:t,dynamics365Accounts:b.dynamics365Accounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDynamics365Account=S,b.exportSelectedDynamics365Accounts=function(){var e=angular.copy(b.selectedDynamics365Accounts);return b.selectedDynamics365Accounts=[],e},b.deleteSelectedDynamics365Accounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected dynamics365Accounts?").htmlContent("<b>"+b.selectedDynamics365Accounts.length+" selected</b> will be deleted.").ariaLabel("delete Dynamics365Accounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDynamics365Accounts.forEach(function(e){S(e)}),b.selectedDynamics365Accounts=[]})},b.deselectDynamics365Accounts=function(){b.selectedDynamics365Accounts=[]},b.selectAllDynamics365Accounts=function(){b.selectedDynamics365Accounts=b.dynamics365Accounts.rows};var E=!0,A=1;function y(e){b.dynamics365Accounts=e||{count:0,rows:[]}}function S(e){m.intDynamics365Account.delete({id:e.id}).$promise.then(function(){_.remove(b.dynamics365Accounts.rows,{id:e.id}),b.dynamics365Accounts.count-=1,b.dynamics365Accounts.rows.length||b.getDynamics365Accounts(),p.success({title:_.startCase("Dynamics365Account")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintDynamics365Account"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintDynamics365Account",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDynamics365Accounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dynamics365Accounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("Dynamics365AccountsController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intDynamics365Field.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.dynamics365Account={},o.dynamics365Configuration={},o.configurations=[],o.selectedDynamics365Configuration=-1,o.crudPermissions,o.init=function(e,t){o.dynamics365Account=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intDynamics365Account.getConfigurations({id:o.dynamics365Account.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getDynamics365Configuration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getDynamics365Configuration=function(e){o.dynamics365Configuration=o.configurations[e],o.selectedDynamics365Configuration=e,i.intDynamics365Configuration.getSubjects({id:o.dynamics365Configuration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intDynamics365Configuration.getDescriptions({id:o.dynamics365Configuration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intDynamics365Configuration.getFields({id:o.dynamics365Configuration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditDynamics365Configuration=function(e,t){a.show({controller:"CreateOrEditDynamics365ConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{dynamics365Configuration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getDynamics365Configuration(0)})},o.deleteDynamics365Configuration=function(e,t){var n=a.confirm().title("Are you sure want to delete the dynamics365Configuration?").htmlContent("<b>"+(t.name||"dynamics365Configuration")+"</b> will be deleted.").ariaLabel("delete dynamics365Configuration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intDynamics365Configuration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"Dynamics365Configuration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getDynamics365Configuration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.dynamics365Configuration.id},o.dynamics365Configuration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditDynamics365AccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.dynamics365Configuration,account:o.dynamics365Account,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("Dynamics365AccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_DYNAMICS365CONFIGURATION",g.dynamics365Configuration=angular.copy(l),g.configurations=r,g.newDynamics365Configuration=!1,g.dynamics365Configuration||(g.dynamics365Configuration={channel:"voice",type:"inbound",ticketType:"incident"},g.title="INTEGRATIONS.NEW_DYNAMICS365CONFIGURATION",g.newDynamics365Configuration=!0),g.addNewDynamics365Configuration=function(){g.errors=[],d.intDynamics365Account.addConfiguration({id:t.params.id},g.dynamics365Configuration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"Dynamics365Configuration properly created",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDynamics365Configuration=function(){g.errors=[],d.intDynamics365Configuration.update({id:g.dynamics365Configuration.id},g.dynamics365Configuration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Dynamics365Configuration properly saved!",msg:g.dynamics365Configuration.name?g.dynamics365Configuration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDynamics365Configuration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dynamics365Configuration will be deleted.").ariaLabel("Delete Dynamics365Configuration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intDynamics365Configuration.delete({id:g.dynamics365Configuration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.dynamics365Configuration.id}),o.success({title:"Dynamics365Configuration properly deleted!",msg:(g.dynamics365Configuration.name||"dynamics365Configuration")+" has been deleted!"}),v(g.dynamics365Configuration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intDynamics365Configuration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intDynamics365Configuration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","dynamics365Configuration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365ConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intDynamics365Field.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intDynamics365Field.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.getFields({id:l.id,ticketType:s.ticketType}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditDynamics365AccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.dynamics365Account=c||e.params.dynamics365Account||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoDynamics365Accounts=function(){e.go("app.integrations.dynamics365Accounts")},u.saveDynamics365Account=function(){r.intDynamics365Account.update({id:u.dynamics365Account.id},u.dynamics365Account).$promise.then(function(){l.success({title:"Dynamics365Account updated!",msg:u.dynamics365Account.name?u.dynamics365Account.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintDynamics365Account",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","dynamics365Account","userProfileSection"],angular.module("app.integrations").controller("Dynamics365AccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKACCOUNT",g.freshdeskAccount=angular.copy(l),g.freshdeskAccounts=r,g.newFreshdeskAccount=!1,g.freshdeskAccount||(g.freshdeskAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_FRESHDESKACCOUNT",g.newFreshdeskAccount=!0),g.addNewFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.save(g.freshdeskAccount).$promise.then(function(e){g.freshdeskAccounts.unshift(e.toJSON()),o.success({title:"FreshdeskAccount properly created",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskAccount=function(){g.errors=[],d.intFreshdeskAccount.update({id:g.freshdeskAccount.id},g.freshdeskAccount).$promise.then(function(e){var t=_.find(g.freshdeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FreshdeskAccount properly saved!",msg:g.freshdeskAccount.name?g.freshdeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskAccount will be deleted.").ariaLabel("Delete FreshdeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intFreshdeskAccount.delete({id:g.freshdeskAccount.id}).$promise.then(function(){_.remove(g.freshdeskAccounts,{id:g.freshdeskAccount.id}),o.success({title:"FreshdeskAccount properly deleted!",msg:(g.freshdeskAccount.name||"freshdeskAccount")+" has been deleted!"}),v(g.freshdeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","freshdeskAccounts","freshdeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intFreshdeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.freshdeskAccount={},o.freshdeskConfiguration={},o.configurations=[],o.selectedFreshdeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.freshdeskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intFreshdeskAccount.getConfigurations({id:o.freshdeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getFreshdeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getFreshdeskConfiguration=function(e){o.freshdeskConfiguration=o.configurations[e],o.selectedFreshdeskConfiguration=e,i.intFreshdeskConfiguration.getSubjects({id:o.freshdeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intFreshdeskConfiguration.getDescriptions({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intFreshdeskConfiguration.getFields({id:o.freshdeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intFreshdeskConfiguration.getTags({id:o.freshdeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditFreshdeskConfiguration=function(e,t){a.show({controller:"CreateOrEditFreshdeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getFreshdeskConfiguration(0)})},o.deleteFreshdeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the freshdeskConfiguration?").htmlContent("<b>"+(t.name||"freshdeskConfiguration")+"</b> will be deleted.").ariaLabel("delete freshdeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intFreshdeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"FreshdeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getFreshdeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.freshdeskConfiguration.id},o.freshdeskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intFreshdeskConfiguration.setTags({id:o.freshdeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditFreshdeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.freshdeskConfiguration,account:o.freshdeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("FreshdeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_FRESHDESKCONFIGURATION",g.freshdeskConfiguration=angular.copy(l),g.configurations=r,g.newFreshdeskConfiguration=!1,g.freshdeskConfiguration||(g.freshdeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_FRESHDESKCONFIGURATION",g.newFreshdeskConfiguration=!0),g.addNewFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskAccount.addConfiguration({id:t.params.id},g.freshdeskConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"FreshdeskConfiguration properly created",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveFreshdeskConfiguration=function(){g.errors=[],d.intFreshdeskConfiguration.update({id:g.freshdeskConfiguration.id},g.freshdeskConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"FreshdeskConfiguration properly saved!",msg:g.freshdeskConfiguration.name?g.freshdeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteFreshdeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The freshdeskConfiguration will be deleted.").ariaLabel("Delete FreshdeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intFreshdeskConfiguration.delete({id:g.freshdeskConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.freshdeskConfiguration.id}),o.success({title:"FreshdeskConfiguration properly deleted!",msg:(g.freshdeskConfiguration.name||"freshdeskConfiguration")+" has been deleted!"}),v(g.freshdeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intFreshdeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intFreshdeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","freshdeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intFreshdeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intFreshdeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditFreshdeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.freshdeskAccount=c||e.params.freshdeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoFreshdeskAccounts=function(){e.go("app.integrations.freshdeskAccounts")},u.saveFreshdeskAccount=function(){r.intFreshdeskAccount.update({id:u.freshdeskAccount.id},u.freshdeskAccount).$promise.then(function(){l.success({title:"FreshdeskAccount updated!",msg:u.freshdeskAccount.name?u.freshdeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintFreshdeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","freshdeskAccount","userProfileSection"],angular.module("app.integrations").controller("FreshdeskAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.freshdeskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="freshdeskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedFreshdeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,apiKey,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.freshdeskAccounts.edit",{id:e.id,freshdeskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intFreshdeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"FreshdeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"FreshdeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("freshdeskAccount")+"?").htmlContent("<b>"+(e.name||"freshdeskAccount")+"</b> will be deleted.").ariaLabel("delete freshdeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getFreshdeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intFreshdeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="FreshdeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditFreshdeskAccount=function(e,t){i.show({controller:"CreateOrEditFreshdeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{freshdeskAccount:t,freshdeskAccounts:b.freshdeskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteFreshdeskAccount=S,b.exportSelectedFreshdeskAccounts=function(){var e=angular.copy(b.selectedFreshdeskAccounts);return b.selectedFreshdeskAccounts=[],e},b.deleteSelectedFreshdeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected freshdeskAccounts?").htmlContent("<b>"+b.selectedFreshdeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete FreshdeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedFreshdeskAccounts.forEach(function(e){S(e)}),b.selectedFreshdeskAccounts=[]})},b.deselectFreshdeskAccounts=function(){b.selectedFreshdeskAccounts=[]},b.selectAllFreshdeskAccounts=function(){b.selectedFreshdeskAccounts=b.freshdeskAccounts.rows};var E=!0,A=1;function y(e){b.freshdeskAccounts=e||{count:0,rows:[]}}function S(e){m.intFreshdeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.freshdeskAccounts.rows,{id:e.id}),b.freshdeskAccounts.count-=1,b.freshdeskAccounts.rows.length||b.getFreshdeskAccounts(),p.success({title:_.startCase("FreshdeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintFreshdeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintFreshdeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getFreshdeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","freshdeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("FreshdeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCEACCOUNT",g.salesforceAccount=angular.copy(l),g.salesforceAccounts=r,g.newSalesforceAccount=!1,g.salesforceAccount||(g.salesforceAccount={type:"integrationTab",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SALESFORCEACCOUNT",g.newSalesforceAccount=!0),g.addNewSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.save(g.salesforceAccount).$promise.then(function(e){g.salesforceAccounts.unshift(e.toJSON()),o.success({title:"SalesforceAccount properly created",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceAccount=function(){g.errors=[],d.intSalesforceAccount.update({id:g.salesforceAccount.id},g.salesforceAccount).$promise.then(function(e){var t=_.find(g.salesforceAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SalesforceAccount properly saved!",msg:g.salesforceAccount.name?g.salesforceAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceAccount will be deleted.").ariaLabel("Delete SalesforceAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSalesforceAccount.delete({id:g.salesforceAccount.id}).$promise.then(function(){_.remove(g.salesforceAccounts,{id:g.salesforceAccount.id}),o.success({title:"SalesforceAccount properly deleted!",msg:(g.salesforceAccount.name||"salesforceAccount")+" has been deleted!"}),v(g.salesforceAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","salesforceAccounts","salesforceAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSalesforceField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.salesforceAccount={},o.salesforceConfiguration={},o.configurations=[],o.selectedSalesforceConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.salesforceAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSalesforceAccount.getConfigurations({id:o.salesforceAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSalesforceConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSalesforceConfiguration=function(e){o.salesforceConfiguration=o.configurations[e],o.selectedSalesforceConfiguration=e,i.intSalesforceConfiguration.getSubjects({id:o.salesforceConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSalesforceConfiguration.getDescriptions({id:o.salesforceConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSalesforceConfiguration.getFields({id:o.salesforceConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSalesforceConfiguration=function(e,t){a.show({controller:"CreateOrEditSalesforceConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSalesforceConfiguration(0)})},o.deleteSalesforceConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the salesforceConfiguration?").htmlContent("<b>"+(t.name||"salesforceConfiguration")+"</b> will be deleted.").ariaLabel("delete salesforceConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSalesforceConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"SalesforceConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSalesforceConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.salesforceConfiguration.id},o.salesforceConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSalesforceAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.salesforceConfiguration,account:o.salesforceAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SalesforceAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SALESFORCECONFIGURATION",g.salesforceConfiguration=angular.copy(l),g.configurations=r,g.newSalesforceConfiguration=!1,g.salesforceConfiguration||(g.salesforceConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SALESFORCECONFIGURATION",g.newSalesforceConfiguration=!0),g.addNewSalesforceConfiguration=function(){g.errors=[],d.intSalesforceAccount.addConfiguration({id:t.params.id},g.salesforceConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SalesforceConfiguration properly created",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSalesforceConfiguration=function(){g.errors=[],d.intSalesforceConfiguration.update({id:g.salesforceConfiguration.id},g.salesforceConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SalesforceConfiguration properly saved!",msg:g.salesforceConfiguration.name?g.salesforceConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSalesforceConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The salesforceConfiguration will be deleted.").ariaLabel("Delete SalesforceConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSalesforceConfiguration.delete({id:g.salesforceConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.salesforceConfiguration.id}),o.success({title:"SalesforceConfiguration properly deleted!",msg:(g.salesforceConfiguration.name||"salesforceConfiguration")+" has been deleted!"}),v(g.salesforceConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSalesforceConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSalesforceConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","salesforceConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSalesforceField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSalesforceField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSalesforceAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.salesforceAccount=c||e.params.salesforceAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSalesforceAccounts=function(){e.go("app.integrations.salesforceAccounts")},u.saveSalesforceAccount=function(){r.intSalesforceAccount.update({id:u.salesforceAccount.id},u.salesforceAccount).$promise.then(function(){l.success({title:"SalesforceAccount updated!",msg:u.salesforceAccount.name?u.salesforceAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSalesforceAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","salesforceAccount","userProfileSection"],angular.module("app.integrations").controller("SalesforceAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.salesforceAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="salesforceAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSalesforceAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,password,clientId,clientSecret,securityToken,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.salesforceAccounts.edit",{id:e.id,salesforceAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intSalesforceAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SalesforceAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SalesforceAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("salesforceAccount")+"?").htmlContent("<b>"+(e.name||"salesforceAccount")+"</b> will be deleted.").ariaLabel("delete salesforceAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSalesforceAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intSalesforceAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SalesforceAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSalesforceAccount=function(e,t){i.show({controller:"CreateOrEditSalesforceAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{salesforceAccount:t,salesforceAccounts:b.salesforceAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSalesforceAccount=S,b.exportSelectedSalesforceAccounts=function(){var e=angular.copy(b.selectedSalesforceAccounts);return b.selectedSalesforceAccounts=[],e},b.deleteSelectedSalesforceAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected salesforceAccounts?").htmlContent("<b>"+b.selectedSalesforceAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SalesforceAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSalesforceAccounts.forEach(function(e){S(e)}),b.selectedSalesforceAccounts=[]})},b.deselectSalesforceAccounts=function(){b.selectedSalesforceAccounts=[]},b.selectAllSalesforceAccounts=function(){b.selectedSalesforceAccounts=b.salesforceAccounts.rows};var E=!0,A=1;function y(e){b.salesforceAccounts=e||{count:0,rows:[]}}function S(e){m.intSalesforceAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.salesforceAccounts.rows,{id:e.id}),b.salesforceAccounts.count-=1,b.salesforceAccounts.rows.length||b.getSalesforceAccounts(),p.success({title:_.startCase("SalesforceAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSalesforceAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSalesforceAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSalesforceAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","salesforceAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SalesforceAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWACCOUNT",g.servicenowAccount=angular.copy(l),g.servicenowAccounts=r,g.newServicenowAccount=!1,g.servicenowAccount||(g.servicenowAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SERVICENOWACCOUNT",g.newServicenowAccount=!0),g.addNewServicenowAccount=function(){g.errors=[],d.intServicenowAccount.save(g.servicenowAccount).$promise.then(function(e){g.servicenowAccounts.unshift(e.toJSON()),o.success({title:"ServicenowAccount properly created",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowAccount=function(){g.errors=[],d.intServicenowAccount.update({id:g.servicenowAccount.id},g.servicenowAccount).$promise.then(function(e){var t=_.find(g.servicenowAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ServicenowAccount properly saved!",msg:g.servicenowAccount.name?g.servicenowAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The servicenowAccount will be deleted.").ariaLabel("Delete ServicenowAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intServicenowAccount.delete({id:g.servicenowAccount.id}).$promise.then(function(){_.remove(g.servicenowAccounts,{id:g.servicenowAccount.id}),o.success({title:"ServicenowAccount properly deleted!",msg:(g.servicenowAccount.name||"servicenowAccount")+" has been deleted!"}),v(g.servicenowAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","servicenowAccounts","servicenowAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intServicenowField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.servicenowAccount={},o.servicenowConfiguration={},o.configurations=[],o.selectedServicenowConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.servicenowAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intServicenowAccount.getConfigurations({id:o.servicenowAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getServicenowConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getServicenowConfiguration=function(e){o.servicenowConfiguration=o.configurations[e],o.selectedServicenowConfiguration=e,i.intServicenowConfiguration.getSubjects({id:o.servicenowConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intServicenowConfiguration.getDescriptions({id:o.servicenowConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intServicenowConfiguration.getFields({id:o.servicenowConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditServicenowConfiguration=function(e,t){a.show({controller:"CreateOrEditServicenowConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getServicenowConfiguration(0)})},o.deleteServicenowConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the servicenowConfiguration?").htmlContent("<b>"+(t.name||"servicenowConfiguration")+"</b> will be deleted.").ariaLabel("delete servicenowConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intServicenowConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"ServicenowConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getServicenowConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.servicenowConfiguration.id},o.servicenowConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditServicenowAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.servicenowConfiguration,account:o.servicenowAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ServicenowAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SERVICENOWCONFIGURATION",g.servicenowConfiguration=angular.copy(l),g.configurations=r,g.newServicenowConfiguration=!1,g.servicenowConfiguration||(g.servicenowConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SERVICENOWCONFIGURATION",g.newServicenowConfiguration=!0),g.addNewServicenowConfiguration=function(){g.errors=[],d.intServicenowAccount.addConfiguration({id:t.params.id},g.servicenowConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ServicenowConfiguration properly created",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveServicenowConfiguration=function(){g.errors=[],d.intServicenowConfiguration.update({id:g.servicenowConfiguration.id},g.servicenowConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ServicenowConfiguration properly saved!",msg:g.servicenowConfiguration.name?g.servicenowConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteServicenowConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The servicenowConfiguration will be deleted.").ariaLabel("Delete ServicenowConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intServicenowConfiguration.delete({id:g.servicenowConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.servicenowConfiguration.id}),o.success({title:"ServicenowConfiguration properly deleted!",msg:(g.servicenowConfiguration.name||"servicenowConfiguration")+" has been deleted!"}),v(g.servicenowConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intServicenowConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intServicenowConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","servicenowConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intServicenowField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intServicenowField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditServicenowAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.servicenowAccount=c||e.params.servicenowAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoServicenowAccounts=function(){e.go("app.integrations.servicenowAccounts")},u.saveServicenowAccount=function(){r.intServicenowAccount.update({id:u.servicenowAccount.id},u.servicenowAccount).$promise.then(function(){l.success({title:"ServicenowAccount updated!",msg:u.servicenowAccount.name?u.servicenowAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintServicenowAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","servicenowAccount","userProfileSection"],angular.module("app.integrations").controller("ServicenowAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.servicenowAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="servicenowAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedServicenowAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,password,email,remoteUri,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.servicenowAccounts.edit",{id:e.id,servicenowAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intServicenowAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ServicenowAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ServicenowAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("servicenowAccount")+"?").htmlContent("<b>"+(e.name||"servicenowAccount")+"</b> will be deleted.").ariaLabel("delete servicenowAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getServicenowAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intServicenowAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ServicenowAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditServicenowAccount=function(e,t){i.show({controller:"CreateOrEditServicenowAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{servicenowAccount:t,servicenowAccounts:b.servicenowAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteServicenowAccount=S,b.exportSelectedServicenowAccounts=function(){var e=angular.copy(b.selectedServicenowAccounts);return b.selectedServicenowAccounts=[],e},b.deleteSelectedServicenowAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected servicenowAccounts?").htmlContent("<b>"+b.selectedServicenowAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ServicenowAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedServicenowAccounts.forEach(function(e){S(e)}),b.selectedServicenowAccounts=[]})},b.deselectServicenowAccounts=function(){b.selectedServicenowAccounts=[]},b.selectAllServicenowAccounts=function(){b.selectedServicenowAccounts=b.servicenowAccounts.rows};var E=!0,A=1;function y(e){b.servicenowAccounts=e||{count:0,rows:[]}}function S(e){m.intServicenowAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.servicenowAccounts.rows,{id:e.id}),b.servicenowAccounts.count-=1,b.servicenowAccounts.rows.length||b.getServicenowAccounts(),p.success({title:_.startCase("ServicenowAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintServicenowAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintServicenowAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getServicenowAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","servicenowAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ServicenowAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMACCOUNT",g.sugarcrmAccount=angular.copy(l),g.sugarcrmAccounts=r,g.newSugarcrmAccount=!1,g.sugarcrmAccount||(g.sugarcrmAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_SUGARCRMACCOUNT",g.newSugarcrmAccount=!0),g.addNewSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.save(g.sugarcrmAccount).$promise.then(function(e){g.sugarcrmAccounts.unshift(e.toJSON()),o.success({title:"SugarcrmAccount properly created",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmAccount=function(){g.errors=[],d.intSugarcrmAccount.update({id:g.sugarcrmAccount.id},g.sugarcrmAccount).$promise.then(function(e){var t=_.find(g.sugarcrmAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SugarcrmAccount properly saved!",msg:g.sugarcrmAccount.name?g.sugarcrmAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmAccount will be deleted.").ariaLabel("Delete SugarcrmAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSugarcrmAccount.delete({id:g.sugarcrmAccount.id}).$promise.then(function(){_.remove(g.sugarcrmAccounts,{id:g.sugarcrmAccount.id}),o.success({title:"SugarcrmAccount properly deleted!",msg:(g.sugarcrmAccount.name||"sugarcrmAccount")+" has been deleted!"}),v(g.sugarcrmAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sugarcrmAccounts","sugarcrmAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intSugarcrmField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.sugarcrmAccount={},o.sugarcrmConfiguration={},o.configurations=[],o.selectedSugarcrmConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.sugarcrmAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intSugarcrmAccount.getConfigurations({id:o.sugarcrmAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getSugarcrmConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getSugarcrmConfiguration=function(e){o.sugarcrmConfiguration=o.configurations[e],o.selectedSugarcrmConfiguration=e,i.intSugarcrmConfiguration.getSubjects({id:o.sugarcrmConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intSugarcrmConfiguration.getDescriptions({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intSugarcrmConfiguration.getFields({id:o.sugarcrmConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditSugarcrmConfiguration=function(e,t){a.show({controller:"CreateOrEditSugarcrmConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getSugarcrmConfiguration(0)})},o.deleteSugarcrmConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the sugarcrmConfiguration?").htmlContent("<b>"+(t.name||"sugarcrmConfiguration")+"</b> will be deleted.").ariaLabel("delete sugarcrmConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intSugarcrmConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"SugarcrmConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getSugarcrmConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.sugarcrmConfiguration.id},o.sugarcrmConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditSugarcrmAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.sugarcrmConfiguration,account:o.sugarcrmAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("SugarcrmAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_SUGARCRMCONFIGURATION",g.sugarcrmConfiguration=angular.copy(l),g.configurations=r,g.newSugarcrmConfiguration=!1,g.sugarcrmConfiguration||(g.sugarcrmConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_SUGARCRMCONFIGURATION",g.newSugarcrmConfiguration=!0),g.addNewSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmAccount.addConfiguration({id:t.params.id},g.sugarcrmConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"SugarcrmConfiguration properly created",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSugarcrmConfiguration=function(){g.errors=[],d.intSugarcrmConfiguration.update({id:g.sugarcrmConfiguration.id},g.sugarcrmConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SugarcrmConfiguration properly saved!",msg:g.sugarcrmConfiguration.name?g.sugarcrmConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSugarcrmConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sugarcrmConfiguration will be deleted.").ariaLabel("Delete SugarcrmConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intSugarcrmConfiguration.delete({id:g.sugarcrmConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.sugarcrmConfiguration.id}),o.success({title:"SugarcrmConfiguration properly deleted!",msg:(g.sugarcrmConfiguration.name||"sugarcrmConfiguration")+" has been deleted!"}),v(g.sugarcrmConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intSugarcrmConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intSugarcrmConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","sugarcrmConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intSugarcrmField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intSugarcrmField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditSugarcrmAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.sugarcrmAccount=c||e.params.sugarcrmAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoSugarcrmAccounts=function(){e.go("app.integrations.sugarcrmAccounts")},u.saveSugarcrmAccount=function(){r.intSugarcrmAccount.update({id:u.sugarcrmAccount.id},u.sugarcrmAccount).$promise.then(function(){l.success({title:"SugarcrmAccount updated!",msg:u.sugarcrmAccount.name?u.sugarcrmAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintSugarcrmAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","sugarcrmAccount","userProfileSection"],angular.module("app.integrations").controller("SugarcrmAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.sugarcrmAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="sugarcrmAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSugarcrmAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,username,remoteUri,password,serverUrl,description",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.sugarcrmAccounts.edit",{id:e.id,sugarcrmAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intSugarcrmAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"SugarcrmAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"SugarcrmAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("sugarcrmAccount")+"?").htmlContent("<b>"+(e.name||"sugarcrmAccount")+"</b> will be deleted.").ariaLabel("delete sugarcrmAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSugarcrmAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intSugarcrmAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SugarcrmAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSugarcrmAccount=function(e,t){i.show({controller:"CreateOrEditSugarcrmAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sugarcrmAccount:t,sugarcrmAccounts:b.sugarcrmAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSugarcrmAccount=S,b.exportSelectedSugarcrmAccounts=function(){var e=angular.copy(b.selectedSugarcrmAccounts);return b.selectedSugarcrmAccounts=[],e},b.deleteSelectedSugarcrmAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected sugarcrmAccounts?").htmlContent("<b>"+b.selectedSugarcrmAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SugarcrmAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSugarcrmAccounts.forEach(function(e){S(e)}),b.selectedSugarcrmAccounts=[]})},b.deselectSugarcrmAccounts=function(){b.selectedSugarcrmAccounts=[]},b.selectAllSugarcrmAccounts=function(){b.selectedSugarcrmAccounts=b.sugarcrmAccounts.rows};var E=!0,A=1;function y(e){b.sugarcrmAccounts=e||{count:0,rows:[]}}function S(e){m.intSugarcrmAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.sugarcrmAccounts.rows,{id:e.id}),b.sugarcrmAccounts.count-=1,b.sugarcrmAccounts.rows.length||b.getSugarcrmAccounts(),p.success({title:_.startCase("SugarcrmAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintSugarcrmAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintSugarcrmAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSugarcrmAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sugarcrmAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("SugarcrmAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERACCOUNT",g.vtigerAccount=angular.copy(l),g.vtigerAccounts=r,g.newVtigerAccount=!1,g.vtigerAccount||(g.vtigerAccount={serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_VTIGERACCOUNT",g.newVtigerAccount=!0),g.addNewVtigerAccount=function(){g.errors=[],d.intVtigerAccount.save(g.vtigerAccount).$promise.then(function(e){g.vtigerAccounts.unshift(e.toJSON()),o.success({title:"VtigerAccount properly created",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerAccount=function(){g.errors=[],d.intVtigerAccount.update({id:g.vtigerAccount.id},g.vtigerAccount).$promise.then(function(e){var t=_.find(g.vtigerAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VtigerAccount properly saved!",msg:g.vtigerAccount.name?g.vtigerAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The vtigerAccount will be deleted.").ariaLabel("Delete VtigerAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intVtigerAccount.delete({id:g.vtigerAccount.id}).$promise.then(function(){_.remove(g.vtigerAccounts,{id:g.vtigerAccount.id}),o.success({title:"VtigerAccount properly deleted!",msg:(g.vtigerAccount.name||"vtigerAccount")+" has been deleted!"}),v(g.vtigerAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","vtigerAccounts","vtigerAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intVtigerField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.vtigerAccount={},o.vtigerConfiguration={},o.configurations=[],o.selectedVtigerConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.vtigerAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intVtigerAccount.getConfigurations({id:o.vtigerAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getVtigerConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getVtigerConfiguration=function(e){o.vtigerConfiguration=o.configurations[e],o.selectedVtigerConfiguration=e,i.intVtigerConfiguration.getSubjects({id:o.vtigerConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intVtigerConfiguration.getDescriptions({id:o.vtigerConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intVtigerConfiguration.getFields({id:o.vtigerConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditVtigerConfiguration=function(e,t){a.show({controller:"CreateOrEditVtigerConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getVtigerConfiguration(0)})},o.deleteVtigerConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the vtigerConfiguration?").htmlContent("<b>"+(t.name||"vtigerConfiguration")+"</b> will be deleted.").ariaLabel("delete vtigerConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intVtigerConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"VtigerConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getVtigerConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.vtigerConfiguration.id},o.vtigerConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditVtigerAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.vtigerConfiguration,account:o.vtigerAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("VtigerAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_VTIGERCONFIGURATION",g.vtigerConfiguration=angular.copy(l),g.configurations=r,g.newVtigerConfiguration=!1,g.vtigerConfiguration||(g.vtigerConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_VTIGERCONFIGURATION",g.newVtigerConfiguration=!0),g.addNewVtigerConfiguration=function(){g.errors=[],d.intVtigerAccount.addConfiguration({id:t.params.id},g.vtigerConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"VtigerConfiguration properly created",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVtigerConfiguration=function(){g.errors=[],d.intVtigerConfiguration.update({id:g.vtigerConfiguration.id},g.vtigerConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VtigerConfiguration properly saved!",msg:g.vtigerConfiguration.name?g.vtigerConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVtigerConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The vtigerConfiguration will be deleted.").ariaLabel("Delete VtigerConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intVtigerConfiguration.delete({id:g.vtigerConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.vtigerConfiguration.id}),o.success({title:"VtigerConfiguration properly deleted!",msg:(g.vtigerConfiguration.name||"vtigerConfiguration")+" has been deleted!"}),v(g.vtigerConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intVtigerConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intVtigerConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","vtigerConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intVtigerField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intVtigerField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditVtigerAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.vtigerAccount=c||e.params.vtigerAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVtigerAccounts=function(){e.go("app.integrations.vtigerAccounts")},u.saveVtigerAccount=function(){r.intVtigerAccount.update({id:u.vtigerAccount.id},u.vtigerAccount).$promise.then(function(){l.success({title:"VtigerAccount updated!",msg:u.vtigerAccount.name?u.vtigerAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintVtigerAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","vtigerAccount","userProfileSection"],angular.module("app.integrations").controller("VtigerAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.vtigerAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="vtigerAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedVtigerAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,description,username,accessKey,remoteUri,serverUrl",limit:10,page:1},b.editstate=function(e,t){n.go("app.integrations.vtigerAccounts.edit",{id:e.id,vtigerAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intVtigerAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"VtigerAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"VtigerAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("vtigerAccount")+"?").htmlContent("<b>"+(e.name||"vtigerAccount")+"</b> will be deleted.").ariaLabel("delete vtigerAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVtigerAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intVtigerAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VtigerAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVtigerAccount=function(e,t){i.show({controller:"CreateOrEditVtigerAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{vtigerAccount:t,vtigerAccounts:b.vtigerAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVtigerAccount=S,b.exportSelectedVtigerAccounts=function(){var e=angular.copy(b.selectedVtigerAccounts);return b.selectedVtigerAccounts=[],e},b.deleteSelectedVtigerAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected vtigerAccounts?").htmlContent("<b>"+b.selectedVtigerAccounts.length+" selected</b> will be deleted.").ariaLabel("delete VtigerAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVtigerAccounts.forEach(function(e){S(e)}),b.selectedVtigerAccounts=[]})},b.deselectVtigerAccounts=function(){b.selectedVtigerAccounts=[]},b.selectAllVtigerAccounts=function(){b.selectedVtigerAccounts=b.vtigerAccounts.rows};var E=!0,A=1;function y(e){b.vtigerAccounts=e||{count:0,rows:[]}}function S(e){m.intVtigerAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.vtigerAccounts.rows,{id:e.id}),b.vtigerAccounts.count-=1,b.vtigerAccounts.rows.length||b.getVtigerAccounts(),p.success({title:_.startCase("VtigerAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintVtigerAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintVtigerAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVtigerAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","vtigerAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("VtigerAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKACCOUNT",g.zendeskAccount=angular.copy(l),g.zendeskAccounts=r,g.newZendeskAccount=!1,g.zendeskAccount||(g.zendeskAccount={type:"integrationTab",authType:"password",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_ZENDESKACCOUNT",g.newZendeskAccount=!0),g.addNewZendeskAccount=function(){g.errors=[],d.intZendeskAccount.save(g.zendeskAccount).$promise.then(function(e){g.zendeskAccounts.unshift(e.toJSON()),o.success({title:"ZendeskAccount properly created",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskAccount=function(){g.errors=[],d.intZendeskAccount.update({id:g.zendeskAccount.id},g.zendeskAccount).$promise.then(function(e){var t=_.find(g.zendeskAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZendeskAccount properly saved!",msg:g.zendeskAccount.name?g.zendeskAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskAccount will be deleted.").ariaLabel("Delete ZendeskAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZendeskAccount.delete({id:g.zendeskAccount.id}).$promise.then(function(){_.remove(g.zendeskAccounts,{id:g.zendeskAccount.id}),o.success({title:"ZendeskAccount properly deleted!",msg:(g.zendeskAccount.name||"zendeskAccount")+" has been deleted!"}),v(g.zendeskAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskAccounts","zendeskAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZendeskField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZendeskField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.zendeskAccount=c||e.params.zendeskAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZendeskAccounts=function(){e.go("app.integrations.zendeskAccounts")},u.saveZendeskAccount=function(){r.intZendeskAccount.update({id:u.zendeskAccount.id},u.zendeskAccount).$promise.then(function(){l.success({title:"ZendeskAccount updated!",msg:u.zendeskAccount.name?u.zendeskAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZendeskAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zendeskAccount","userProfileSection"],angular.module("app.integrations").controller("ZendeskAccountController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZendeskField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zendeskAccount={},o.zendeskConfiguration={},o.zendeskConfigurations=[],o.selectedZendeskConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.zendeskAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZendeskAccount.getConfigurations({id:o.zendeskAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.zendeskConfigurations=e.rows?e.rows:[],o.zendeskConfigurations.length&&o.getZendeskConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZendeskConfiguration=function(e){o.zendeskConfiguration=o.zendeskConfigurations[e],o.selectedZendeskConfiguration=e,i.intZendeskConfiguration.getSubjects({id:o.zendeskConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZendeskConfiguration.getDescriptions({id:o.zendeskConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZendeskConfiguration.getFields({id:o.zendeskConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})}),i.intZendeskConfiguration.getTags({id:o.zendeskConfiguration.id}).$promise.then(function(e){o.selectedTags=e.rows?_.map(e.rows,"id"):[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZendeskConfiguration=function(e,t){a.show({controller:"CreateOrEditZendeskConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskConfiguration:t,zendeskConfigurations:o.zendeskConfigurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZendeskConfiguration(0)})},o.deleteZendeskConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zendeskConfiguration?").htmlContent("<b>"+(t.name||"zendeskConfiguration")+"</b> will be deleted.").ariaLabel("delete zendeskConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZendeskConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.zendeskConfigurations,{id:t.id}),s.success({title:"ZendeskConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZendeskConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.zendeskConfiguration.id},o.zendeskConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedTags=[],o.selectTagsChanged=function(e){i.intZendeskConfiguration.setTags({id:o.zendeskConfiguration.id,ids:o.selectedTags}).$promise.then(function(){s.success({title:"Tags set!",msg:"Tags has been set!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ADDTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})},i.tag.get({nolimit:!0,sort:"name"}).$promise.then(function(e){o.tags=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZendeskAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.zendeskConfiguration,account:o.zendeskAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZendeskAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZENDESKCONFIGURATION",g.zendeskConfiguration=angular.copy(l),g.zendeskConfigurations=r,g.newZendeskConfiguration=!1,g.zendeskConfiguration||(g.zendeskConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZENDESKCONFIGURATION",g.newZendeskConfiguration=!0),g.addNewZendeskConfiguration=function(){g.errors=[],d.intZendeskAccount.addConfiguration({id:t.params.id},g.zendeskConfiguration).$promise.then(function(e){g.zendeskConfigurations.unshift(e.toJSON()),o.success({title:"ZendeskConfiguration properly created",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZendeskConfiguration=function(){g.errors=[],d.intZendeskConfiguration.update({id:g.zendeskConfiguration.id},g.zendeskConfiguration).$promise.then(function(e){var t=_.find(g.zendeskConfigurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZendeskConfiguration properly saved!",msg:g.zendeskConfiguration.name?g.zendeskConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZendeskConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zendeskConfiguration will be deleted.").ariaLabel("Delete ZendeskConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZendeskConfiguration.delete({id:g.zendeskConfiguration.id}).$promise.then(function(){_.remove(g.zendeskConfigurations,{id:g.zendeskConfiguration.id}),o.success({title:"ZendeskConfiguration properly deleted!",msg:(g.zendeskConfiguration.name||"zendeskConfiguration")+" has been deleted!"}),v(g.zendeskConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZendeskConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZendeskConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zendeskConfigurations","zendeskConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZendeskConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.zendeskAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="zendeskAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedZendeskAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,type,username,remoteUri,authType,password,token,serverUrl,description",limit:10,page:1},b.arraytype=_.keyBy([{option:"Integration_Tab",value:"'integrationTab'"},{option:"New_Tab",value:"'newTab'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayauthType=_.keyBy([{option:"Password",value:"'password'"},{option:"Token",value:"'token'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.zendeskAccounts.edit",{id:e.id,zendeskAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intZendeskAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZendeskAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZendeskAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("zendeskAccount")+"?").htmlContent("<b>"+(e.name||"zendeskAccount")+"</b> will be deleted.").ariaLabel("delete zendeskAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getZendeskAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intZendeskAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ZendeskAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditZendeskAccount=function(e,t){i.show({controller:"CreateOrEditZendeskAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zendeskAccount:t,zendeskAccounts:b.zendeskAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteZendeskAccount=S,b.exportSelectedZendeskAccounts=function(){var e=angular.copy(b.selectedZendeskAccounts);return b.selectedZendeskAccounts=[],e},b.deleteSelectedZendeskAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zendeskAccounts?").htmlContent("<b>"+b.selectedZendeskAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZendeskAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedZendeskAccounts.forEach(function(e){S(e)}),b.selectedZendeskAccounts=[]})},b.deselectZendeskAccounts=function(){b.selectedZendeskAccounts=[]},b.selectAllZendeskAccounts=function(){b.selectedZendeskAccounts=b.zendeskAccounts.rows};var E=!0,A=1;function y(e){b.zendeskAccounts=e||{count:0,rows:[]}}function S(e){m.intZendeskAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.zendeskAccounts.rows,{id:e.id}),b.zendeskAccounts.count-=1,b.zendeskAccounts.rows.length||b.getZendeskAccounts(),p.success({title:_.startCase("ZendeskAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZendeskAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZendeskAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getZendeskAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zendeskAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZendeskAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOACCOUNT",g.zohoAccount=angular.copy(l),g.zohoAccounts=r,g.newZohoAccount=!1,g.zohoAccount||(g.zohoAccount={host:"zoho.com",serverUrl:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():"")},g.title="INTEGRATIONS.NEW_ZOHOACCOUNT",g.newZohoAccount=!0),g.addNewZohoAccount=function(){g.errors=[],d.intZohoAccount.save(g.zohoAccount).$promise.then(function(e){g.zohoAccounts.unshift(e.toJSON()),o.success({title:"ZohoAccount properly created",msg:g.zohoAccount.name?g.zohoAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoAccount=function(){g.errors=[],d.intZohoAccount.update({id:g.zohoAccount.id},g.zohoAccount).$promise.then(function(e){var t=_.find(g.zohoAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZohoAccount properly saved!",msg:g.zohoAccount.name?g.zohoAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoAccount will be deleted.").ariaLabel("Delete ZohoAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZohoAccount.delete({id:g.zohoAccount.id}).$promise.then(function(){_.remove(g.zohoAccounts,{id:g.zohoAccount.id}),o.success({title:"ZohoAccount properly deleted!",msg:(g.zohoAccount.name||"zohoAccount")+" has been deleted!"}),v(g.zohoAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","zohoAccounts","zohoAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountDialogController",e)}(),function(){"use strict";function e(a,n,i,s,e){var o=this;function r(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.subjects,{id:e.id}),s.success({title:"Subject deleted!",msg:"Subject has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function l(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.descriptions,{id:e.id}),s.success({title:"Description deleted!",msg:"Description has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}function d(e){i.intZohoField.delete({id:e.id}).$promise.then(function(){_.remove(o.fields,{id:e.id}),s.success({title:"Field deleted!",msg:"Field has been deleted!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})}o.currentUser=e.getCurrentUser(),o.zohoAccount={},o.zohoConfiguration={},o.configurations=[],o.selectedZohoConfiguration=-1,o.crudPermissions,o.init=function(e,t){o.zohoAccount=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.intZohoAccount.getConfigurations({id:o.zohoAccount.id,sort:"-updatedAt"}).$promise.then(function(e){return o.configurations=e.rows?e.rows:[],o.configurations.length&&o.getZohoConfiguration(0),i.variable.get({nolimit:!0,sort:"name"}).$promise}).then(function(e){o.variables=e.rows?e.rows:[],o.variablesById=_.keyBy(o.variables,"id")}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETCONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getZohoConfiguration=function(e){o.zohoConfiguration=o.configurations[e],o.selectedZohoConfiguration=e,i.intZohoConfiguration.getSubjects({id:o.zohoConfiguration.id}).$promise.then(function(e){return o.subjects=e.rows?e.rows:[],i.intZohoConfiguration.getDescriptions({id:o.zohoConfiguration.id}).$promise}).then(function(e){return o.descriptions=e.rows?e.rows:[],i.intZohoConfiguration.getFields({id:o.zohoConfiguration.id}).$promise}).then(function(e){o.fields=e.rows?e.rows:[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETConfigurations",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.createOrEditZohoConfiguration=function(e,t){a.show({controller:"CreateOrEditZohoConfigurationDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoConfiguration:t,configurations:o.configurations,license:null,setting:null,crudPermissions:o.crudPermissions}}).finally(function(){o.getZohoConfiguration(0)})},o.deleteZohoConfiguration=function(e,t){var n=a.confirm().title("Are you sure want to delete the zohoConfiguration?").htmlContent("<b>"+(t.name||"zohoConfiguration")+"</b> will be deleted.").ariaLabel("delete zohoConfiguration").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){i.intZohoConfiguration.delete({id:t.id}).$promise.then(function(){_.remove(o.configurations,{id:t.id}),s.success({title:"ZohoConfiguration deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETECONFIGURATION",msg:e.data?JSON.stringify(e.data):e.toString()})}).finally(function(){o.getZohoConfiguration(0)})},function(){console.log("CANCEL")})},o.selectChangedAdvanced=function(){return i.intSalesforceConfiguration.update({id:o.zohoConfiguration.id},o.zohoConfiguration).$promise.then(function(){s.success({title:"Module updated!",msg:"Module has been updated!"})}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATECONFIGURATIONFIELD",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.selectedSubjects=[],o.createOrEditSubject=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"subject",item:t,items:o.subjects,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteSubjectConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the subject?").htmlContent("<b>Subject</b> will be deleted.").ariaLabel("delete subject").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){r(t)},function(){console.log("CANCEL")})},o.deleteSelectedSubjects=function(e){var t=a.confirm().title("Are you sure want to delete the selected subjects?").htmlContent("<b>"+o.selectedSubjects.length+" selected</b> will be deleted.").ariaLabel("delete subjects").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedSubjects.forEach(function(e){r(e)}),o.selectedSubjects=[]})},o.selectedDescriptions=[],o.createOrEditDescription=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"description",item:t,items:o.descriptions,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteDescriptionConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the description?").htmlContent("<b>Description</b> will be deleted.").ariaLabel("delete description").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){l(t)},function(){console.log("CANCEL")})},o.deleteSelectedDescriptions=function(e){var t=a.confirm().title("Are you sure want to delete the selected descriptions?").htmlContent("<b>"+o.selectedDescriptions.length+" selected</b> will be deleted.").ariaLabel("delete descriptions").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedDescriptions.forEach(function(e){l(e)}),o.selectedDescriptions=[]})},o.selectedFields=[],o.createOrEditField=function(e,t){a.show({controller:"CreateOrEditZohoAccountItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{type:"field",item:t,items:o.fields,configuration:o.zohoConfiguration,account:o.zohoAccount,license:null,setting:null,crudPermissions:o.crudPermissions}})},o.deleteFieldConfirm=function(e,t){var n=a.confirm().title("Are you sure want to delete the field?").htmlContent("<b>Field</b> will be deleted.").ariaLabel("delete field").targetEvent(e).ok("OK").cancel("CANCEL");a.show(n).then(function(){d(t)},function(){console.log("CANCEL")})},o.deleteSelectedFields=function(e){var t=a.confirm().title("Are you sure want to delete the selected fields?").htmlContent("<b>"+o.selectedFields.length+" selected</b> will be deleted.").ariaLabel("delete fields").targetEvent(e).ok("OK").cancel("CANCEL");a.show(t).then(function(){o.selectedFields.forEach(function(e){d(e)}),o.selectedFields=[]})}}e.$inject=["$mdDialog","$document","api","toasty","Auth"],angular.module("app.integrations").controller("ZohoAccountConfigurationsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="INTEGRATIONS.EDIT_ZOHOCONFIGURATION",g.zohoConfiguration=angular.copy(l),g.configurations=r,g.newZohoConfiguration=!1,g.zohoConfiguration||(g.zohoConfiguration={channel:"voice",type:"inbound"},g.title="INTEGRATIONS.NEW_ZOHOCONFIGURATION",g.newZohoConfiguration=!0),g.addNewZohoConfiguration=function(){g.errors=[],d.intZohoAccount.addConfiguration({id:t.params.id},g.zohoConfiguration).$promise.then(function(e){g.configurations.unshift(e.toJSON()),o.success({title:"ZohoConfiguration properly created",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveZohoConfiguration=function(){g.errors=[],d.intZohoConfiguration.update({id:g.zohoConfiguration.id},g.zohoConfiguration).$promise.then(function(e){var t=_.find(g.configurations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"ZohoConfiguration properly saved!",msg:g.zohoConfiguration.name?g.zohoConfiguration.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteZohoConfiguration=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The zohoConfiguration will be deleted.").ariaLabel("Delete ZohoConfiguration").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.intZohoConfiguration.delete({id:g.zohoConfiguration.id}).$promise.then(function(){_.remove(g.configurations,{id:g.zohoConfiguration.id}),o.success({title:"ZohoConfiguration properly deleted!",msg:(g.zohoConfiguration.name||"zohoConfiguration")+" has been deleted!"}),v(g.zohoConfiguration)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.intZohoConfiguration.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.intZohoConfiguration.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","configurations","zohoConfiguration","api","Auth","license","setting","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoConfigurationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){a.hide()}p.currentUser=m.getCurrentUser(),p.errors=[],p.title="INTEGRATIONS.EDIT_"+_.toUpper(d),p.item=angular.copy(r),p.items=o,p.type=d,p.crudPermissions=u,p.newItem=!1,p.item||(p.item={type:"string"},p.item[_.capitalize(d)+"Id"]=s.id,p.title="INTEGRATIONS.NEW_"+_.toUpper(d),p.newItem=!0),p.addNewItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.save(p.item).$promise.then(function(e){p.items.unshift(e),i.success({title:_.capitalize(d)+" properly created",msg:_.capitalize(d)+" has been created!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.save"}]})},p.saveItem=function(){p.errors=[],p.customField&&(p.item.idField=p.customField.id,p.item.nameField=p.customField.name,p.item.customField=p.customField.custom);c.intZohoField.update({id:p.item.id},p.item).$promise.then(function(e){var t=_.find(p.items,{id:e.id});t&&_.merge(t,e),i.success({title:_.capitalize(d)+" properly saved!",msg:_.capitalize(d)+" has been saved!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.intItem.update"}]})},p.deleteItem=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The "+d+" will be deleted.").ariaLabel("Delete "+_.capitalize(d)).ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.intZohoField.delete({id:p.item.id}).$promise.then(function(){_.remove(p.items,{id:p.item.id}),i.success({title:_.capitalize(d)+" properly deleted!",msg:_.capitalize(d)+" has been deleted!"}),g()}).catch(function(e){console.error(e),p.errors=e.data.errors||[{message:e.toString(),type:"api.item.delete"}]})},function(){})},p.getSelectedVariable=function(){return void 0!==p.item.variableName?p.item.variableName:"Please select a variable"},p.closeDialog=g,c.variable.get({nolimit:!0}).$promise.then(function(e){return p.variables=e.rows?e.rows:[],c.voiceAgentReport.describe().$promise}).then(function(e){return p.voiceAgentReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceAgentReportColumns.push("recordingURL"),c.voiceDialReport.describe().$promise}).then(function(e){p.voiceDialReportColumns=_.difference(_.keys(e),["$promise","$resolved","createdAt","updatedAt","sourceid"]),p.voiceDialReportColumns.push("recordingURL")}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETVARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.getFields({id:l.id}).$promise.then(function(e){p.accountConnected=!0,p.fields=e.rows?e.rows:[],p.item.idField&&(p.customField=_.find(p.fields,{id:p.item.idField}))}).catch(function(e){p.accountConnected=!1,console.error(e)})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","configuration","items","item","account","type","api","Auth","crudPermissions"],angular.module("app.integrations").controller("CreateOrEditZohoAccountItemDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.zohoAccount=c||e.params.zohoAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoZohoAccounts=function(){e.go("app.integrations.zohoAccounts")},u.saveZohoAccount=function(){r.intZohoAccount.update({id:u.zohoAccount.id},u.zohoAccount).$promise.then(function(){l.success({title:"ZohoAccount updated!",msg:u.zohoAccount.name?u.zohoAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETintZohoAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","zohoAccount","userProfileSection"],angular.module("app.integrations").controller("ZohoAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.zohoAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="zohoAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedZohoAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,host,authToken,serverUrl,description",limit:10,page:1},b.arrayhost=_.keyBy([{option:"zoho.com",value:"'zoho.com'"},{option:"zoho.eu",value:"'zoho.eu'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.integrations.zohoAccounts.edit",{id:e.id,zohoAccount:e,crudPermissions:b.crudPermissions})},b.testtestintegrationaccount=function(e,t){return m.intZohoAccount.getFields({id:e.id,test:!0}).$promise.then(function(){p.success({title:"ZohoAccount properly tested",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"ZohoAccount properly tested",msg:e.data?e.data.message?e.data.message:JSON.stringify(e.data):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("zohoAccount")+"?").htmlContent("<b>"+(e.name||"zohoAccount")+"</b> will be deleted.").ariaLabel("delete zohoAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getZohoAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.intZohoAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ZohoAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditZohoAccount=function(e,t){i.show({controller:"CreateOrEditZohoAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/integrations/views/zohoAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{zohoAccount:t,zohoAccounts:b.zohoAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteZohoAccount=S,b.exportSelectedZohoAccounts=function(){var e=angular.copy(b.selectedZohoAccounts);return b.selectedZohoAccounts=[],e},b.deleteSelectedZohoAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected zohoAccounts?").htmlContent("<b>"+b.selectedZohoAccounts.length+" selected</b> will be deleted.").ariaLabel("delete ZohoAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedZohoAccounts.forEach(function(e){S(e)}),b.selectedZohoAccounts=[]})},b.deselectZohoAccounts=function(){b.selectedZohoAccounts=[]},b.selectAllZohoAccounts=function(){b.selectedZohoAccounts=b.zohoAccounts.rows};var E=!0,A=1;function y(e){b.zohoAccounts=e||{count:0,rows:[]}}function S(e){m.intZohoAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.zohoAccounts.rows,{id:e.id}),b.zohoAccounts.count-=1,b.zohoAccounts.rows.length||b.getZohoAccounts(),p.success({title:_.startCase("ZohoAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEintZohoAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEintZohoAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getZohoAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","zohoAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.integrations").controller("ZohoAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="JSCRIPTY.EDIT_PROJECT",g.project=angular.copy(l),g.projects=r,g.newProject=!1,g.project||(g.project={enableUncompleteSave:!0},g.title="JSCRIPTY.NEW_PROJECT",g.newProject=!0),g.addNewProject=function(){g.errors=[],d.jscriptyProject.save(g.project).$promise.then(function(e){g.projects.unshift(e.toJSON()),o.success({title:"Project properly created",msg:g.project.name?g.project.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveProject=function(){g.errors=[],d.jscriptyProject.update({id:g.project.id},g.project).$promise.then(function(e){var t=_.find(g.projects,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Project properly saved!",msg:g.project.name?g.project.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteProject=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The project will be deleted.").ariaLabel("Delete Project").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.jscriptyProject.delete({id:g.project.id}).$promise.then(function(){_.remove(g.projects,{id:g.project.id}),o.success({title:"Project properly deleted!",msg:(g.project.name||"project")+" has been deleted!"}),v(g.project)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","projects","project","api","Auth","license","setting","crudPermissions"],angular.module("app.jscripty").controller("CreateOrEditProjectDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.project={},o.localizationMap=s;var r=new Date;r.setHours(0,0,0,0),o.pickerModel={dateStart:r,dateEnd:null,selectedTemplate:"TD"},o.init=function(e){o.project=e,o.getAnswers()},o.getSummary=function(){return a.jscriptyProject.getSummary({id:o.project.id,startTime:{$gte:o.pickerModel.dateStart,$lte:moment(o.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(void 0!==e.length){var t=[e.buffer],n=new Blob(t,{type:e.type}),a=window.document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download","jscriptyProjectSummary_"+o.project.id+".csv"),a.click()}else i.info({title:"EXPORT",msg:"No answers available"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.getSummary",msg:e.data?JSON.stringify(e.data):e.toString()})})},o.getAnswers=function(){return o.hasIdAnswers=!1,a.jscriptyProject.getAnswers({id:o.project.id,sort:"-createdAt,questionId",createdAt:{$gte:o.pickerModel.dateStart,$lte:moment(o.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format()},nolimit:!0}).$promise.then(function(e){if(e&&e.rows&&e.hasOwnProperty("count")){o.answers={};for(var t=0,n=e.count;t<n;t++)e.rows[t].questionId&&(o.hasIdAnswers=!0,o.answers.hasOwnProperty(e.rows[t].questionId)||(o.answers[e.rows[t].questionId]={question:e.rows[t].question,answers:{},sum:0}),""===e.rows[t].answer&&(e.rows[t].answer="NO_ANSWER"),o.answers[e.rows[t].questionId].answers[e.rows[t].answer]?o.answers[e.rows[t].questionId].answers[e.rows[t].answer]+=1:o.answers[e.rows[t].questionId].answers[e.rows[t].answer]=1,o.answers[e.rows[t].questionId].sum+=1)}}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETANSWERS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$mdDialog","$document","$window","api","toasty","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("ProjectAnswersController",e)}(),function(){"use strict";angular.module("app.jscripty").controller("ProjectBuilderController",function(){var t=this;t.project={},t.optionsBuilder={questionTypes:["text","textarea","radio","checkbox","select","number","date","time","email","range","url"],elementTypes:["question","paragraph"]},t.init=function(e){t.project=e,_.isObjectLike(e.formData)?t.project.formData=e.formData:t.isJsonString(e.formData)?t.project.formData=JSON.parse(e.formData):t.project.formData={}},t.isJsonString=function(e){if(_.isNil(e))return!1;try{JSON.parse(e)}catch(e){return!1}return!0}})}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newProject=!0,r.project=angular.copy(i),r.projects=s,r.title=o.instant("JSCRIPTY.CLONE_PROJECT"),i&&i.name&&(r.title+=": "+i.name),r.cloneProject=function(){return e.jscriptyProject.clone({id:i.id},r.project).$promise.then(function(e){r.projects.unshift(e.toJSON()),a.success({title:"Project properly cloned",msg:r.project.name?r.project.name+" has been cloned!":""}),n.go("app.jscripty.projects.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.jscriptyProject.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.jscriptyProject.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","project","projects","$translate"],angular.module("app.jscripty").controller("ProjectcloneController",e)}(),function(){"use strict";function e(a,i,t){var o=this;o.project={},o.responseData={},o.formViewer={},o.init=function(e){o.project=e,t.$on("mwForm.pageEvents.pageCurrentChanged",function(e,t){if(t.currentPage&&o.project.formData&&o.project.formData.pages)for(var n=0,a=o.project.formData.pages.length;n<a;n++)if(t.currentPage.number<n+1&&o.project.formData.pages[n].elements)for(var i=0,s=o.project.formData.pages[n].elements.length;i<s;i++)"question"===o.project.formData.pages[n].elements[i].type&&o.project.formData.pages[n].elements[i].question&&delete o.responseData[o.project.formData.pages[n].elements[i].question.id]})},o.onSubmit=function(e){var t=a.defer(),n=i.confirm().title("Would you like to save your survey?").textContent("").ariaLabel("survey").targetEvent(e).ok("SAVE").cancel("CANCEL");return i.show(n).then(function(){t.resolve(!0)},function(){t.reject()}),t.promise},o.resetViewer=function(){o.formViewer.reset&&o.formViewer.reset()}}e.$inject=["$q","$mdDialog","$scope"],angular.module("app.jscripty").controller("ProjectViewerController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.project={},c.projectSessions={count:0,rows:[]},c.selectedProjectSessions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,starttime,endtime,membername,calleridnum,completed",sort:"-starttime",limit:10,page:1},c.init=function(e,t){c.project=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.project.id,c.getProjectSessions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the session?").htmlContent("<b>"+(e.name||"session")+"</b> will be deleted.").ariaLabel("delete session").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getProjectSessions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.jscriptyProject.getSessions(c.query,p).$promise},c.createOrEditProjectSession=function(e,t){s.show({controller:"CreateOrEditSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:c.project,session:t,sessions:c.projectSessions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.showQuestionsProjectSession=function(e,n){s.show({controller:"ShowQuestionsSessionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,resolve:{questions:["apiResolver","$stateParams",function(e,t){return e.resolve("jscriptySessionReport@getQuestions",{fields:"question,answer",sort:"id",id:n.id})}]},locals:{project:c.project,session:n}})},c.exportSelectedProjectSessions=function(){var e=angular.copy(c.selectedProjectSessions);return c.selectedProjectSessions=[],e},c.deleteProjectSession=g,c.deleteSelectedProjectSessions=function(e){var t=s.confirm().title("Are you sure want to delete the selected sessions?").htmlContent("<b>"+c.selectedProjectSessions.length+" selected</b> will be deleted.").ariaLabel("delete sessions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedProjectSessions.forEach(function(e){g(e)}),c.selectedProjectSessions=[]})};var m=!0,u=1;function p(e){c.projectSessions=e||{count:0,rows:[]}}function g(e){l.jscriptySessionReport.delete({id:e.id}).$promise.then(function(){_.remove(c.projectSessions.rows,{id:e.id}),c.projectSessions.count-=1,c.projectSessions.rows.length||c.getProjectSessions(),r.success({title:"Session deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getProjectSessions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.jscripty").controller("ProjectSessionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){this.title="JSCRIPTY.SESSION_RESULTS",this.session=s,this.questions=o,this.project=r,this.closeDialog=function(e){a.hide(e)}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","session","questions","project","api"],angular.module("app.jscripty").controller("ShowQuestionsSessionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.project=c||e.params.project||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.clonedialog=function(e,t){n.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:u.projects?u.projects.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoProjects=function(){e.go("app.jscripty.projects")},u.saveProject=function(){r.jscriptyProject.update({id:u.project.id},u.project).$promise.then(function(){l.success({title:"Project updated!",msg:u.project.name?u.project.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETjscriptyProject",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","project","userProfileSection"],angular.module("app.jscripty").controller("JscriptyProjectController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.projects=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="projects",b.listOrder="",b.listOrderAsc=null,b.selectedProjects=[],b.query={fields:"createdAt,updatedAt,id,name,enableUncompleteSave,description,formData",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,project:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"ProjectcloneController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{project:e,projects:b.projects?b.projects.rows:[],crudPermissions:b.crudPermissions}})},b.sessionsgoto=function(e,t){n.go("app.jscripty.projects.edit",{id:e.id,tab:3})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("project")+"?").htmlContent("<b>"+(e.name||"project")+"</b> will be deleted.").ariaLabel("delete project").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getProjects=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.jscriptyProject.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Projects",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditProject=function(e,t){i.show({controller:"CreateOrEditProjectDialogController",controllerAs:"vm",templateUrl:"app/main/apps/jscripty/views/projects/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{project:t,projects:b.projects.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteProject=S,b.exportSelectedProjects=function(){var e=angular.copy(b.selectedProjects);return b.selectedProjects=[],e},b.deleteSelectedProjects=function(e){var t=i.confirm().title("Are you sure want to delete the selected projects?").htmlContent("<b>"+b.selectedProjects.length+" selected</b> will be deleted.").ariaLabel("delete Projects").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedProjects.forEach(function(e){S(e)}),b.selectedProjects=[]})},b.deselectProjects=function(){b.selectedProjects=[]},b.selectAllProjects=function(){b.selectedProjects=b.projects.rows};var E=!0,A=1;function y(e){b.projects=e||{count:0,rows:[]}}function S(e){m.jscriptyProject.delete({id:e.id}).$promise.then(function(){_.remove(b.projects.rows,{id:e.id}),b.projects.count-=1,b.projects.rows.length||b.getProjects(),p.success({title:_.startCase("Project")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEjscriptyProject"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEjscriptyProject",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getProjects())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","projects","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.jscripty").controller("JscriptyProjectsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILACCOUNT",g.mailAccount=angular.copy(l),g.mailAccounts=r,g.newMailAccount=!1,g.mailAccount||(g.mailAccount={active:!0,cservice:"null",cauthentication:!0,fontSize:13,waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="MAIL.NEW_MAILACCOUNT",g.newMailAccount=!0),t.params.id&&(g.mailAccount.MailAccountId=t.params.id),g.addNewMailAccount=function(){g.errors=[],d.mailAccount.save(g.mailAccount).$promise.then(function(e){g.mailAccounts.unshift(e.toJSON()),o.success({title:"MailAccount properly created",msg:g.mailAccount.name?g.mailAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailAccount=function(){g.errors=[],d.mailAccount.update({id:g.mailAccount.id},g.mailAccount).$promise.then(function(e){var t=_.find(g.mailAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailAccount properly saved!",msg:g.mailAccount.name?g.mailAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailAccount=function(e){if(g.mailAccount.service)return o.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailAccount will be deleted.").ariaLabel("Delete MailAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailAccount.delete({id:g.mailAccount.id}).$promise.then(function(){_.remove(g.mailAccounts,{id:g.mailAccount.id}),o.success({title:"MailAccount properly deleted!",msg:(g.mailAccount.name||"mailAccount")+" has been deleted!"}),v(g.mailAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.mailAccount&&(n=_.find(g.lists,{id:Number(g.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.mailAccount&&(a=_.find(g.lists,{id:Number(g.mailAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailAccounts","mailAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccountApp:n,mailAccount:r.mailAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.mailAccountApps.rows[t]=e:r.mailAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.mailAccountApps.rows.length;n++,0){var a=r.mailAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.mailAccount.context,a.exten=r.mailAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.mailAccount.addApplications({id:r.mailAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.mailAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.mailAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.mailAccount={},r.mailAccountApps={count:0,rows:[]},r.selectedMailAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"MailQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"mailQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:601}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"html",required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.mailAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getMailAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.mailAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getMailAccountApps=function(){r.promise=o.mailAccount.getApplications(r.query,n).$promise},r.editMailAccountApp=t,r.editInterval=function(e,t){if(r.mailAccountApps.rows.length){var n=r.mailAccountApps.rows[t]?r.mailAccountApps.rows[t]:r.mailAccountApps.rows[0];i.show({controller:"EditMailAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteMailAccountApp=function(e){_.remove(r.mailAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedMailAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedMailAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedMailAccountApps.forEach(function(e){_.remove(r.mailAccountApps.rows,{id:e.id})}),r.selectedMailAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.mail").controller("MailAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailAccount.getAgents({id:c.mailAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserMailAccount?"penalty "+e.UserMailAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.mailAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailAccount.removeAgents({id:c.mailAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailAccount.addAgents({id:c.mailAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","mailAccount","mailAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditMailAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("mail")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.mailQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:601}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="MAIL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveMailAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","mailAccountApp","mailAccount","api","Auth","crudPermissions"],angular.module("app.mail").controller("EditMailAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountInteractions={count:0,rows:[]},c.selectedMailAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,UserId,ContactId,MailAccountId,id,Contact.firstName,Owner.name,closedAt,disposition,note,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.getMailAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.mailInteractionDownload=function(s,e,t){return l.mailInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="mail-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMailAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getInteractions(c.query,p).$promise},c.createOrEditMailAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,interaction:t,interactions:c.mailAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spymailInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"mail",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedMailAccountInteractions=function(){var e=angular.copy(c.selectedMailAccountInteractions);return c.selectedMailAccountInteractions=[],e},c.deleteMailAccountInteraction=g,c.deleteSelectedMailAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedMailAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountInteractions.forEach(function(e){g(e)}),c.selectedMailAccountInteractions=[]})};var m=!0,u=1;function p(e){c.mailAccountInteractions=e||{count:0,rows:[]}}function g(e){l.mailInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountInteractions.rows,{id:e.id}),c.mailAccountInteractions.count-=1,c.mailAccountInteractions.rows.length||c.getMailAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailCannedAnswers={count:0,rows:[]},c.selectedMailAccountMailCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mailCannedAnswer?").htmlContent("<b>"+(e.name||"mailCannedAnswer")+"</b> will be deleted.").ariaLabel("delete mailCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getAnswers(c.query,p).$promise},c.createOrEditMailAccountMailCannedAnswer=function(e,t){s.show({controller:"CreateOrEditMailCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailCannedAnswer:t,mailCannedAnswers:c.mailAccountMailCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMailAccountMailCannedAnswers=function(){var e=angular.copy(c.selectedMailAccountMailCannedAnswers);return c.selectedMailAccountMailCannedAnswers=[],e},c.deleteMailAccountMailCannedAnswer=g,c.deleteSelectedMailAccountMailCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected mailCannedAnswers?").htmlContent("<b>"+c.selectedMailAccountMailCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete mailCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountMailCannedAnswers.forEach(function(e){g(e)}),c.selectedMailAccountMailCannedAnswers=[]})};var m=!0,u=1;function p(e){c.mailAccountMailCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailCannedAnswers.rows,{id:e.id}),c.mailAccountMailCannedAnswers.count-=1,c.mailAccountMailCannedAnswers.rows.length||c.getMailAccountMailCannedAnswers(),r.success({title:"MailCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILCANNEDANSWER",g.mailCannedAnswer=angular.copy(l),g.mailCannedAnswers=r,g.newMailCannedAnswer=!1,g.mailCannedAnswer||(g.mailCannedAnswer={},g.title="MAIL.NEW_MAILCANNEDANSWER",g.newMailCannedAnswer=!0),t.params.id&&(g.mailCannedAnswer.MailAccountId=t.params.id),g.addNewMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.mailCannedAnswer).$promise.then(function(e){g.mailCannedAnswers.unshift(e.toJSON()),o.success({title:"MailCannedAnswer properly created",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.mailCannedAnswer.id},g.mailCannedAnswer).$promise.then(function(e){var t=_.find(g.mailCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailCannedAnswer properly saved!",msg:g.mailCannedAnswer.name?g.mailCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailCannedAnswer will be deleted.").ariaLabel("Delete MailCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.mailCannedAnswer.id}).$promise.then(function(){_.remove(g.mailCannedAnswers,{id:g.mailCannedAnswer.id}),o.success({title:"MailCannedAnswer properly deleted!",msg:(g.mailCannedAnswer.name||"mailCannedAnswer")+" has been deleted!"}),v(g.mailCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailCannedAnswers","mailCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.mailAccount={},c.mailAccountMailDispositions={count:0,rows:[]},c.selectedMailAccountMailDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.mailAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.mailAccount.id,c.query.MailAccountId=c.mailAccount.id,c.getMailAccountMailDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mailDisposition?").htmlContent("<b>"+(e.name||"mailDisposition")+"</b> will be deleted.").ariaLabel("delete mailDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getMailAccountMailDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.mailAccount.getDispositions(c.query,p).$promise},c.createOrEditMailAccountMailDisposition=function(e,t){s.show({controller:"CreateOrEditMailDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:c.mailAccount,mailDisposition:t,mailDispositions:c.mailAccountMailDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMailAccountMailDispositions=function(){var e=angular.copy(c.selectedMailAccountMailDispositions);return c.selectedMailAccountMailDispositions=[],e},c.deleteMailAccountMailDisposition=g,c.deleteSelectedMailAccountMailDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected mailDispositions?").htmlContent("<b>"+c.selectedMailAccountMailDispositions.length+" selected</b> will be deleted.").ariaLabel("delete mailDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMailAccountMailDispositions.forEach(function(e){g(e)}),c.selectedMailAccountMailDispositions=[]})};var m=!0,u=1;function p(e){c.mailAccountMailDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.mailAccountMailDispositions.rows,{id:e.id}),c.mailAccountMailDispositions.count-=1,c.mailAccountMailDispositions.rows.length||c.getMailAccountMailDispositions(),r.success({title:"MailDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETmailAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMailAccountMailDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.mail").controller("MailAccountMailDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILDISPOSITION",g.mailDisposition=angular.copy(l),g.mailDispositions=r,g.newMailDisposition=!1,g.mailDisposition||(g.mailDisposition={},g.title="MAIL.NEW_MAILDISPOSITION",g.newMailDisposition=!0),t.params.id&&(g.mailDisposition.MailAccountId=t.params.id),g.addNewMailDisposition=function(){g.errors=[],d.disposition.save(g.mailDisposition).$promise.then(function(e){g.mailDispositions.unshift(e.toJSON()),o.success({title:"MailDisposition properly created",msg:g.mailDisposition.name?g.mailDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailDisposition=function(){g.errors=[],d.disposition.update({id:g.mailDisposition.id},g.mailDisposition).$promise.then(function(e){var t=_.find(g.mailDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailDisposition properly saved!",msg:g.mailDisposition.name?g.mailDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailDisposition will be deleted.").ariaLabel("Delete MailDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.mailDisposition.id}).$promise.then(function(){_.remove(g.mailDispositions,{id:g.mailDisposition.id}),o.success({title:"MailDisposition properly deleted!",msg:(g.mailDisposition.name||"mailDisposition")+" has been deleted!"}),v(g.mailDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailDispositions","mailDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailDispositionDialogController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.mailAccount=c||n.params.mailAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.accounts",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.accounts",{})}},u.agentadddialog=function(e,t){a.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:u.mailAccounts?u.mailAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailAccounts=function(){n.go("app.mail.mailAccounts")},u.saveMailAccount=function(){r.mailAccount.update({id:u.mailAccount.id},u.mailAccount).$promise.then(function(){l.success({title:"MailAccount updated!",msg:u.mailAccount.name?u.mailAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.mailAccount&&(n=_.find(u.lists,{id:Number(u.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.mailAccount&&(a=_.find(u.lists,{id:Number(u.mailAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailAccount","userProfileSection"],angular.module("app.mail").controller("MailAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedMailAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,email,ListId,active,cservice,Imap.service,Imap.host,Imap.port,Imap.tls,Imap.authentication,Imap.user,Imap.password,Imap.mailbox,Imap.connTimeout,Imap.authTimeout,Smtp.service,Smtp.host,Smtp.port,Smtp.secure,Smtp.authentication,Smtp.user,Smtp.pass,cauthentication,cuser,cpassword,fontFamily,fontSize,template,markAsUnread,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arraycservice=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b["arrayImap.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b["arraySmtp.service"]=_.keyBy([{option:"Custom",value:"null"},{option:"Gmail",value:"'gmail'"},{option:"Hotmail",value:"'hotmail'"},{option:"Yahoo",value:"'yahoo'"},{option:"Outlook365",value:"'outlook365'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,mailAccount:e,crudPermissions:b.crudPermissions})},b.verifysmtpverifysmtp=function(e,t){{if(e&&e.id)return m.mailAccount.verifySmtp({id:e.id}).$promise.then(function(){p.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){p.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});p.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},b.interactionsgoto=function(e,t){n.go("app.mail.mailAccounts.edit",{id:e.id,tab:7})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.accounts",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.accounts",{})}},b.agentadddialog=function(e,t){i.show({controller:"MailAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailAccount:e,mailAccounts:b.mailAccounts?b.mailAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailAccount")+"?").htmlContent("<b>"+(e.name||"mailAccount")+"</b> will be deleted.").ariaLabel("delete mailAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMailAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailAccount=function(e,t){i.show({controller:"CreateOrEditMailAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailAccount:t,mailAccounts:b.mailAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailAccount=S,b.exportSelectedMailAccounts=function(){var e=angular.copy(b.selectedMailAccounts);return b.selectedMailAccounts=[],e},b.deleteSelectedMailAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailAccounts?").htmlContent("<b>"+b.selectedMailAccounts.length+" selected</b> will be deleted.").ariaLabel("delete MailAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailAccounts.forEach(function(e){S(e)}),b.selectedMailAccounts=[]})},b.deselectMailAccounts=function(){b.selectedMailAccounts=[]},b.selectAllMailAccounts=function(){b.selectedMailAccounts=b.mailAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.mailAccount&&(n=_.find(b.lists,{id:Number(b.mailAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.mailAccount&&(a=_.find(b.lists,{id:Number(b.mailAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.mailAccounts=e||{count:0,rows:[]}}function S(e){if(e.service)return p.error({title:"Mail Account not deleted!",msg:"You can't remove service account"});m.mailAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.mailAccounts.rows,{id:e.id}),b.mailAccounts.count-=1,b.mailAccounts.rows.length||b.getMailAccounts(),p.success({title:_.startCase("MailAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILQUEUE",g.mailQueue=angular.copy(l),g.mailQueues=r,g.newMailQueue=!1,g.mailQueue||(g.mailQueue={strategy:"beepall",timeout:10},g.title="MAIL.NEW_MAILQUEUE",g.newMailQueue=!0),g.addNewMailQueue=function(){g.errors=[],d.mailQueue.save(g.mailQueue).$promise.then(function(e){g.mailQueues.unshift(e.toJSON()),o.success({title:"MailQueue properly created",msg:g.mailQueue.name?g.mailQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailQueue=function(){g.errors=[],d.mailQueue.update({id:g.mailQueue.id},g.mailQueue).$promise.then(function(e){var t=_.find(g.mailQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailQueue properly saved!",msg:g.mailQueue.name?g.mailQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailQueue will be deleted.").ariaLabel("Delete MailQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailQueue.delete({id:g.mailQueue.id}).$promise.then(function(){_.remove(g.mailQueues,{id:g.mailQueue.id}),o.success({title:"MailQueue properly deleted!",msg:(g.mailQueue.name||"mailQueue")+" has been deleted!"}),v(g.mailQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailQueues","mailQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailQueue.getAgents({id:c.mailQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserMailQueue?"penalty "+e.UserMailQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.mailQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.removeAgents({id:c.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.addAgents({id:c.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("MAIL.ALL_AGENTS"),labelSelected:r.instant("MAIL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","mailQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.mailQueue.getTeams({id:l.mailQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.mailQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MAIL.ALL_TEAMS"),labelSelected:n.instant("MAIL.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.removeTeams({id:l.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.mailQueue.addTeams({id:l.mailQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","mailQueue","$translate","Auth","crudPermissions"],angular.module("app.mail").controller("MailQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.mailQueue=c||e.params.mailQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:u.mailQueues?u.mailQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoMailQueues=function(){e.go("app.mail.mailQueues")},u.saveMailQueue=function(){r.mailQueue.update({id:u.mailQueue.id},u.mailQueue).$promise.then(function(){l.success({title:"MailQueue updated!",msg:u.mailQueue.name?u.mailQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","mailQueue","userProfileSection"],angular.module("app.mail").controller("MailQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailQueues",b.listOrder="",b.listOrderAsc=null,b.selectedMailQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"mail",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.mail.mailQueues.edit",{id:e.id,mailQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"MailQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:b.mailQueues?b.mailQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailQueue:e,mailQueues:b.mailQueues?b.mailQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailQueue")+"?").htmlContent("<b>"+(e.name||"mailQueue")+"</b> will be deleted.").ariaLabel("delete mailQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:610}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.mail.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.mail.realtime.queues",{})}},b.success=y,b.getMailQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailQueue=function(e,t){i.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:b.mailQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailQueue=S,b.exportSelectedMailQueues=function(){var e=angular.copy(b.selectedMailQueues);return b.selectedMailQueues=[],e},b.deleteSelectedMailQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailQueues?").htmlContent("<b>"+b.selectedMailQueues.length+" selected</b> will be deleted.").ariaLabel("delete MailQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailQueues.forEach(function(e){S(e)}),b.selectedMailQueues=[]})},b.deselectMailQueues=function(){b.selectedMailQueues=[]},b.selectAllMailQueues=function(){b.selectedMailQueues=b.mailQueues.rows};var E=!0,A=1;function y(e){b.mailQueues=e||{count:0,rows:[]}}function S(e){m.mailQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.mailQueues.rows,{id:e.id}),b.mailQueues.count-=1,b.mailQueues.rows.length||b.getMailQueues(),p.success({title:_.startCase("MailQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MAIL.EDIT_MAILSUBSTATUS",g.mailSubstatus=angular.copy(l),g.mailSubtatuses=r,g.newMailSubstatus=!1,g.mailSubstatus||(g.mailSubstatus={},g.title="MAIL.NEW_MAILSUBSTATUS",g.newMailSubstatus=!0),g.addNewMailSubstatus=function(){g.errors=[],d.mailSubstatus.save(g.mailSubstatus).$promise.then(function(e){g.mailSubtatuses.unshift(e.toJSON()),o.success({title:"MailSubstatus properly created",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMailSubstatus=function(){g.errors=[],d.mailSubstatus.update({id:g.mailSubstatus.id},g.mailSubstatus).$promise.then(function(e){var t=_.find(g.mailSubtatuses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MailSubstatus properly saved!",msg:g.mailSubstatus.name?g.mailSubstatus.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMailSubstatus=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mailSubstatus will be deleted.").ariaLabel("Delete MailSubstatus").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailSubstatus.delete({id:g.mailSubstatus.id}).$promise.then(function(){_.remove(g.mailSubtatuses,{id:g.mailSubstatus.id}),o.success({title:"MailSubstatus properly deleted!",msg:(g.mailSubstatus.name||"mailSubstatus")+" has been deleted!"}),v(g.mailSubstatus)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailSubstatus.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailSubstatus.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mailSubtatuses","mailSubstatus","api","Auth","license","setting","crudPermissions"],angular.module("app.mail").controller("CreateOrEditMailSubstatusDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.mailSubtatuses=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="mailSubtatuses",b.listOrder="",b.listOrderAsc=null,b.selectedMailSubstatuses=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{mailSubstatus:e,mailSubtatuses:b.mailSubtatuses.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("mailSubstatus")+"?").htmlContent("<b>"+(e.name||"mailSubstatus")+"</b> will be deleted.").ariaLabel("delete mailSubstatus").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMailSubstatuses=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.mailSubstatus.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MailSubstatuses",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMailSubstatus=function(e,t){i.show({controller:"CreateOrEditMailSubstatusDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailSubtatuses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailSubstatus:t,mailSubtatuses:b.mailSubtatuses.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMailSubstatus=S,b.exportSelectedMailSubstatuses=function(){var e=angular.copy(b.selectedMailSubstatuses);return b.selectedMailSubstatuses=[],e},b.deleteSelectedMailSubstatuses=function(e){var t=i.confirm().title("Are you sure want to delete the selected mailSubtatuses?").htmlContent("<b>"+b.selectedMailSubstatuses.length+" selected</b> will be deleted.").ariaLabel("delete MailSubstatuss").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMailSubstatuses.forEach(function(e){S(e)}),b.selectedMailSubstatuses=[]})},b.deselectMailSubstatuses=function(){b.selectedMailSubstatuses=[]},b.selectAllMailSubstatuses=function(){b.selectedMailSubstatuses=b.mailSubtatuses.rows};var E=!0,A=1;function y(e){b.mailSubtatuses=e||{count:0,rows:[]}}function S(e){m.mailSubstatus.delete({id:e.id}).$promise.then(function(){_.remove(b.mailSubtatuses.rows,{id:e.id}),b.mailSubtatuses.count-=1,b.mailSubtatuses.rows.length||b.getMailSubstatuses(),p.success({title:_.startCase("MailSubstatus")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEmailSubstatus"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEmailSubstatus",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMailSubstatuses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","mailSubtatuses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.mail").controller("MailSubstatusesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u){var p=this;function g(){_.forIn(p.mailAccounts,function(e,t){p.rpcMailAccounts[t]&&_.merge(e,p.rpcMailAccounts[t])}),_.forIn(p.mailAccounts,function(t,e){var n={id:e,sort:"-id",direction:"in",limit:1,offset:0,$gte:"createdAt,"+moment().startOf("day").format("YYYY-MM-DD HH:mm:ss")};s.mailAccount.getMessages(n).$promise.then(function(e){return e&&(t.in=e.count||0,t.lastIn=e.rows&&e.rows.length?e.rows[0].createdAt:void 0),n.direction="out",s.mailAccount.getMessages(n).$promise}).then(function(e){e&&(t.out=e.count||0,t.lastOut=e.rows&&e.rows.length?e.rows[0].createdAt:void 0)}).catch(function(e){console.log(e)})})}p.currentUser=u.getCurrentUser(),p.count=l&&l.count?l.count:0,p.mailAccounts=l?_.keyBy(l.rows?l.rows:[],"id"):{},p.rpcMailAccounts=d?_.keyBy(d.rows?d.rows:[],"id"):{},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.query={sort:"-name",limit:10,page:1},p.success=f,p.$onInit=g,p.getMailAccounts=function(){p.query.offset=(p.query.page-1)*p.query.limit,u.hasRole("admin")?p.promise=s.mailAccount.get(p.query,f).$promise:(p.query.id=p.userProfile.id,p.query.section="MailAccounts",p.promise=s.userProfile.getResources(p.query,f).$promise)},p.onSave=function(e){p.mailAccounts[e.id]&&_.merge(p.mailAccounts[e.id],e)},p.onMailMessageSave=function(e){p.mailAccounts[e.MailAccountId]&&("in"==e.direction?(p.mailAccounts[e.MailAccountId].in+=1,p.mailAccounts[e.MailAccountId].lastIn=e.createdAt):(p.mailAccounts[e.MailAccountId].out+=1,p.mailAccounts[e.MailAccountId].lastOut=e.createdAt))},p.goToMailAccount=function(e,t){i.go("app.mail.mailAccounts.edit",{id:t.id,mailAccount:t})},p.verifySmtp=function(e,t){{if(t&&t.id)return s.mailAccount.verifySmtp({id:t.id}).$promise.then(function(){r.success({title:"Smtp properly verified",msg:"Connection succeded!"})}).catch(function(e){r.error({title:"Smtp properly verified",msg:e.data?JSON.stringify(e.data):e.toString()})});r.error({title:"Smtp properly verified",msg:"Smpt id unknown"})}},p.order=[],_.forIn(p.mailAccounts,function(e,t){p.order.push(e.id)}),o.on("mailAccount:save",p.onSave),o.on("mailAccount:update",p.onSave),o.on("mailMessage:save",p.onMailMessageSave);var v=!0,h=1;function f(e){if(p.mailAccounts=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){p.order=[];for(var t=0;t<e.rows.length;t++)p.order.push(e.rows[t].id)}g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=p.query.page),e!==t&&(p.query.page=1),e||(p.query.page=h),p.getMailAccounts())}),e.$on("$destroy",function(){o.removeAllListeners("mailAccount:save"),o.removeAllListeners("mailAccount:update"),o.removeAllListeners("mailMessage:save")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$state","api","socket","toasty","mailAccounts","rpcMailAccounts","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("MailAccountsRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"mail",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMailRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.mailQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].MailQueueId].paused++,g.queues[e[t].rows[n].MailQueueId].loggedInDb++,g.queues[e[t].rows[n].MailQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].MailQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"mail",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.mailQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="MailQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditMailQueue=function(e,t){a.show({controller:"CreateOrEditMailQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"MailQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{mailQueue:t,mailQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.mailQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.MailQueueId]&&g.queues[e.MailQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.MailQueueId]&&g.queues[e.MailQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.MailQueueId]&&(g.queues[e.MailQueueId].loggedInDb+=1,g.queues[e.MailQueueId].agents[e.UserId]=e.MailQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.MailQueueId]&&0<g.queues[e.MailQueueId].loggedInDb&&(g.queues[e.MailQueueId].loggedInDb-=1,delete g.queues[e.MailQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("mail_queue:save",g.onSave),d.on("userMailQueue:save",g.onSaveMember),d.on("userMailQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("mail_queue:save"),d.removeAllListeners("userMailQueue:remove"),d.removeAllListeners("userMailQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.mail").controller("QueuesMailRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.mail.realtime.agents":this.selectedTab=0;break;case"app.mail.realtime.queues":this.selectedTab=1;break;case"app.mail.realtime.accounts":this.selectedTab=2;break;default:this.selectedTab=0,n.go("app.mail.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.mail.realtime.agents");break;case 1:n.go("app.mail.realtime.queues");break;case 2:n.go("app.mail.realtime.accounts");break;default:n.go("app.mail.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.mail").controller("MailRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MARKETPLACE.EDIT_PLUGIN",g.plugin=angular.copy(l),g.plugins=r,g.newPlugin=!1,g.plugin||(g.plugin={},g.title="MARKETPLACE.NEW_PLUGIN",g.newPlugin=!0),g.addNewPlugin=function(){g.errors=[],d.plugin.save(g.plugin).$promise.then(function(e){g.plugins.unshift(e.toJSON()),o.success({title:"Plugin properly created",msg:g.plugin.name?g.plugin.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePlugin=function(){g.errors=[],d.plugin.update({id:g.plugin.id},g.plugin).$promise.then(function(e){var t=_.find(g.plugins,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Plugin properly saved!",msg:g.plugin.name?g.plugin.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePlugin=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The plugin will be deleted.").ariaLabel("Delete Plugin").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.plugin.delete({id:g.plugin.id}).$promise.then(function(){_.remove(g.plugins,{id:g.plugin.id}),o.success({title:"Plugin properly deleted!",msg:(g.plugin.name||"plugin")+" has been deleted!"}),v(g.plugin)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","plugins","plugin","api","Auth","license","setting","crudPermissions"],angular.module("app.marketplace").controller("CreateOrEditPluginDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.plugin=c||e.params.plugin||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoPlugins=function(){e.go("app.marketplace.plugins")},u.savePlugin=function(){r.plugin.update({id:u.plugin.id},u.plugin).$promise.then(function(){l.success({title:"Plugin updated!",msg:u.plugin.name?u.plugin.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETplugin",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","plugin","userProfileSection"],angular.module("app.marketplace").controller("MarketplacePluginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.plugins=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="plugins",b.listOrder="",b.listOrderAsc=null,b.selectedPlugins=[],b.query={fields:"createdAt,updatedAt,id,name,type,active,description,icon,sidebar,path,adminUrl,agentUrl,scriptName,scriptPath,version",sort:"name",limit:10,page:1},b.installing=!1,b.arraysidebar=_.keyBy([{option:"Always",value:"'always'"},{option:"Admin Only",value:"'adminOnly'"},{option:"Agent Only",value:"'agentOnly'"},{option:"Never",value:"'never'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.installplugin=function(e){{if("script"!==e.type)return e.active=!0,m.plugin.update({id:e.id},e).$promise.then(function(){p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});b.installing=!0,m.pm2.save({name:e.scriptName,script:e.path+"/"+e.scriptPath}).$promise.then(function(){return e.active=!0,m.plugin.update({id:e.id},e).$promise}).then(function(){b.installing=!1,p.success({title:"Plugin installed!",msg:e.name?e.name+" has been installed!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.save"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.save",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}},b.editstate=function(e,t){n.go("app.marketplace.plugins.edit",{id:e.id,plugin:e,crudPermissions:b.crudPermissions})},b.stopplugin=function(e,t){var n=i.confirm().title("Are you sure want to stop the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be stoppped.").ariaLabel("stop plugin process").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){var n;n=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.update({id:t.pm_id,status:"stopped"}).$promise.then(function(){p.success({title:"Process stopped!",msg:"Attached pm2 process successfully stopped"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},b.restartplugin=function(e,t){var n=i.confirm().title("Are you sure want to restart the plugin attached process?").htmlContent("<b>"+(e.name||"plugin")+"</b> attached process will be restarted.").ariaLabel("restart plugin process").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){var n;n=e,m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.update({id:t.pm_id,status:"online"}).$promise.then(function(){p.success({title:"Process restarted!",msg:"Attached pm2 process successfully restarted"})})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.pm2.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){console.log("CANCEL")})},b.downloadfile2=function(s,e){return m.plugin.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.name.replace(" ","_").toLowerCase()+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.uninstallplugin=function(e,t){var n=i.confirm().title("Are you sure want to uninstall the plugin?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be uninstalled.").ariaLabel("uninstall plugin").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){!function(n){"script"===n.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)throw new Error("Failed to retrieve pm2 processes");var t=_.find(e.rows,{name:n.scriptName});if(!t)throw new Error("No corresponding process found");m.pm2.delete({id:t.pm_id,name:n.scriptName}).$promise}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pm2.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})});n.active=!1,m.plugin.update({id:n.id},n).$promise.then(function(){p.success({title:"Plugin uninstalled!",msg:n.name?n.name+" has been uninstalled!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"api.plugin.update"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.plugin.update",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}(e)},function(){console.log("CANCEL")})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("plugin")+"?").htmlContent("<b>"+(e.name||"plugin")+"</b> will be deleted.").ariaLabel("delete plugin").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getPlugins=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.plugin.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Plugins",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditPlugin=function(e,t){i.show({controller:"CreateOrEditPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugin:t,plugins:b.plugins.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletePlugin=S,b.exportSelectedPlugins=function(){var e=angular.copy(b.selectedPlugins);return b.selectedPlugins=[],e},b.deleteSelectedPlugins=function(e){var t=i.confirm().title("Are you sure want to delete the selected plugins?").htmlContent("<b>"+b.selectedPlugins.length+" selected</b> will be deleted.").ariaLabel("delete Plugins").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedPlugins.forEach(function(e){S(e)}),b.selectedPlugins=[]})},b.deselectPlugins=function(){b.selectedPlugins=[]},b.selectAllPlugins=function(){b.selectedPlugins=b.plugins.rows},b.uploadPlugin=function(e){i.show({controller:"UploadPluginDialogController",controllerAs:"vm",templateUrl:"app/main/apps/marketplace/views/plugins/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{plugins:b.plugins.rows}})};var E=!0,A=1;function y(e){b.plugins=e||{count:0,rows:[]}}function S(n){n.active&&"script"==n.type&&m.pm2.get().$promise.then(function(e){if(!e||!e.rows)return p.error({title:"Plugin not deleted!",msg:"Failed to retrieve pm2 processes"});var t=_.find(e.rows,{name:n.scriptName});t?m.pm2.delete({id:t.pm_id,name:n.scriptName}).$promise:console.log("No '%s' process found",n.scriptName)}).catch(function(e){return p.error({title:"PM2 process not found!",msg:"Failed to delete the attached pm2 process"})}),m.plugin.delete({id:n.id}).$promise.then(function(){_.remove(b.plugins.rows,{id:n.id}),b.plugins.count-=1,b.plugins.rows.length||b.getPlugins(),p.success({title:_.startCase("Plugin")+" deleted!",msg:n.name?n.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEplugin"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEplugin",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getPlugins())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","plugins","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.marketplace").controller("MarketplacePluginsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this,r=2,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="MARKETPLACE.UPLOAD_PLUGIN",o.plugins=a,o.uploadPlugins=[],o.uploadState="none",o.plugin={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/plugins"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["zip"];if(!_.includes(t,e.getExtension()))return n.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>l)return n.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.plugin={id:e.uniqueIdentifier,file:e},o.uploadPlugins.unshift(o.plugin),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.plugins.unshift(JSON.parse(e)),angular.forEach(o.uploadPlugins,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result}}})},o.uploadError=function(e,t){o.ngFlow.flow.cancel(),n.error({title:"Upload error",msg:"Cannot upload the plugin"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",n.success({title:"Upload completed",msg:o.plugin.file.name+" uploaded successfully"}))},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","plugins","api","Auth"],angular.module("app.marketplace").controller("UploadPluginDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_IVRCAMPAIGN",g.ivrCampaign=angular.copy(l),g.ivrCampaigns=r,g.newIvrCampaign=!1,g.ivrCampaign||(g.ivrCampaign={active:!0,type:"ivr",dialCheckDuplicateType:"always",dialCutDigit:0,limitCalls:30,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150,dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3},g.title="MOTIONDIALER.NEW_IVRCAMPAIGN",g.newIvrCampaign=!0),g.addNewIvrCampaign=function(){g.errors=[],d.campaign.save(g.ivrCampaign).$promise.then(function(e){g.ivrCampaigns.unshift(e.toJSON()),o.success({title:"IvrCampaign properly created",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveIvrCampaign=function(){g.errors=[],d.campaign.update({id:g.ivrCampaign.id},g.ivrCampaign).$promise.then(function(e){var t=_.find(g.ivrCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"IvrCampaign properly saved!",msg:g.ivrCampaign.name?g.ivrCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteIvrCampaign=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The ivrCampaign will be deleted.").ariaLabel("Delete IvrCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.campaign.delete({id:g.ivrCampaign.id}).$promise.then(function(){_.remove(g.ivrCampaigns,{id:g.ivrCampaign.id}),o.success({title:"IvrCampaign properly deleted!",msg:(g.ivrCampaign.name||"ivrCampaign")+" has been deleted!"}),v(g.ivrCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})});g.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),g.trunks=t})}else g.trunks=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.projects=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.projects,{id:e.resourceId})}),n=null;if(g.ivrCampaign&&(n=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.projects,{id:n.id});a.canSelect=!1,t.push(a)}g.projects=t})}else{var n=[],a=null;g.ivrCampaign&&(a=_.find(g.projects,{id:Number(g.ivrCampaign.SquareProjectId)}));for(var i=0;i<g.projects.length;i++)a&&g.projects[i].id===a.id&&(g.projects[i].canSelect=!1,n.push(g.projects[i]));g.projects=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.ivrCampaign&&(n=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.ivrCampaign&&(a=_.find(g.interval,{id:Number(g.ivrCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","ivrCampaigns","ivrCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditIvrCampaignDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignblacklistaddController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newIvrCampaign=!0,r.ivrCampaign=angular.copy(i),r.ivrCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_IVRCAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneIvrCampaign=function(){return e.campaign.clone({id:i.id},r.ivrCampaign).$promise.then(function(e){r.ivrCampaigns.unshift(e.toJSON()),a.success({title:"IvrCampaign properly cloned",msg:r.ivrCampaign.name?r.ivrCampaign.name+" has been cloned!":""}),n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.campaign.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.campaign.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","ivrCampaign","ivrCampaigns","$translate"],angular.module("app.motiondialer").controller("IvrCampaigncloneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperBlacks={count:0,rows:[]},c.selectedIvrCampaignHopperBlacks=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperBlacks(c.query,p).$promise},c.createOrEditIvrCampaignHopperBlack=function(e,t){s.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperBlack:t,hopperBlacks:c.ivrCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperBlacks=function(){var e=angular.copy(c.selectedIvrCampaignHopperBlacks);return c.selectedIvrCampaignHopperBlacks=[],e},c.deleteIvrCampaignHopperBlack=g,c.deleteSelectedIvrCampaignHopperBlacks=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedIvrCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperBlacks.rows,{id:e.id}),c.ivrCampaignHopperBlacks.count-=1,c.ivrCampaignHopperBlacks.rows.length||c.getIvrCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.ivrCampaign={},c.ivrCampaignHopperFinals={count:0,rows:[]},c.selectedIvrCampaignHopperFinals=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperFinals(c.query,p).$promise},c.createOrEditIvrCampaignHopperFinal=function(e,t){s.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperFinal:t,hopperFinals:c.ivrCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperFinals=function(){var e=angular.copy(c.selectedIvrCampaignHopperFinals);return c.selectedIvrCampaignHopperFinals=[],e},c.deleteIvrCampaignHopperFinal=g,c.deleteSelectedIvrCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedIvrCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperFinals=[]})},c.moveIvrCampaignHopperFinal=v,c.moveContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsIvrCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsIvrCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsIvrCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=s.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedIvrCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedIvrCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperFinals.rows,{id:e.id}),c.ivrCampaignHopperFinals.count-=1,c.ivrCampaignHopperFinals.rows.length||c.getIvrCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHopperHistories={count:0,rows:[]},c.selectedIvrCampaignHopperHistories=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHopperHistories(c.query,p).$promise},c.createOrEditIvrCampaignHopperHistory=function(e,t){s.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopperHistory:t,hopperHistories:c.ivrCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHopperHistories=function(){var e=angular.copy(c.selectedIvrCampaignHopperHistories);return c.selectedIvrCampaignHopperHistories=[],e},c.deleteIvrCampaignHopperHistory=g,c.deleteSelectedIvrCampaignHopperHistories=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedIvrCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedIvrCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.ivrCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHopperHistories.rows,{id:e.id}),c.ivrCampaignHopperHistories.count-=1,c.ivrCampaignHopperHistories.rows.length||c.getIvrCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.ivrCampaign={},c.ivrCampaignHoppers={count:0,rows:[]},c.selectedIvrCampaignHoppers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.ivrCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.ivrCampaign.id,c.query.CampaignId=c.ivrCampaign.id,c.getIvrCampaignHoppers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIvrCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.campaign.getHoppers(c.query,p).$promise},c.createOrEditIvrCampaignHopper=function(e,t){s.show({controller:"CreateOrEditHopperCampaignIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:c.ivrCampaign,hopper:t,hoppers:c.ivrCampaignHoppers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIvrCampaignHoppers=function(){var e=angular.copy(c.selectedIvrCampaignHoppers);return c.selectedIvrCampaignHoppers=[],e},c.deleteIvrCampaignHopper=g,c.deleteSelectedIvrCampaignHoppers=function(e){var t=s.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedIvrCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIvrCampaignHoppers.forEach(function(e){g(e)}),c.selectedIvrCampaignHoppers=[]})},d.hasRole("admin")?l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.agents,{id:e.resourceId})});c.agents.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),c.agents=t})}else c.agents=[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.ivrCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.ivrCampaignHoppers.rows,{id:e.id}),c.ivrCampaignHoppers.count-=1,c.ivrCampaignHoppers.rows.length||c.getIvrCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETcampaign"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIvrCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("IvrCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),t.params.id&&(g.hopper.CampaignId=t.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var n,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.campaign.get({raw:!1,id:a.CampaignId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(g.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})});g.agents.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),g.agents=t})}else g.agents=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperCampaignIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.ivrCampaign={},i.init=function(t){i.ivrCampaign=t,n.cmHopper.get({limit:0,CampaignId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,CampaignId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,CampaignId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("IvrCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.ivrCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.ivrCampaign=t,d.crudPermissions=l,d.apiRoute="campaign",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.ivrCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","ivrCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("IvrCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;o.enqueue(function(){return i.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return i.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(s.id,l.selected[n]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","ivrCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("IvrCampaignresetlistController",e)}(),function(){"use strict";function e(n,e,i,s,a,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.ivrCampaign=c||n.params.ivrCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:u.ivrCampaigns?u.ivrCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.resetlistdialog=function(t,n){r.campaign.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=u.ivrCampaign.id,t=a.rows[0],n=t.id,r.campaign.removeLists({id:e,ids:n}).$promise.then(function(){return r.campaign.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:ivrCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"IvrCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!1,locals:{ivrCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.ivr_campaigns",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.ivr_campaigns",{})}},u.alert=l.info,u.gotoIvrCampaigns=function(){n.go("app.motiondialer.ivrCampaigns")},u.saveIvrCampaign=function(){r.campaign.update({id:u.ivrCampaign.id},u.ivrCampaign).$promise.then(function(){l.success({title:"IvrCampaign updated!",msg:u.ivrCampaign.name?u.ivrCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcampaign",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})});u.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.trunks=t})}else u.trunks=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),n=null;if(u.ivrCampaign&&(n=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.projects,{id:n.id});a.canSelect=!1,t.push(a)}u.projects=t})}else{var n=[],a=null;u.ivrCampaign&&(a=_.find(u.projects,{id:Number(u.ivrCampaign.SquareProjectId)}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,n.push(u.projects[i]));u.projects=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.ivrCampaign&&(n=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.ivrCampaign&&(a=_.find(u.interval,{id:Number(u.ivrCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","ivrCampaign","userProfileSection"],angular.module("app.motiondialer").controller("IvrCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.ivrCampaigns=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="ivrCampaigns",b.listOrder="",b.listOrderAsc=null,b.selectedIvrCampaigns=[],b.query={fields:"createdAt,updatedAt,id,name,active,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,SquareProjectId,limitCalls,description,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,dialOrderByScheduledAt,dialGlobalInterval,dialTimezone,dialPrefix,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength",type:"ivr",sort:"-updatedAt",limit:10,page:1},b.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.motiondialer.ivrCampaigns.edit",{id:e.id,ivrCampaign:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"IvrCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.listadddialog=function(e,t){i.show({controller:"IvrCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.blacklistadddialog=function(e,t){i.show({controller:"IvrCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{ivrCampaign:e,ivrCampaigns:b.ivrCampaigns?b.ivrCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("ivrCampaign")+"?").htmlContent("<b>"+(e.name||"ivrCampaign")+"</b> will be deleted.").ariaLabel("delete ivrCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.ivr_campaigns",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.ivr_campaigns",{})}},b.success=y,b.getIvrCampaigns=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.campaign.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="IvrCampaigns",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditIvrCampaign=function(e,t){i.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:b.ivrCampaigns.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteIvrCampaign=S,b.exportSelectedIvrCampaigns=function(){var e=angular.copy(b.selectedIvrCampaigns);return b.selectedIvrCampaigns=[],e},b.deleteSelectedIvrCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected ivrCampaigns?").htmlContent("<b>"+b.selectedIvrCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete IvrCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedIvrCampaigns.forEach(function(e){S(e)}),b.selectedIvrCampaigns=[]})},b.deselectIvrCampaigns=function(){b.selectedIvrCampaigns=[]},b.selectAllIvrCampaigns=function(){b.selectedIvrCampaigns=b.ivrCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name",table:"true"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})});b.trunks.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),b.trunks=t})}else b.trunks=[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.projects=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.projects=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.projects,{id:e.resourceId})}),a=null;a=[],b.ivrCampaigns.rows.forEach(function(e){var t=_.find(b.projects,{id:Number(e.SquareProjectId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.projects,{id:e.id});t.canSelect=!1,n.push(t)}}),b.projects=n})}else{var n=[],a=[];b.ivrCampaigns.rows.forEach(function(e){var t=_.find(b.projects,{id:Number(e.SquareProjectId)});a.push(t)});for(var i=0;i<b.projects.length;i++){_.some(a,{id:b.projects[i].id})&&(b.projects[i].canSelect=!1,n.push(b.projects[i]))}b.projects=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.ivrCampaign&&(n=_.find(b.interval,{id:Number(b.ivrCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.ivrCampaign&&(a=_.find(b.interval,{id:Number(b.ivrCampaign.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.ivrCampaigns=e||{count:0,rows:[]}}function S(e){m.campaign.delete({id:e.id}).$promise.then(function(){_.remove(b.ivrCampaigns.rows,{id:e.id}),b.ivrCampaigns.count-=1,b.ivrCampaigns.rows.length||b.getIvrCampaigns(),p.success({title:_.startCase("IvrCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcampaign"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcampaign",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getIvrCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","ivrCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("IvrCampaignsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_QUEUECAMPAIGN",g.queueCampaign=angular.copy(l),g.queueCampaigns=r,g.newQueueCampaign=!1,g.queueCampaign||(g.queueCampaign={dialActive:!0,type:"outbound",dialCheckDuplicateType:"always",dialCutDigit:0,autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no",dialOrderByScheduledAt:"ASC",dialGlobalInterval:"07:00-22:00,*,*,*",dialAMDInitialSilence:2500,dialAMDGreeting:1500,dialAMDAfterGreetingSilence:800,dialAMDTotalAnalysisTime:5e3,dialAMDMinWordLength:100,dialAMDBetweenWordsSilence:50,dialAMDMaximumNumberOfWords:3,dialAMDSilenceThreshold:256,dialAMDMaximumWordLength:5e3,dialMethod:"progressive",dialPowerLevel:1,dialPredictiveOptimization:"dropRate",dialPredictiveOptimizationPercentage:3,dialPredictiveInterval:10,dialLimitQueue:0,dialRandomLastDigitCallerIdNumber:0,dialOriginateTimeout:30,dialQueueOptions:"tTxX",dialQueueTimeout:3,strategy:"rrmemory",timeout:3,retry:3,weight:1,dialGlobalMaxRetry:4,dialCongestionMaxRetry:3,dialCongestionRetryFrequency:150,dialBusyMaxRetry:3,dialBusyRetryFrequency:150,dialNoAnswerMaxRetry:3,dialNoAnswerRetryFrequency:150},g.title="MOTIONDIALER.NEW_QUEUECAMPAIGN",g.newQueueCampaign=!0),g.addNewQueueCampaign=function(){g.errors=[],d.voiceQueue.save(g.queueCampaign).$promise.then(function(e){g.queueCampaigns.unshift(e.toJSON()),o.success({title:"QueueCampaign properly created",msg:g.queueCampaign.name?g.queueCampaign.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveQueueCampaign=function(){g.errors=[],d.voiceQueue.update({id:g.queueCampaign.id},g.queueCampaign).$promise.then(function(e){var t=_.find(g.queueCampaigns,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"QueueCampaign properly saved!",msg:g.queueCampaign.name?g.queueCampaign.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteQueueCampaign=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The queueCampaign will be deleted.").ariaLabel("Delete QueueCampaign").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceQueue.delete({id:g.queueCampaign.id}).$promise.then(function(){_.remove(g.queueCampaigns,{id:g.queueCampaign.id}),o.success({title:"QueueCampaign properly deleted!",msg:(g.queueCampaign.name||"queueCampaign")+" has been deleted!"}),v(g.queueCampaign)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.trunks=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.trunks,{id:e.resourceId})}),n=null;if(g.queueCampaign&&(n=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.trunks,{id:n.id});a.canSelect=!1,t.push(a)}g.trunks=t})}else{var n=[],a=null;g.queueCampaign&&(a=_.find(g.trunks,{id:Number(g.queueCampaign.TrunkId)}));for(var i=0;i<g.trunks.length;i++)a&&g.trunks[i].id===a.id&&(g.trunks[i].canSelect=!1,n.push(g.trunks[i]));g.trunks=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){g.interval=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.interval,{id:e.resourceId})}),n=null;if(g.queueCampaign&&(n=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.interval,{id:n.id});a.canSelect=!1,t.push(a)}g.interval=t})}else{var n=[],a=null;g.queueCampaign&&(a=_.find(g.interval,{id:Number(g.queueCampaign.IntervalId)}));for(var i=0;i<g.interval.length;i++)a&&g.interval[i].id===a.id&&(g.interval[i].canSelect=!1,n.push(g.interval[i]));g.interval=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","queueCampaigns","queueCampaign","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditQueueCampaignDialogController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getAgents({id:c.queueCampaign.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.queueCampaign=t,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeAgents({id:c.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addAgents({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!i,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("MOTIONDIALER.ALL_AGENTS"),labelSelected:s.instant("MOTIONDIALER.SELECTED_AGENTS"),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","queueCampaigns","realtime","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getBlackLists",d.addApi="addBlackLists",d.removeApi="removeBlackLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignblacklistaddController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newQueueCampaign=!0,r.queueCampaign=angular.copy(i),r.queueCampaigns=s,r.title=o.instant("MOTIONDIALER.CLONE_QUEUECAMPAIGN"),i&&i.name&&(r.title+=": "+i.name),r.cloneQueueCampaign=function(){return e.voiceQueue.clone({id:i.id},r.queueCampaign).$promise.then(function(e){r.queueCampaigns.unshift(e.toJSON()),a.success({title:"QueueCampaign properly cloned",msg:r.queueCampaign.name?r.queueCampaign.name+" has been cloned!":""}),n.go("app.motiondialer.queueCampaigns.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","queueCampaign","queueCampaigns","$translate"],angular.module("app.motiondialer").controller("QueueCampaigncloneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperBlacks={count:0,rows:[]},c.selectedQueueCampaignHopperBlacks=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,ContactId,phone",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperBlacks()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperBlack?").htmlContent("<b>"+(e.name||"hopperBlack")+"</b> will be deleted.").ariaLabel("delete hopperBlack").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperBlacks=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperBlacks(c.query,p).$promise},c.createOrEditQueueCampaignHopperBlack=function(e,t){s.show({controller:"CreateOrEditHopperBlackDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperBlacks/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperBlack:t,hopperBlacks:c.queueCampaignHopperBlacks.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperBlacks=function(){var e=angular.copy(c.selectedQueueCampaignHopperBlacks);return c.selectedQueueCampaignHopperBlacks=[],e},c.deleteQueueCampaignHopperBlack=g,c.deleteSelectedQueueCampaignHopperBlacks=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperBlacks?").htmlContent("<b>"+c.selectedQueueCampaignHopperBlacks.length+" selected</b> will be deleted.").ariaLabel("delete hopperBlacks").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperBlacks.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperBlacks=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperBlacks=e||{count:0,rows:[]}}function g(e){l.hopperBlack.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperBlacks.rows,{id:e.id}),c.queueCampaignHopperBlacks.count-=1,c.queueCampaignHopperBlacks.rows.length||c.getQueueCampaignHopperBlacks(),r.success({title:"HopperBlack deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperBlacks())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperBlacksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.contacts={},c.queueCampaign={},c.queueCampaignHopperFinals={count:0,rows:[]},c.selectedQueueCampaignHopperFinals=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,countcongestionretry,countbusyretry,countnoanswerretry,countglobal,scheduledat,starttime,responsetime,endtime,disposition,ListId,UserId,VoiceQueueId,CampaignId,recallme,deleted,campaign",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperFinals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperFinal?").htmlContent("<b>"+(e.name||"hopperFinal")+"</b> will be deleted.").ariaLabel("delete hopperFinal").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperFinals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperFinals(c.query,p).$promise},c.createOrEditQueueCampaignHopperFinal=function(e,t){s.show({controller:"CreateOrEditHopperFinalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperFinals/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperFinal:t,hopperFinals:c.queueCampaignHopperFinals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperFinals=function(){var e=angular.copy(c.selectedQueueCampaignHopperFinals);return c.selectedQueueCampaignHopperFinals=[],e},c.deleteQueueCampaignHopperFinal=g,c.deleteSelectedQueueCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperFinals?").htmlContent("<b>"+c.selectedQueueCampaignHopperFinals.length+" selected</b> will be deleted.").ariaLabel("delete hopperFinals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperFinals=[]})},c.moveQueueCampaignHopperFinal=v,c.moveContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.moveContactsQueueCampaignHopperFinal({id:c.query.id,state:e}).$promise.then(function(e){_.isNil(e)&&_.isNil(e[0])?r.info({title:"Restored Contacts",msg:"0"}):r.info({title:"Restored Contacts",msg:JSON.stringify(e[0].affectedRows)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.countContactsQueueCampaignHopperFinal=function(e){l.cmHopperFinal.countContactsQueueCampaignHopperFinal({id:e}).$promise.then(function(e){_.merge(c.contacts,e[0])}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},c.moveConfirm=function(e,t){var n=s.confirm().title("Are you sure want to restore the contact?").htmlContent("<b>Contact</b> will be restored.").ariaLabel("Restore Contact").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){v(e)},function(){console.log("CANCEL")})},c.moveSelectedQueueCampaignHopperFinals=function(e){var t=s.confirm().title("Are you sure want to restore the selected contacts?").htmlContent("<b> Contacts selected</b> will be restored.").ariaLabel("Restore Contacts").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperFinals.forEach(function(e){v(e)}),c.selectedQueueCampaignHopperFinals=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperFinals=e||{count:0,rows:[]}}function g(e){l.hopperFinal.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperFinals.rows,{id:e.id}),c.queueCampaignHopperFinals.count-=1,c.queueCampaignHopperFinals.rows.length||c.getQueueCampaignHopperFinals(),r.success({title:"HopperFinal deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}function v(a){l.cmHopperFinal.checkContactHopper(a).$promise.then(function(e){r.info({title:"The contact is in the hopper",msg:"Contact ID "+e.ContactId})}).catch(function(e){var t,n;"Not Found"===e.data?l.cmHopper.save((t=a,n={},n.phone=t.calleridnum,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=0,n.countcongestionretry=0,n.countnoanswerretry=0,n.countglobal=0,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=t.deleted?null:t.UserId,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.priority=t.recallme?3:2,n.recallme=!!t.recallme,n)).$promise.then(function(e){var t,n;r.info({title:"Restored Contact",msg:"Contact ID "+e.ContactId}),e.ContactId&&l.cmHopperHistory.save(((n={}).calleridnum=(t=a).calleridnum,n.calleridname=t.calleridname,n.scheduledat=moment().format("YYYY-MM-DD HH:mm:ss"),n.countbusyretry=t.countbusyretry,n.countcongestionretry=t.countcongestionretry,n.countnoanswerretry=t.countnoanswerretry,n.countglobal=t.countglobal,n.ContactId=t.ContactId,n.ListId=t.ListId,n.UserId=d.getCurrentUser().id,n.VoiceQueueId=t.VoiceQueueId,n.CampaignId=t.CampaignId,n.editedat=moment().format("YYYY-MM-DD HH:mm:ss"),n.edited=!0,n.state=25,n.statedesc="Restored",n.campaign=t.campaign,n.campaigntype=t.VoiceQueueId?"queue":"ivr",n))}).catch(function(e){_.isNil(e.data)||"Validation error"!==e.data.message?r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()}):r.info({title:"The contact is in the hopper",msg:"Contact ID "+a.ContactId})}):r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperFinals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperFinalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHopperHistories={count:0,rows:[]},c.selectedQueueCampaignHopperHistories=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,uniqueid,ContactId,calleridnum,calleridname,statedesc,scheduledat,starttime,responsetime,endtime",sort:"-id",limit:10,page:1},c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHopperHistories()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopperHistory?").htmlContent("<b>"+(e.name||"hopperHistory")+"</b> will be deleted.").ariaLabel("delete hopperHistory").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHopperHistories=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHopperHistories(c.query,p).$promise},c.createOrEditQueueCampaignHopperHistory=function(e,t){s.show({controller:"CreateOrEditHopperHistoryDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hopperHistories/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopperHistory:t,hopperHistories:c.queueCampaignHopperHistories.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHopperHistories=function(){var e=angular.copy(c.selectedQueueCampaignHopperHistories);return c.selectedQueueCampaignHopperHistories=[],e},c.deleteQueueCampaignHopperHistory=g,c.deleteSelectedQueueCampaignHopperHistories=function(e){var t=s.confirm().title("Are you sure want to delete the selected hopperHistories?").htmlContent("<b>"+c.selectedQueueCampaignHopperHistories.length+" selected</b> will be deleted.").ariaLabel("delete hopperHistories").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHopperHistories.forEach(function(e){g(e)}),c.selectedQueueCampaignHopperHistories=[]})};var m=!0,u=1;function p(e){c.queueCampaignHopperHistories=e||{count:0,rows:[]}}function g(e){l.hopperHistory.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHopperHistories.rows,{id:e.id}),c.queueCampaignHopperHistories.count-=1,c.queueCampaignHopperHistories.rows.length||c.getQueueCampaignHopperHistories(),r.success({title:"HopperHistory deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHopperHistories())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHopperHistoriesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.queueCampaign={},c.queueCampaignHoppers={count:0,rows:[]},c.selectedQueueCampaignHoppers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,ContactId,phone,countcongestionretry,countbusyretry,countnoanswerretry,scheduledat,priority,recallme,UserId",sort:"-updatedAt",limit:10,page:1},c.arraypriority=_.keyBy([{option:"Highest",value:"'4'"},{option:"High",value:"'3'"},{option:"Medium",value:"'2'"},{option:"Low",value:"'1'"},{option:"Lowest",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.queueCampaign=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.queueCampaign.id,c.query.VoiceQueueId=c.queueCampaign.id,c.getQueueCampaignHoppers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the hopper?").htmlContent("<b>"+(e.name||"hopper")+"</b> will be deleted.").ariaLabel("delete hopper").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getQueueCampaignHoppers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceQueue.getHoppers(c.query,p).$promise},c.createOrEditQueueCampaignHopper=function(e,t){s.show({controller:"CreateOrEditHopperVoiceQueueIdDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:c.queueCampaign,hopper:t,hoppers:c.queueCampaignHoppers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedQueueCampaignHoppers=function(){var e=angular.copy(c.selectedQueueCampaignHoppers);return c.selectedQueueCampaignHoppers=[],e},c.deleteQueueCampaignHopper=g,c.deleteSelectedQueueCampaignHoppers=function(e){var t=s.confirm().title("Are you sure want to delete the selected hoppers?").htmlContent("<b>"+c.selectedQueueCampaignHoppers.length+" selected</b> will be deleted.").ariaLabel("delete hoppers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedQueueCampaignHoppers.forEach(function(e){g(e)}),c.selectedQueueCampaignHoppers=[]})},d.hasRole("admin")?l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){c.agents=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.agents,{id:e.resourceId})}),n=null;if(c.queueCampaign&&(n=_.find(c.agents,{id:Number(c.queueCampaign.UserId)})),n&&!_.some(t,["id",n.id])){var a=_.find(c.agents,{id:n.id});a.canSelect=!1,t.push(a)}c.agents=t})}else{var n=[],a=null;c.queueCampaign&&(a=_.find(c.agents,{id:Number(c.queueCampaign.UserId)}));for(var i=0;i<c.agents.length;i++)a&&c.agents[i].id===a.id&&(c.agents[i].canSelect=!1,n.push(c.agents[i]));c.agents=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.queueCampaignHoppers=e||{count:0,rows:[]}}function g(e){l.cmHopper.delete({id:e.id}).$promise.then(function(){_.remove(c.queueCampaignHoppers.rows,{id:e.id}),c.queueCampaignHoppers.count-=1,c.queueCampaignHoppers.rows.length||c.getQueueCampaignHoppers(),r.success({title:"Hopper deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getQueueCampaignHoppers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.motiondialer").controller("QueueCampaignHoppersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="MOTIONDIALER.EDIT_HOPPER",g.hopper=angular.copy(l),g.hoppers=r,g.newHopper=!1,g.hopper||(g.hopper={},g.title="MOTIONDIALER.NEW_HOPPER",g.newHopper=!0),t.params.id&&(g.hopper.VoiceQueueId=t.params.id),g.addNewHopper=function(){g.errors=[],d.cmHopper.save(g.hopper).$promise.then(function(e){g.hoppers.unshift(e.toJSON()),o.success({title:"Hopper properly created",msg:g.hopper.name?g.hopper.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveHopper=function(){var n,a,i,s;g.errors=[],g.hopper.UserId=g.hopper.recallme?g.hopper.UserId:null,g.hopper.OwnerId=c.getCurrentUser().id,d.cmHopper.get({id:g.hopper.id,attributes:["scheduledat"]}).$promise.then(function(e){n=_.isNil(e)||_.isEmpty(e)?moment().format("YYYY-MM-DD HH:mm:ss"):e.scheduledat}).finally(function(){d.cmHopper.update({id:g.hopper.id},_.omit(g.hopper,["VoiceQueueId","CampaignId","ContactId","ListId"])).$promise.then(function(e){a=e,d.cmContact.get({id:a.ContactId,attributes:["firstName","lastName"]}).$promise.then(function(e){_.isNil(e)||_.isNil(e.firstName)||(i=e.firstName,_.isNil(e.lastName)||(i+=" "+e.lastName))}).catch(function(){i=void 0}).finally(function(){d.voiceQueue.get({raw:!1,id:a.VoiceQueueId,attributes:["name"]}).$promise.then(function(e){s=e.name}).catch(function(e){s=void 0}).finally(function(){d.cmHopperHistory.save({state:24,statedesc:"Edited",scheduledat:n,calleridnum:a.phone,calleridname:i,campaigntype:a.VoiceQueueId?"queue":"ivr",campaign:s,editedat:moment().format("YYYY-MM-DD HH:mm:ss"),edited:!0,ListId:a.ListId,UserId:c.getCurrentUser().id,VoiceQueueId:a.VoiceQueueId,CampaignId:a.CampaignId,ContactId:a.ContactId,callback:a.callback,callbackuniqueid:a.callbackuniqueid,countbusyretry:a.countbusyretry,countcongestionretry:a.countcongestionretry,countglobal:a.countglobal,countnoanswerretry:a.countnoanswerretry,followuptime:a.followuptime,recallme:a.recallme})})});var t=_.find(g.hoppers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Hopper properly saved!",msg:g.hopper.name?g.hopper.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})})},g.deleteHopper=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The hopper will be deleted.").ariaLabel("Delete Hopper").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cmHopper.delete({id:g.hopper.id}).$promise.then(function(){_.remove(g.hoppers,{id:g.hopper.id}),o.success({title:"Hopper properly deleted!",msg:(g.hopper.name||"hopper")+" has been deleted!"}),v(g.hopper)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cmHopper.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cmHopper.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.user.get({fields:"id,name",role:"agent",sort:"name",nolimit:"true"}).$promise.then(function(e){g.agents=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.agents,{id:e.resourceId})}),n=null;if(g.hopper&&(n=_.find(g.agents,{id:Number(g.hopper.UserId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.agents,{id:n.id});a.canSelect=!1,t.push(a)}g.agents=t})}else{var n=[],a=null;g.hopper&&(a=_.find(g.agents,{id:Number(g.hopper.UserId)}));for(var i=0;i<g.agents.length;i++)a&&g.agents[i].id===a.id&&(g.agents[i].canSelect=!1,n.push(g.agents[i]));g.agents=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","hoppers","hopper","api","Auth","license","setting","crudPermissions"],angular.module("app.motiondialer").controller("CreateOrEditHopperVoiceQueueIdDialogController",e)}(),function(){"use strict";function e(n,a){var i=this;i.queueCampaign={},i.init=function(t){i.queueCampaign=t,n.cmHopper.get({limit:0,VoiceQueueId:t.id}).$promise.then(function(e){return i.total=e.count||0,n.cmHopper.get({limit:0,VoiceQueueId:t.id,active:!1,countbusyretry:0,countcongestionretry:0,countnoanswerretry:0}).$promise}).then(function(e){return i.fresh=e.count||0,n.cmHopperFinal.get({limit:0,VoiceQueueId:t.id}).$promise}).then(function(e){i.closed=e.count||0}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETTAGS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["api","toasty"],angular.module("app.motiondialer").controller("QueueCampaignHopperStatisticsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l){var d=this;function c(){return a(function(n,t){return a(function(t,n){return s.cmList.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return d.items=e.rows?e.rows:[],r.hasRole("admin")?e:d.section?d.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:d.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return d.allowedItems=_.map(t,function(e){return _.find(d.items,{id:r.hasRole("admin")||d.section.autoAssociation?e.id:e.resourceId})}),d.startingAllowedItems=angular.copy(d.allowedItems),d.items.forEach(function(e){var t=_.find(d.allowedItems,{id:e.id});"admin"===d.currentUser.role?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s[d.apiRoute][d.getApi]({id:d.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];d.selectedItems=_.map(t,function(e){return _.find(d.items,{id:e.id})}),d.startingSelectedItems=angular.copy(d.selectedItems),d.dualMultiselectOptions.selectedItems=d.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.allowedItems,d.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}d.currentUser=r.getCurrentUser(),d.queueCampaign=t,d.crudPermissions=l,d.apiRoute="voiceQueue",d.getApi="getLists",d.addApi="addLists",d.removeApi="removeLists",d.items=[],d.allowedItems=[],d.selectedItems=[],d.startingAllowedItems=[],d.startingSelectedItems=[],d.pendingChanges=!1,d.loading=!1,d.dualMultiselectOptions={readOnly:!d.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!1,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_LISTS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_LISTS"),transferCallback:function(e,t){var n=_.xorBy(d.startingSelectedItems,d.selectedItems,"id");d.pendingChanges=!_.isEmpty(n)}},d.onInit=function(){return r.hasRole("admin")?c().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:d.currentUser.userProfileId,name:"Lists"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return d.section=e,c()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETLISTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.saveLists=function(){d.loading=!0;var e=_.differenceBy(d.startingSelectedItems,d.selectedItems,"id"),t=_.differenceBy(d.selectedItems,d.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.removeApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s[d.apiRoute][d.addApi]({id:d.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){d.pendingChanges=!1,d.startingAllowedItems=angular.copy(d.allowedItems),d.startingSelectedItems=angular.copy(d.selectedItems),i.success({title:"SUCCESS",msg:"Lists association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})}).finally(function(){d.loading=!1});var n},d.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","$timeout","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignlistaddController",e)}(),function(){"use strict";function e(e,t,a,i,s,n,o,r){var l=this;function d(){t.hide()}function c(e,t){var n=t.id;o.enqueue(function(){return i.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return i.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){a.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}l.selected=[],l.items=n||[],l.loading=!1,l.closeDialog=d,l.exists=function(e,t){return-1<t.indexOf(e)},l.toggle=function(e,t){var n=t.indexOf(e);-1<n?t.splice(n,1):t.push(e)},l.isIndeterminate=function(){return 0!==l.selected.length&&l.selected.length!==l.items.length},l.isChecked=function(){return l.selected.length===l.items.length},l.toggleAll=function(){l.selected.length===l.items.length?l.selected=[]:(0===l.selected.length||0<l.selected.length)&&(l.selected=l.items.slice(0))},l.listSelected=function(){l.loading=!0,r(function(e,t){for(var n=0;n<l.selected.length;n+=1)c(s.id,l.selected[n]);var a;a=e,o.enqueue(function(){return a()})}).finally(function(){l.loading=!1,d()})}}e.$inject=["$scope","$mdDialog","toasty","api","queueCampaign","listsCampaign","Sequence","$q"],angular.module("app.motiondialer").controller("QueueCampaignresetlistController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s){var c=this;function o(){return l(function(n,t){return l(function(t,n){return d.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],i.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:i.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});i.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getTeams({id:c.queueCampaign.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){return _.find(c.items,{id:e.id})}),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=i.getCurrentUser(),c.queueCampaign=t,c.crudPermissions=s,c.penalty=0,c.items=[],c.allowedItems=[],c.selectedItems=[],c.addedItems=[],c.removedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("MOTIONDIALER.ALL_TEAMS"),labelSelected:n.instant("MOTIONDIALER.SELECTED_TEAMS"),transferCallback:function(e,t){t?c.removedItems=_.unionBy(e,c.removedItems,"id"):(e.forEach(function(e){e.penalty="penalty "+c.penalty}),c.addedItems=_.unionBy(e,c.addedItems,"id")),c.pendingChanges=!0}},c.onInit=function(){return i.hasRole("admin")?o().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,o()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveTeams=function(){var e=c.removedItems,t=c.addedItems;return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeTeams({id:c.queueCampaign.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addTeams({id:c.queueCampaign.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.addedItems=[],c.removedItems=[],a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","queueCampaign","$translate","Auth","crudPermissions"],angular.module("app.motiondialer").controller("QueueCampaignteamaddController",e)}(),function(){"use strict";function e(n,e,i,s,a,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.queueCampaign=c||n.params.queueCampaign||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:u.queueCampaigns?u.queueCampaigns.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.resetlistdialog=function(t,n){r.voiceQueue.getLists({id:t.id,fields:"id,name",nolimit:!0}).$promise.then(function(a){if(_.isNil(a.rows)||_.isEmpty(a.rows))l.info({title:"Campaign Without Lists"});else if(1===a.rows.length){var e=i.confirm().title("Are you sure want to reset the list "+a.rows[0].name+" ?").htmlContent("<b>"+a.rows[0].name+"</b> will be reset.").ariaLabel("Reset List").targetEvent(n).ok("OK").cancel("CANCEL");i.show(e).then(function(){var e,t,n;e=u.queueCampaign.id,t=a.rows[0],n=t.id,r.voiceQueue.removeLists({id:e,ids:n}).$promise.then(function(){return r.voiceQueue.addLists({id:e,ids:n,dialCheckDuplicateType:"never"}).$promise}).then(function(){l.success({title:"Reset Succesfull",msg:"List "+t.name+" has been reset"})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:queueCampaign.REMOVELIST",msg:e.status?JSON.stringify(e.data):e.toString()})})})}else i.show({controller:"QueueCampaignresetlistController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!1,locals:{queueCampaign:t,listsCampaign:a?a.rows:[]}})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:RESETLIST",msg:e.status?JSON.stringify(e.data):e.toString()})})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.queues",{}):l.info({title:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:a.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.queues",{})}},u.alert=l.info,u.gotoQueueCampaigns=function(){n.go("app.motiondialer.queueCampaigns")},u.saveQueueCampaign=function(){r.voiceQueue.update({id:u.queueCampaign.id},u.queueCampaign).$promise.then(function(){l.success({title:"QueueCampaign updated!",msg:u.queueCampaign.name?u.queueCampaign.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.musiconholds,{name:u.queueCampaign.musiconhold})),n&&!_.some(t,["id",n.id])){var a=_.find(u.musiconholds,{id:n.id});a.canSelect=!1,t.push(a)}u.musiconholds=t}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.trunks=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.trunks,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.trunks,{id:n.id});a.canSelect=!1,t.push(a)}u.trunks=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.trunks,{id:Number(u.queueCampaign.TrunkId)}));for(var i=0;i<u.trunks.length;i++)a&&u.trunks[i].id===a.id&&(u.trunks[i].canSelect=!1,n.push(u.trunks[i]));u.trunks=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.projects=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.projects,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.projects,{name:u.queueCampaign.dialQueueProject})),n&&!_.some(t,["id",n.id])){var a=_.find(u.projects,{id:n.id});a.canSelect=!1,t.push(a)}u.projects=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.projects,{name:u.queueCampaign.dialQueueProject}));for(var i=0;i<u.projects.length;i++)a&&u.projects[i].id===a.id&&(u.projects[i].canSelect=!1,n.push(u.projects[i]));u.projects=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){u.interval=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.interval,{id:e.resourceId})}),n=null;if(u.queueCampaign&&(n=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.interval,{id:n.id});a.canSelect=!1,t.push(a)}u.interval=t})}else{var n=[],a=null;u.queueCampaign&&(a=_.find(u.interval,{id:Number(u.queueCampaign.IntervalId)}));for(var i=0;i<u.interval.length;i++)a&&u.interval[i].id===a.id&&(u.interval[i].canSelect=!1,n.push(u.interval[i]));u.interval=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","queueCampaign","userProfileSection"],angular.module("app.motiondialer").controller("QueueCampaignController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.queueCampaigns=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="queueCampaigns",b.listOrder="",b.listOrderAsc=null,b.selectedQueueCampaigns=[],b.query={fields:"createdAt,updatedAt,id,name,dialActive,TrunkId,TrunkBackupId,type,IntervalId,dialCheckDuplicateType,dialCutDigit,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,dialOrderByScheduledAt,dialRecallMeTimeout,dialRecallInQueue,dialGlobalInterval,dialTimezone,dialAMDActive,dialAMDInitialSilence,dialAMDGreeting,dialAMDAfterGreetingSilence,dialAMDTotalAnalysisTime,dialAMDMinWordLength,dialAMDBetweenWordsSilence,dialAMDMaximumNumberOfWords,dialAMDSilenceThreshold,dialAMDMaximumWordLength,dialMethod,dialPowerLevel,dialPredictiveOptimization,dialPredictiveOptimizationPercentage,dialPredictiveInterval,dialLimitQueue,dialOriginateCallerIdName,dialOriginateCallerIdNumber,dialRandomLastDigitCallerIdNumber,dialOriginateTimeout,dialPrefix,dialQueueOptions,dialQueueTimeout,strategy,timeout,retry,wrapuptime,weight,musiconhold,dialQueueProject,dialQueueProject2,dialAgiAfterHangupAgent,dialGlobalMaxRetry,dialCongestionMaxRetry,dialCongestionRetryFrequency,dialBusyMaxRetry,dialBusyRetryFrequency,dialNoAnswerMaxRetry,dialNoAnswerRetryFrequency,description,mandatoryDisposition,mandatoryDispositionPauseId",type:"outbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},b.arraydialCheckDuplicateType=_.keyBy([{option:"ALWAYS",value:"'always'"},{option:"NEVER",value:"'never'"},{option:"ONLY_IF_OPEN",value:"'onlyIfOpen'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialOrderByScheduledAt=_.keyBy([{option:"DESC",value:"'DESC'"},{option:"ASC",value:"'ASC'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialMethod=_.keyBy([{option:"Progressive",value:"'progressive'"},{option:"PowerDialing",value:"'power'"},{option:"Predictive",value:"'predictive'"},{option:"Preview",value:"'preview'"},{option:"BookedProgressive",value:"'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydialPredictiveOptimization=_.keyBy([{option:"AgentBusyFactor",value:"'agentBusyFactor'"},{option:"DropRate",value:"'dropRate'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraystrategy=_.keyBy([{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Round Robin",value:"'roundrobin'",ngIf:"vm.queueCampaign.dialMethod === 'booked'"},{option:"Least Recent",value:"'leastrecent'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Fewest Calls",value:"'fewestcalls'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Random",value:"'random'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Linear",value:"'linear'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"},{option:"Weight Random",value:"'wrandom'",ngIf:"vm.queueCampaign.dialMethod !== 'booked'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.motiondialer.queueCampaigns.edit",{id:e.id,queueCampaign:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"QueueCampaigncloneController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.listadddialog=function(e,t){i.show({controller:"QueueCampaignlistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.blacklistadddialog=function(e,t){i.show({controller:"QueueCampaignblacklistaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.teamadddialog=function(e,t){i.show({controller:"QueueCampaignteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{queueCampaign:e,queueCampaigns:b.queueCampaigns?b.queueCampaigns.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("queueCampaign")+"?").htmlContent("<b>"+(e.name||"queueCampaign")+"</b> will be deleted.").ariaLabel("delete queueCampaign").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:1510}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.motiondialer.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.motiondialer.realtime.queues",{})}},b.success=y,b.getQueueCampaigns=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="QueueCampaigns",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditQueueCampaign=function(e,t){i.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:b.queueCampaigns.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteQueueCampaign=S,b.exportSelectedQueueCampaigns=function(){var e=angular.copy(b.selectedQueueCampaigns);return b.selectedQueueCampaigns=[],e},b.deleteSelectedQueueCampaigns=function(e){var t=i.confirm().title("Are you sure want to delete the selected queueCampaigns?").htmlContent("<b>"+b.selectedQueueCampaigns.length+" selected</b> will be deleted.").ariaLabel("delete QueueCampaigns").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedQueueCampaigns.forEach(function(e){S(e)}),b.selectedQueueCampaigns=[]})},b.deselectQueueCampaigns=function(){b.selectedQueueCampaigns=[]},b.selectAllQueueCampaigns=function(){b.selectedQueueCampaigns=b.queueCampaigns.rows},g.hasRole("admin")?m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.trunks=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(b.trunks,{id:e.resourceId})}),a=null;a=[],b.queueCampaigns.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(b.trunks,{id:e.id});t.canSelect=!1,n.push(t)}}),b.trunks=n})}else{var n=[],a=[];b.queueCampaigns.rows.forEach(function(e){var t=_.find(b.trunks,{id:Number(e.TrunkId)});a.push(t)});for(var i=0;i<b.trunks.length;i++){_.some(a,{id:b.trunks[i].id})&&(b.trunks[i].canSelect=!1,n.push(b.trunks[i]))}b.trunks=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVAL",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.interval.get({fields:"id,name",sort:"name",IntervalId:"null"}).$promise.then(function(e){b.interval=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.interval,{id:e.resourceId})}),n=null;if(b.queueCampaign&&(n=_.find(b.interval,{id:Number(b.queueCampaign.IntervalId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.interval,{id:n.id});a.canSelect=!1,t.push(a)}b.interval=t})}else{var n=[],a=null;b.queueCampaign&&(a=_.find(b.interval,{id:Number(b.queueCampaign.IntervalId)}));for(var i=0;i<b.interval.length;i++)a&&b.interval[i].id===a.id&&(b.interval[i].canSelect=!1,n.push(b.interval[i]));b.interval=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.queueCampaigns=e||{count:0,rows:[]}}function S(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.queueCampaigns.rows,{id:e.id}),b.queueCampaigns.count-=1,b.queueCampaigns.rows.length||b.getQueueCampaigns(),p.success({title:_.startCase("QueueCampaign")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getQueueCampaigns())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","queueCampaigns","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.motiondialer").controller("QueueCampaignsController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this,h=!0;function f(){var e=i.localStorage.getItem("motion2.realtime.abandoned.bull.contacts:"+v.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(v.query=_.merge(e.query,_.omit(v.query,["sort","limit","page"])),v.query=_.omit(v.query,"filter")),d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"outbound",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()}):o.userProfile.getResources({id:v.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"outbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()})}function b(e){v.contacts=e||{count:0,rows:[]},h=!1,v.refresh=!0}v.showTooltip=!1,v.refresh=!0,v.disable=[],v.agents=p||[],v.currentUser=d.getCurrentUser(),v.localizationMap=u,v.pickerModel={dateStart:null,dateEnd:null},v.queues={},v.contacts={count:0,rows:[]},v.dispositions=g,v.userProfile=r,v.userProfileSection=l&&1==l.count?l.rows[0]:null,v.crudPermissions=d.parseCrudPermissions(v.userProfileSection?v.userProfileSection.crudPermissions:null),v.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"outbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},v.clearAll=function(){v.query.createdAt=void 0,v.pickerModel={dateStart:null,dateEnd:null},v.getContacts()},v.getContacts=function(){if(v.refresh=!1,v.pickerModel.dateStart&&!h){var e=moment(v.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();v.query.createdAt={$gte:v.pickerModel.dateStart,$lte:e}}else v.query.createdAt=void 0;v.query.queue=v.query.queue,v.query.offset=(v.query.page-1)*v.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.bull.contacts:"+v.currentUser.id,JSON.stringify({query:_.omit(v.query,"queue")})),v.promise=o.voiceQueueReport.getVoiceQueuesReport(v.query,b).$promise},v.refreshContacts=function(){v.showTooltip=!1,v.getContacts()},v.onInit=f,v.assignedA=function(e,t){e&&(v.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){v.disable[e.id]=!1}))},v.disposed=function(e,t){e&&o.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},v.onSavevoiceQueueReport=function(e){e&&v.queuesMap&&"outbound"===e.type&&v.queuesMap[e.queue]&&(v.showTooltip=!0)},v.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(v.contacts.rows,["id",e.id]);0<=t&&_.merge(v.contacts.rows[t],e)}},c.onWithoutApply("voiceQueueReport:save",v.onSavevoiceQueueReport),c.on("voiceQueueReport:update",v.onUpdatevoiceQueueReport),f();var E=!0,A=1;e.$watch("vm.query.filter",function(e,t){E?n(function(){E=!1}):(t||(A=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=A),v.getContacts())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","dateFilterLocalizationFactory","agents","dispositions"],angular.module("app.motiondialer").controller("AbandonedCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",direction:"outbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,i,t,s,o,r,l,d,c,m){var u=this,p=["name","active","limitCalls","message","originated","IntervalId","SquareProjectId","Trunk","TrunkId","ivrAnswerCallsDay","dialQueueProject","ivrTotalCallsDays","description"];function g(){_.forIn(u.campaigns,function(e,t){u.rpcCampaigns[t]&&_.merge(e,_.pick(u.rpcCampaigns[t],p))})}u.currentUser=m.getCurrentUser(),u.count=o.count,u.campaigns=o?_.keyBy(o.rows?o.rows:[],"id"):{},u.rpcCampaigns=s?_.keyBy(s.rows?s.rows:[],"id"):{},u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.query={sort:"-updatedAt",limit:10,page:1},u.success=f,u.getCampaigns=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=r.campaign.get(u.query,f).$promise:(u.query.id=u.userProfile.id,u.query.section="IvrCampaigns",u.promise=r.userProfile.getResources(u.query,f).$promise)},u.onSave=function(e){u.campaigns[e.id]&&(_.merge(u.campaigns[e.id],_.pick(e,p)),_.merge(u.rpcCampaigns[e.id],_.pick(e,p)))},u.$onInit=g,u.createOrEditIvrCampaign=function(e,t){a.show({controller:"CreateOrEditIvrCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{ivrCampaign:t,ivrCampaigns:_.values(u.campaigns),license:null,setting:null,crudPermissions:u.crudPermissions}})},l.onWithoutApply("campaign:save",u.onSave),u.interval=t(function(){},999);var v=!0,h=1;function f(e){u.count=e.count,u.campaigns=e?_.keyBy(e.rows?e.rows:[],"id"):{},g()}e.$watch("vm.query.filter",function(e,t){v?n(function(){v=!1}):(t||(h=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=h),u.getCampaigns())}),e.$on("$destroy",function(){l.removeAllListeners("campaign:save"),u.interval&&t.cancel(u.interval)})}e.$inject=["$scope","$timeout","$mdDialog","$document","$interval","rpcCampaigns","campaigns","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("IvrCampaignsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.agents=n||{count:0,rows:[]},p.queues=i?_.keyBy(i.rows?i.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=s?_.keyBy(s.rows?_.filter(s.rows,{type:"outbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,t){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[t]=e)})},p.onSave=function(e){"outbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){d.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(t,e,n){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e,context:n}).$promise.then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueCallsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["total","answered","sumHoldTime","sumDuration","sumBillable","outboundNoAnswerCallsDay","outboundBusyCallsDay","outboundCongestionCallsDay","outboundNoSuchCallsDay","outboundUnknownCallsDay","outboundDropCallsDayTimeout","outboundDropCallsDayCallersExit","outboundBlacklistCallsDay","outboundOriginateFailureCallsDay","outboundAnswerAgiCallsDay","outboundReCallsDay","outboundRejectCallsDay"];function u(){_.forIn(c.queues,function(e,t){c.rpcQueues[t]&&_.merge(e,_.pick(c.rpcQueues[t],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"outbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="QueueCampaigns",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueueParamsMotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].VoiceQueueId].paused++,g.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,g.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"outbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"voice",type:"outbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.voiceQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="QueueCampaigns",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditMotionDialerQueue=function(e,t){a.show({controller:"CreateOrEditQueueCampaignDialogController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"QueueCampaignagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{queueCampaign:t,queueCampaigns:g.queues?g.queues.rows:[],realtime:!0,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.MotionDialerQueueId]&&g.queues[e.MotionDialerQueueId].loggedInDb++},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.VoiceQueueId]&&(g.queues[e.VoiceQueueId].loggedInDb+=1,g.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.VoiceQueueId]&&0<g.queues[e.VoiceQueueId].loggedInDb&&(g.queues[e.VoiceQueueId].loggedInDb-=1,delete g.queues[e.VoiceQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.onWithoutApply("voice_queue:save",g.onSave),g.interval=s(function(){},999),d.on("userVoiceQueueRt:save",g.onSaveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),g.interval&&s.cancel(g.interval),d.removeAllListeners("userVoiceQueueRt:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.motiondialer").controller("QueuesMotionDialerRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.motiondialer.realtime.agents":this.selectedTab=0;break;case"app.motiondialer.realtime.queues":this.selectedTab=1;break;case"app.motiondialer.realtime.queue_calls":this.selectedTab=2;break;case"app.motiondialer.realtime.abandonedcalls":this.selectedTab=3;break;case"app.motiondialer.realtime.queue_params":this.selectedTab=4;break;case"app.motiondialer.realtime.ivr_campaigns":this.selectedTab=5;break;default:this.selectedTab=0,n.go("app.motiondialer.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.motiondialer.realtime.agents");break;case 1:n.go("app.motiondialer.realtime.queues");break;case 2:n.go("app.motiondialer.realtime.queue_calls");break;case 3:n.go("app.motiondialer.realtime.abandonedcalls");break;case 4:n.go("app.motiondialer.realtime.queue_params");break;case 5:n.go("app.motiondialer.realtime.ivr_campaigns");break;default:n.go("app.motiondialer.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.motiondialer").controller("MotionDialerRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT",g.openchannelAccount=angular.copy(l),g.openchannelAccounts=r,g.newOpenchannelAccount=!1,g.openchannelAccount||(g.openchannelAccount={waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="OPENCHANNEL.NEW_OPENCHANNELACCOUNT",g.newOpenchannelAccount=!0),t.params.id&&(g.openchannelAccount.OpenchannelAccountId=t.params.id),g.addNewOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.save(g.openchannelAccount).$promise.then(function(e){g.openchannelAccounts.unshift(e.toJSON()),o.success({title:"OpenchannelAccount properly created",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelAccount=function(){g.errors=[],d.openchannelAccount.update({id:g.openchannelAccount.id},g.openchannelAccount).$promise.then(function(e){var t=_.find(g.openchannelAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelAccount properly saved!",msg:g.openchannelAccount.name?g.openchannelAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelAccount will be deleted.").ariaLabel("Delete OpenchannelAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.openchannelAccount.delete({id:g.openchannelAccount.id}).$promise.then(function(){_.remove(g.openchannelAccounts,{id:g.openchannelAccount.id}),o.success({title:"OpenchannelAccount properly deleted!",msg:(g.openchannelAccount.name||"openchannelAccount")+" has been deleted!"}),v(g.openchannelAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.openchannelAccount&&(n=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.openchannelAccount&&(a=_.find(g.lists,{id:Number(g.openchannelAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelAccounts","openchannelAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccountApp:n,openchannelAccount:r.openchannelAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.openchannelAccountApps.rows[t]=e:r.openchannelAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.openchannelAccountApps.rows.length;n++,0){var a=r.openchannelAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.openchannelAccount.context,a.exten=r.openchannelAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.openchannelAccount.addApplications({id:r.openchannelAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.openchannelAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.openchannelAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.openchannelAccount={},r.openchannelAccountApps={count:0,rows:[]},r.selectedOpenchannelAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"OpenchannelQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"openchannelQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:801}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,defaultValue:300,required:!0,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",role:"agent",nolimit:!0},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.openchannelAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getOpenchannelAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.openchannelAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getOpenchannelAccountApps=function(){r.promise=o.openchannelAccount.getApplications(r.query,n).$promise},r.editOpenchannelAccountApp=t,r.editInterval=function(e,t){if(r.openchannelAccountApps.rows.length){var n=r.openchannelAccountApps.rows[t]?r.openchannelAccountApps.rows[t]:r.openchannelAccountApps.rows[0];i.show({controller:"EditOpenchannelAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteOpenchannelAccountApp=function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedOpenchannelAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedOpenchannelAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedOpenchannelAccountApps.forEach(function(e){_.remove(r.openchannelAccountApps.rows,{id:e.id})}),r.selectedOpenchannelAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelAccount.getAgents({id:c.openchannelAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserOpenchannelAccount?"penalty "+e.UserOpenchannelAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelAccount.removeAgents({id:c.openchannelAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelAccount.addAgents({id:c.openchannelAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelAccount","openchannelAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",role:"agent",nolimit:"true"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditOpenchannelAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("openChannel")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.openchannelQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:801}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="OPENCHANNEL.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveOpenchannelAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","openchannelAccountApp","openchannelAccount","api","Auth","crudPermissions"],angular.module("app.openchannel").controller("EditOpenchannelAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountInteractions={count:0,rows:[]},c.selectedOpenchannelAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,OpenchannelAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.getOpenchannelAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.openchannelInteractionDownload=function(s,e,t){return l.openchannelInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="openchannel-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getOpenchannelAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getInteractions(c.query,p).$promise},c.createOrEditOpenchannelAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,interaction:t,interactions:c.openchannelAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spyopenchannelInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"openchannel",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedOpenchannelAccountInteractions=function(){var e=angular.copy(c.selectedOpenchannelAccountInteractions);return c.selectedOpenchannelAccountInteractions=[],e},c.deleteOpenchannelAccountInteraction=g,c.deleteSelectedOpenchannelAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedOpenchannelAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountInteractions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountInteractions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountInteractions=e||{count:0,rows:[]}}function g(e){l.openchannelInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountInteractions.rows,{id:e.id}),c.openchannelAccountInteractions.count-=1,c.openchannelAccountInteractions.rows.length||c.getOpenchannelAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelCannedAnswers={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the openchannelCannedAnswer?").htmlContent("<b>"+(e.name||"openchannelCannedAnswer")+"</b> will be deleted.").ariaLabel("delete openchannelCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getAnswers(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelCannedAnswer=function(e,t){s.show({controller:"CreateOrEditOpenchannelCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelCannedAnswer:t,openchannelCannedAnswers:c.openchannelAccountOpenchannelCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedOpenchannelAccountOpenchannelCannedAnswers=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelCannedAnswers);return c.selectedOpenchannelAccountOpenchannelCannedAnswers=[],e},c.deleteOpenchannelAccountOpenchannelCannedAnswer=g,c.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected openchannelCannedAnswers?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete openchannelCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelCannedAnswers.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelCannedAnswers=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelCannedAnswers.rows,{id:e.id}),c.openchannelAccountOpenchannelCannedAnswers.count-=1,c.openchannelAccountOpenchannelCannedAnswers.rows.length||c.getOpenchannelAccountOpenchannelCannedAnswers(),r.success({title:"OpenchannelCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER",g.openchannelCannedAnswer=angular.copy(l),g.openchannelCannedAnswers=r,g.newOpenchannelCannedAnswer=!1,g.openchannelCannedAnswer||(g.openchannelCannedAnswer={},g.title="OPENCHANNEL.NEW_OPENCHANNELCANNEDANSWER",g.newOpenchannelCannedAnswer=!0),t.params.id&&(g.openchannelCannedAnswer.OpenchannelAccountId=t.params.id),g.addNewOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.openchannelCannedAnswer).$promise.then(function(e){g.openchannelCannedAnswers.unshift(e.toJSON()),o.success({title:"OpenchannelCannedAnswer properly created",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.openchannelCannedAnswer.id},g.openchannelCannedAnswer).$promise.then(function(e){var t=_.find(g.openchannelCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelCannedAnswer properly saved!",msg:g.openchannelCannedAnswer.name?g.openchannelCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelCannedAnswer will be deleted.").ariaLabel("Delete OpenchannelCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.openchannelCannedAnswer.id}).$promise.then(function(){_.remove(g.openchannelCannedAnswers,{id:g.openchannelCannedAnswer.id}),o.success({title:"OpenchannelCannedAnswer properly deleted!",msg:(g.openchannelCannedAnswer.name||"openchannelCannedAnswer")+" has been deleted!"}),v(g.openchannelCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelCannedAnswers","openchannelCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.openchannelAccount={},c.openchannelAccountOpenchannelDispositions={count:0,rows:[]},c.selectedOpenchannelAccountOpenchannelDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.openchannelAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.openchannelAccount.id,c.query.OpenchannelAccountId=c.openchannelAccount.id,c.getOpenchannelAccountOpenchannelDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the openchannelDisposition?").htmlContent("<b>"+(e.name||"openchannelDisposition")+"</b> will be deleted.").ariaLabel("delete openchannelDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getOpenchannelAccountOpenchannelDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.openchannelAccount.getDispositions(c.query,p).$promise},c.createOrEditOpenchannelAccountOpenchannelDisposition=function(e,t){s.show({controller:"CreateOrEditOpenchannelDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:c.openchannelAccount,openchannelDisposition:t,openchannelDispositions:c.openchannelAccountOpenchannelDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedOpenchannelAccountOpenchannelDispositions=function(){var e=angular.copy(c.selectedOpenchannelAccountOpenchannelDispositions);return c.selectedOpenchannelAccountOpenchannelDispositions=[],e},c.deleteOpenchannelAccountOpenchannelDisposition=g,c.deleteSelectedOpenchannelAccountOpenchannelDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected openchannelDispositions?").htmlContent("<b>"+c.selectedOpenchannelAccountOpenchannelDispositions.length+" selected</b> will be deleted.").ariaLabel("delete openchannelDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedOpenchannelAccountOpenchannelDispositions.forEach(function(e){g(e)}),c.selectedOpenchannelAccountOpenchannelDispositions=[]})};var m=!0,u=1;function p(e){c.openchannelAccountOpenchannelDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.openchannelAccountOpenchannelDispositions.rows,{id:e.id}),c.openchannelAccountOpenchannelDispositions.count-=1,c.openchannelAccountOpenchannelDispositions.rows.length||c.getOpenchannelAccountOpenchannelDispositions(),r.success({title:"OpenchannelDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getOpenchannelAccountOpenchannelDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.openchannel").controller("OpenchannelAccountOpenchannelDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION",g.openchannelDisposition=angular.copy(l),g.openchannelDispositions=r,g.newOpenchannelDisposition=!1,g.openchannelDisposition||(g.openchannelDisposition={},g.title="OPENCHANNEL.NEW_OPENCHANNELDISPOSITION",g.newOpenchannelDisposition=!0),t.params.id&&(g.openchannelDisposition.OpenchannelAccountId=t.params.id),g.addNewOpenchannelDisposition=function(){g.errors=[],d.disposition.save(g.openchannelDisposition).$promise.then(function(e){g.openchannelDispositions.unshift(e.toJSON()),o.success({title:"OpenchannelDisposition properly created",msg:g.openchannelDisposition.name?g.openchannelDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelDisposition=function(){g.errors=[],d.disposition.update({id:g.openchannelDisposition.id},g.openchannelDisposition).$promise.then(function(e){var t=_.find(g.openchannelDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelDisposition properly saved!",msg:g.openchannelDisposition.name?g.openchannelDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelDisposition will be deleted.").ariaLabel("Delete OpenchannelDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.openchannelDisposition.id}).$promise.then(function(){_.remove(g.openchannelDispositions,{id:g.openchannelDisposition.id}),o.success({title:"OpenchannelDisposition properly deleted!",msg:(g.openchannelDisposition.name||"openchannelDisposition")+" has been deleted!"}),v(g.openchannelDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelDispositions","openchannelDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.openchannelAccount=c||e.params.openchannelAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:u.openchannelAccounts?u.openchannelAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelAccounts=function(){e.go("app.openchannel.openchannelAccounts")},u.saveOpenchannelAccount=function(){r.openchannelAccount.update({id:u.openchannelAccount.id},u.openchannelAccount).$promise.then(function(){l.success({title:"OpenchannelAccount updated!",msg:u.openchannelAccount.name?u.openchannelAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.openchannelAccount&&(n=_.find(u.lists,{id:Number(u.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.openchannelAccount&&(a=_.find(u.lists,{id:Number(u.openchannelAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.cmContact.describe({id:u.openchannelAccount.ListId}).$promise.then(function(e){u.fields=[];e=_.values(e.toJSON());for(var t=["id","createdAt","updatedAt","deletedAt","scheduledat","ListId","CompanyId"],n=0;n<e.length;n++)_.includes(t,e[n].columnName)||u.fields.push(e[n])}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FIELDS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelAccount","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.openchannelAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="openchannelAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedOpenchannelAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,token,replyUri,ListId,waitForTheAssignedAgent,mapKey,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUri,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,openchannelAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.openchannel.openchannelAccounts.edit",{id:e.id,tab:5})},b.agentadddialog=function(e,t){i.show({controller:"OpenchannelAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelAccount:e,openchannelAccounts:b.openchannelAccounts?b.openchannelAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelAccount")+"?").htmlContent("<b>"+(e.name||"openchannelAccount")+"</b> will be deleted.").ariaLabel("delete openchannelAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getOpenchannelAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.openchannelAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OpenchannelAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOpenchannelAccount=function(e,t){i.show({controller:"CreateOrEditOpenchannelAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelAccount:t,openchannelAccounts:b.openchannelAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOpenchannelAccount=S,b.exportSelectedOpenchannelAccounts=function(){var e=angular.copy(b.selectedOpenchannelAccounts);return b.selectedOpenchannelAccounts=[],e},b.deleteSelectedOpenchannelAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelAccounts?").htmlContent("<b>"+b.selectedOpenchannelAccounts.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOpenchannelAccounts.forEach(function(e){S(e)}),b.selectedOpenchannelAccounts=[]})},b.deselectOpenchannelAccounts=function(){b.selectedOpenchannelAccounts=[]},b.selectAllOpenchannelAccounts=function(){b.selectedOpenchannelAccounts=b.openchannelAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.openchannelAccount&&(n=_.find(b.lists,{id:Number(b.openchannelAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.openchannelAccount&&(a=_.find(b.lists,{id:Number(b.openchannelAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.openchannelAccounts=e||{count:0,rows:[]}}function S(e){m.openchannelAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.openchannelAccounts.rows,{id:e.id}),b.openchannelAccounts.count-=1,b.openchannelAccounts.rows.length||b.getOpenchannelAccounts(),p.success({title:_.startCase("OpenchannelAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOpenchannelAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="OPENCHANNEL.EDIT_OPENCHANNELQUEUE",g.openchannelQueue=angular.copy(l),g.openchannelQueues=r,g.newOpenchannelQueue=!1,g.openchannelQueue||(g.openchannelQueue={strategy:"beepall",timeout:10},g.title="OPENCHANNEL.NEW_OPENCHANNELQUEUE",g.newOpenchannelQueue=!0),g.addNewOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.save(g.openchannelQueue).$promise.then(function(e){g.openchannelQueues.unshift(e.toJSON()),o.success({title:"OpenchannelQueue properly created",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveOpenchannelQueue=function(){g.errors=[],d.openchannelQueue.update({id:g.openchannelQueue.id},g.openchannelQueue).$promise.then(function(e){var t=_.find(g.openchannelQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"OpenchannelQueue properly saved!",msg:g.openchannelQueue.name?g.openchannelQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteOpenchannelQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The openchannelQueue will be deleted.").ariaLabel("Delete OpenchannelQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.openchannelQueue.delete({id:g.openchannelQueue.id}).$promise.then(function(){_.remove(g.openchannelQueues,{id:g.openchannelQueue.id}),o.success({title:"OpenchannelQueue properly deleted!",msg:(g.openchannelQueue.name||"openchannelQueue")+" has been deleted!"}),v(g.openchannelQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","openchannelQueues","openchannelQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.openchannel").controller("CreateOrEditOpenchannelQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelQueue.getAgents({id:c.openchannelQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserOpenchannelQueue?"penalty "+e.UserOpenchannelQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.openchannelQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.removeAgents({id:c.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.addAgents({id:c.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("OPENCHANNEL.ALL_AGENTS"),labelSelected:r.instant("OPENCHANNEL.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","openchannelQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.openchannelQueue.getTeams({id:l.openchannelQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.openchannelQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("OPENCHANNEL.ALL_TEAMS"),labelSelected:n.instant("OPENCHANNEL.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.removeTeams({id:l.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.openchannelQueue.addTeams({id:l.openchannelQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","openchannelQueue","$translate","Auth","crudPermissions"],angular.module("app.openchannel").controller("OpenchannelQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.openchannelQueue=c||e.params.openchannelQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:u.openchannelQueues?u.openchannelQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoOpenchannelQueues=function(){e.go("app.openchannel.openchannelQueues")},u.saveOpenchannelQueue=function(){r.openchannelQueue.update({id:u.openchannelQueue.id},u.openchannelQueue).$promise.then(function(){l.success({title:"OpenchannelQueue updated!",msg:u.openchannelQueue.name?u.openchannelQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","openchannelQueue","userProfileSection"],angular.module("app.openchannel").controller("OpenchannelQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.openchannelQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="openchannelQueues",b.listOrder="",b.listOrderAsc=null,b.selectedOpenchannelQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"openchannel",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.openchannel.openchannelQueues.edit",{id:e.id,openchannelQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"OpenchannelQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:b.openchannelQueues?b.openchannelQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{openchannelQueue:e,openchannelQueues:b.openchannelQueues?b.openchannelQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("openchannelQueue")+"?").htmlContent("<b>"+(e.name||"openchannelQueue")+"</b> will be deleted.").ariaLabel("delete openchannelQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:810}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.openchannel.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.openchannel.realtime.queues",{})}},b.success=y,b.getOpenchannelQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.openchannelQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OpenchannelQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOpenchannelQueue=function(e,t){i.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:b.openchannelQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOpenchannelQueue=S,b.exportSelectedOpenchannelQueues=function(){var e=angular.copy(b.selectedOpenchannelQueues);return b.selectedOpenchannelQueues=[],e},b.deleteSelectedOpenchannelQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected openchannelQueues?").htmlContent("<b>"+b.selectedOpenchannelQueues.length+" selected</b> will be deleted.").ariaLabel("delete OpenchannelQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOpenchannelQueues.forEach(function(e){S(e)}),b.selectedOpenchannelQueues=[]})},b.deselectOpenchannelQueues=function(){b.selectedOpenchannelQueues=[]},b.selectAllOpenchannelQueues=function(){b.selectedOpenchannelQueues=b.openchannelQueues.rows};var E=!0,A=1;function y(e){b.openchannelQueues=e||{count:0,rows:[]}}function S(e){m.openchannelQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.openchannelQueues.rows,{id:e.id}),b.openchannelQueues.count-=1,b.openchannelQueues.rows.length||b.getOpenchannelQueues(),p.success({title:_.startCase("OpenchannelQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEopenchannelQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEopenchannelQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOpenchannelQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","openchannelQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.openchannel").controller("OpenchannelQueuesController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"openchannel",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsOpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.openchannelQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].OpenchannelQueueId].paused++,g.queues[e[t].rows[n].OpenchannelQueueId].loggedInDb++,g.queues[e[t].rows[n].OpenchannelQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].OpenchannelQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"openchannel",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.openchannelQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="OpenchannelQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditOpenchannelQueue=function(e,t){a.show({controller:"CreateOrEditOpenchannelQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"OpenchannelQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{openchannelQueue:t,openchannelQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.openchannelQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.OpenchannelQueueId]&&g.queues[e.OpenchannelQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.OpenchannelQueueId]&&g.queues[e.OpenchannelQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.OpenchannelQueueId]&&(g.queues[e.OpenchannelQueueId].loggedInDb+=1,g.queues[e.OpenchannelQueueId].agents[e.UserId]=e.OpenchannelQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.OpenchannelQueueId]&&0<g.queues[e.OpenchannelQueueId].loggedInDb&&(g.queues[e.OpenchannelQueueId].loggedInDb-=1,delete g.queues[e.OpenchannelQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("openchannel_queue:save",g.onSave),d.on("userOpenchannelQueue:save",g.onSaveMember),d.on("userOpenchannelQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("openchannel_queue:save"),d.removeAllListeners("userOpenchannelQueue:remove"),d.removeAllListeners("userOpenchannelQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.openchannel").controller("QueuesOpenchannelRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.openchannel.realtime.agents":this.selectedTab=0;break;case"app.openchannel.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.openchannel.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.openchannel.realtime.agents");break;case 1:n.go("app.openchannel.realtime.queues");break;default:n.go("app.openchannel.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.openchannel").controller("OpenchannelRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.currentUser=s.getCurrentUser(),o.plugin={},o.getTrustedURL=function(){return n.trustAsResourceUrl(o.plugin.adminUrl)},a.plugin.get({id:e.params.id}).$promise.then(function(e){if(e)return o.plugin=e,a.plugin.get({id:o.plugin.id}).$promise}).catch(function(e){o.plugin=void 0})}e.$inject=["$state","$scope","$sce","api","socket","Auth"],angular.module("app.plugins.plugin").controller("PluginController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_CUSTOMIZATION",g.customization=angular.copy(l),g.customizations=r,g.newCustomization=!1,g.customization||(g.customization={},g.title="SETTINGS.NEW_CUSTOMIZATION",g.newCustomization=!0),g.addNewCustomization=function(){g.errors=[],d.setting.save(g.customization).$promise.then(function(e){g.customizations.unshift(e.toJSON()),o.success({title:"Customization properly created",msg:g.customization.name?g.customization.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomization=function(){g.errors=[],d.setting.update({id:g.customization.id},g.customization).$promise.then(function(e){var t=_.find(g.customizations,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Customization properly saved!",msg:g.customization.name?g.customization.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomization=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The customization will be deleted.").ariaLabel("Delete Customization").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.setting.delete({id:g.customization.id}).$promise.then(function(){_.remove(g.customizations,{id:g.customization.id}),o.success({title:"Customization properly deleted!",msg:(g.customization.name||"customization")+" has been deleted!"}),v(g.customization)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customizations","customization","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditCustomizationDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.customizations=e,s.customization={},s.customizations&&s.customizations.rows&&s.customizations.rows.length&&(s.customization=s.customizations.rows[0]),s.saveCustomization=function(){s.customization.id?t.setting.update({id:s.customization.id},s.customization).$promise.then(function(){n.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(s.customization).$promise.then(function(e){_.merge(s.customization,e),n.success({title:"Customization updated!",msg:s.customization.name?s.customization.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["customizations","api","toasty","license","Auth"],angular.module("app.settings").controller("CustomizationsController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogoController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/logo_login".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationlogologinController",e)}(),function(){"use strict";function e(e,a){var i=this;i.customization={},i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.customization.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.customization.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e){i.customization=angular.copy(e),i.ngFlowOptions.target="/api/settings/1/preferred".replace(":id",i.customization.id),i.customization.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.settings").controller("CustomizationpreferredController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_GENERAL",g.general=angular.copy(l),g.generals=r,g.newGeneral=!1,g.general||(g.general={min_internal:1e3,chatTimeout:10,phoneBarAutoUpdater:!0,phoneBarAutoUpdaterUrl:"https://www.xcally.com/bar/phonebar/autoupdater.xml",splitSizeCsv:5e3,splitSizePdf:1e3,splitSizeXlsx:5e3,messagesAlignment:"alternate",phoneBarRememberMeEnabled:!0},g.title="SETTINGS.NEW_GENERAL",g.newGeneral=!0),g.addNewGeneral=function(){g.errors=[],d.setting.save(g.general).$promise.then(function(e){g.generals.unshift(e.toJSON()),o.success({title:"General properly created",msg:g.general.name?g.general.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveGeneral=function(){g.errors=[],d.setting.update({id:g.general.id},g.general).$promise.then(function(e){var t=_.find(g.generals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"General properly saved!",msg:g.general.name?g.general.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteGeneral=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The general will be deleted.").ariaLabel("Delete General").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.setting.delete({id:g.general.id}).$promise.then(function(){_.remove(g.generals,{id:g.general.id}),o.success({title:"General properly deleted!",msg:(g.general.name||"general")+" has been deleted!"}),v(g.general)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.setting.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.setting.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","generals","general","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditGeneralDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.generals=e,s.general={},s.generals&&s.generals.rows&&s.generals.rows.length&&(s.general=s.generals.rows[0]),s.saveGeneral=function(){s.general.id?t.setting.update({id:s.general.id},s.general).$promise.then(function(){n.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.setting.save(s.general).$promise.then(function(e){_.merge(s.general,e),n.success({title:"General updated!",msg:s.general.name?s.general.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsetting",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["generals","api","toasty","license","Auth"],angular.module("app.settings").controller("GeneralsController",e)}(),function(){"use strict";function e(t,n,a,i,e,s){var o=this;o.license=i||{},o.agents=0,o.users=0,o.telephones=0,o.channels=[{name:"voice",icon:"icon-phone"},{name:"chat",icon:"icon-hangouts"},{name:"mail",icon:"icon-email"},{name:"messaging",icon:"icon-message-text"},{name:"fax",icon:"icon-deskphone"},{name:"openchannel",icon:"icon-google-earth"}],o.modules=[{name:"cm",icon:"icon-account-circle"},{name:"dialer",icon:"icon-crosshairs"},{name:"jscripty",icon:"icon-console"}],o.addons=[{name:"webrtc",icon:"icon-server-plus"},{name:"jaws",icon:"icon-fish"},{name:"custom",icon:"icon-table-edit"}],o.sessions=[{name:"callysquare",icon:"icon-sitemap",restart:!0,label:"channels",enabled:"voice"},{name:"virtual",icon:"icon-dots-horizontal",restart:!1,label:"sessions",enabled:"chat"}],o.others=[{name:"update",icon:"icon-cloud-download"}],o.requestLicense=function(e){n.show({controller:"RequestLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/request/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i,channels:o.channels,modules:o.modules,addons:o.addons,sessions:o.sessions,others:o.others}})},o.updateLicense=function(e){n.show({controller:"UpdateLicenseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/license/update/dialog.html",parent:angular.element(t.body),targetEvent:e,clickOutsideToClose:!0,locals:{license:i}})},o.gotoProcess=function(e){a.go("app.settings.system",{tab:1})},s.user.get({fields:"id",role:"agent",online:!0}).$promise.then(function(e){return o.agents=e&&e.count?e.count:0,s.user.get({fields:"id",role:"user,admin"}).$promise}).then(function(e){return o.users=e&&e.count?e.count:0,s.user.get({fields:"id",role:"telephone"}).$promise}).then(function(e){o.telephones=e&&e.count?e.count:0}).catch(function(e){console.log(e)})}e.$inject=["$document","$mdDialog","$state","license","toasty","api"],angular.module("app.settings.license").controller("LicenseController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c){var m=this;function u(){e.hide()}m.errors=[],m.user=d.getCurrentUser(),m.license=angular.copy(n),m.channels=a,m.modules=i,m.addons=s,m.sessions=o,m.others=r,m.license.name=m.user.fullname,m.license.email=m.user.email,m.sendRequest=function(){for(var e in m.errors=[],m.table="||FIELD||OLD||NEW||\n",m.license)m.license.hasOwnProperty(e)&&!_.includes(["$promise","$resolved"],e)&&(n[e]===m.license[e]?m.table+="|"+e+"|"+(void 0!==n[e]?n[e]:"")+"|"+m.license[e]+"|\n":m.table+="|"+e+"|{color:red}"+(void 0!==n[e]?n[e]:"")+"{color}|*"+m.license[e]+"*|\n");l.jira.save({key:"MOTLICENSE",summary:"Motion License Request",description:m.table,issuetype:"License Request"}).$promise.then(function(e){t.success({title:"Request sent!",msg:c.instant("SETTINGS.LICENSE_REQUEST_SENT"),timeout:15e3}),u()}).catch(function(e){console.error(e),m.errors=[{message:c.instant("SETTINGS.JIRA_ERROR_MESSAGE"),type:"api.jira"}]})},m.closeDialog=u}e.$inject=["$mdDialog","toasty","license","channels","modules","addons","sessions","others","api","Auth","$translate"],angular.module("app.settings.license").controller("RequestLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.errors=[],s.license=angular.copy(n),s.licenseKey,s.updateLicense=function(){return a.license.update({id:1,key:s.licenseKey}).$promise.then(function(e){e&&(e.demo?t.error({title:"License update failed!",msg:"Invalid license key"}):t.success({title:"License properly updated!",msg:"The license has been updated!"}))}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UPDATElicense",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","toasty","license","api","$translate"],angular.module("app.settings.license").controller("UpdateLicenseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u){var p=this;function g(e){a.hide(e)}p.currentUser=c.getCurrentUser(),p.errors=[],p.setting=u,p.license=m,p.hasModulePermissions={},p.passwordPattern=p.setting&&p.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",p.title="SETTINGS.EDIT_NETWORK",p.network=angular.copy(l),p.networks=r,p.newNetwork=!1,p.network||(p.network={type:"localnet"},p.title="SETTINGS.NEW_NETWORK",p.newNetwork=!0),p.addNewNetwork=function(){p.errors=[],d.network.save(p.network).$promise.then(function(e){p.networks.unshift(e.toJSON()),o.success({title:"Network properly created",msg:p.network.name?p.network.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.saveNetwork=function(){p.errors=[],d.network.update({id:p.network.id},p.network).$promise.then(function(e){var t=_.find(p.networks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Network properly saved!",msg:p.network.name?p.network.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},p.deleteNetwork=function(e){p.errors=[];var t=a.confirm().title("Are you sure?").content("The network will be deleted.").ariaLabel("Delete Network").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.network.delete({id:p.network.id}).$promise.then(function(){_.remove(p.networks,{id:p.network.id}),o.success({title:"Network properly deleted!",msg:(p.network.name||"network")+" has been deleted!"}),g(p.network)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){p.errors=e.data.errors||[{message:e.toString(),type:"api.network.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.network.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},p.getDateFromString=function(e){return null===e?void 0:new Date(e)},p.closeDialog=g}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","networks","network","api","Auth","license","setting"],angular.module("app.settings").controller("CreateOrEditNetworkDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v){var h=this;h.license=p,h.setting=g,h.currentUser=u.getCurrentUser(),h.networks=l||{count:0,rows:[]},h.table="networks",h.listOrder="",h.listOrderAsc=null,h.selectedNetworks=[],h.query={fields:"createdAt,updatedAt,id,type,value",sort:"-updatedAt",limit:10,page:1},h.arraytype=_.keyBy([{option:"LocalNET",value:"'localnet'"},{option:"ExternIP",value:"'externip'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),h.editdialog=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{network:e,networks:h.networks.rows,license:h.license,setting:null,crudPermissions:h.crudPermissions}})},h.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("network")+"?").htmlContent("<b>"+(e.name||"network")+"</b> will be deleted.").ariaLabel("delete network").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){A(e)},function(){console.log("CANCEL")})},h.success=E,h.getNetworks=function(){h.query.offset=(h.query.page-1)*h.query.limit,u.hasRole("admin")?h.promise=d.network.get(h.query,E).$promise:(h.query.id=h.userProfile.id,h.query.section="Networks",h.promise=d.userProfile.getResources(h.query,E).$promise)},h.createOrEditNetwork=function(e,t){i.show({controller:"CreateOrEditNetworkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/networks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{network:t,networks:h.networks.rows,license:h.license,setting:h.setting,crudPermissions:h.crudPermissions}})},h.deleteNetwork=A,h.exportSelectedNetworks=function(){var e=angular.copy(h.selectedNetworks);return h.selectedNetworks=[],e},h.deleteSelectedNetworks=function(e){var t=i.confirm().title("Are you sure want to delete the selected networks?").htmlContent("<b>"+h.selectedNetworks.length+" selected</b> will be deleted.").ariaLabel("delete Networks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){h.selectedNetworks.forEach(function(e){A(e)}),h.selectedNetworks=[]})},h.deselectNetworks=function(){h.selectedNetworks=[]},h.selectAllNetworks=function(){h.selectedNetworks=h.networks.rows};var f=!0,b=1;function E(e){h.networks=e||{count:0,rows:[]}}function A(e){d.network.delete({id:e.id}).$promise.then(function(){_.remove(h.networks.rows,{id:e.id}),h.networks.count-=1,h.networks.rows.length||h.getNetworks(),m.success({title:_.startCase("Network")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){h.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEnetwork"}];for(var t=0;t<e.data.errors.length;t++)m.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEnetwork",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){f?o(function(){f=!1}):(t||(b=h.query.page),e!==t&&(h.query.page=1),e||(h.query.page=b),h.getNetworks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","networks","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.settings").controller("NetworksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SETTINGS.EDIT_SMTP",g.smtp=angular.copy(l),g.smtps=r,g.newSmtp=!1,g.smtp||(g.smtp={service:!0},g.title="SETTINGS.NEW_SMTP",g.newSmtp=!0),g.addNewSmtp=function(){g.errors=[],d.mailAccount.save(g.smtp).$promise.then(function(e){g.smtps.unshift(e.toJSON()),o.success({title:"Smtp properly created",msg:g.smtp.name?g.smtp.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmtp=function(){g.errors=[],d.mailAccount.update({id:g.smtp.id},g.smtp).$promise.then(function(e){var t=_.find(g.smtps,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Smtp properly saved!",msg:g.smtp.name?g.smtp.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmtp=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smtp will be deleted.").ariaLabel("Delete Smtp").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.mailAccount.delete({id:g.smtp.id}).$promise.then(function(){_.remove(g.smtps,{id:g.smtp.id}),o.success({title:"Smtp properly deleted!",msg:(g.smtp.name||"smtp")+" has been deleted!"}),v(g.smtp)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.mailAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.mailAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smtps","smtp","api","Auth","license","setting","crudPermissions"],angular.module("app.settings").controller("CreateOrEditSmtpDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.currentUser=i.getCurrentUser(),s.license=a,s.smtps=e,s.smtp={},s.smtps&&s.smtps.rows&&s.smtps.rows.length?s.smtp=s.smtps.rows[0]:s.smtp={service:!0,Smtp:{service:null}},s.saveSmtp=function(){s.smtp.id?t.mailAccount.update({id:s.smtp.id},s.smtp).$promise.then(function(){n.success({title:"Smtp updated!",msg:s.smtp.name?s.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})}):t.mailAccount.save(s.smtp).$promise.then(function(e){_.merge(s.smtp,e),n.success({title:"Smtp updated!",msg:s.smtp.name?s.smtp.name+" has been updated!":""})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},s.verifySmtp=function(){s.smtp.id&&t.mailAccount.verifySmtp({id:s.smtp.id}).$promise.then(function(){n.success({title:"Smtp verified!",msg:s.smtp.name?s.smtp.name+" has been verified!":""})}).catch(function(e){n.error({title:"Smtp not verified! Remember to save before to verify!",msg:e.data?JSON.stringify(e.data):e.toString(),timeout:1e4})})}}e.$inject=["smtps","api","toasty","license","Auth"],angular.module("app.settings").controller("SmtpController",e)}(),function(){"use strict";function e(e,i,s,t,n,a,o,r){var l,d=this;d.system=n||{},d.processes=a?a.rows:[],d.processLimit=7,d.selectedTab=t.params.tab||0,d.getInfo=function(){return r.system.get().$promise.then(function(e){_.merge(d.system,e)}).catch(d.cancelInterval)},d.getProcesses=function(){return r.pm2.get().$promise.then(function(e){_.merge(d.processes,e?e.rows:[])}).catch(d.cancelInterval)},d.cancelInterval=function(e){i.cancel(l)},d.updateProcess=function(e,t,n){var a=s.confirm().title("Would you like to change the status of the process #"+t+"?").textContent("The status will be changed to: "+n.toUpperCase()).ariaLabel("Lucky day").targetEvent(e).ok("Ok").cancel("Cancel");s.show(a).then(function(){return r.pm2.update({id:t,status:n})}).then(function(){i(d.getProcesses,1e3,1)}).then(function(){o.success({title:"Process updated!",msg:"Status properly changed to: "+n})})},l=i(d.getInfo,5e3),e.$on("$destroy",function(){d.cancelInterval()})}e.$inject=["$scope","$interval","$mdDialog","$state","system","processes","toasty","api"],angular.module("app.settings.system").controller("SystemController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;s.title="SETTINGS.UPDATE",s.progress=0,s.updating=!0,s.output="Waiting...",s.success=!0,s.interval=t(function(){s.progress<90&&(s.progress+=1)},1e3),s.closeDialog=function(){e.hide()},s.reload=function(){n.location.reload()},s.stopInterval=function(){angular.isDefined(s.interval)&&(t.cancel(s.interval),s.interval=void 0);s.progress=100,s.updating=!1},i.version.fetch().$promise.then(function(e){return s.output=e.output+"...",i.version.reset().$promise}).then(function(e){return s.output=e.output+"...",i.version.pull().$promise}).then(function(e){return s.output=e.output+"...",i.version.migrations().$promise}).then(function(e){return s.output=e.output+"...",i.version.restart().$promise}).then(function(e){s.output="Waiting to restart motion...",a(function(){s.stopInterval()},3e4)}).catch(function(e){s.success=!1,s.stopInterval(),s.output=JSON.stringify(e)})}e.$inject=["$mdDialog","$interval","$window","$timeout","api"],angular.module("app.settings").controller("UpdateDialogController",e)}(),function(){"use strict";function e(n,e,a,t,i){this.version=t||{},this.updateConfirm=function(e){var t=n.confirm().title("Would you like to update your system?").htmlContent('The system request time for the update should be below 1 minute.<br><br>Do you agree the terms of this <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">End User License Agreement<a>?').ariaLabel("").targetEvent(e).clickOutsideToClose(!0).parent(angular.element(a.body)).ok("I agree").cancel("Disagree");n.show(t).then(function(){n.show({controller:"UpdateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/settings/views/updates/update/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!1})})}}e.$inject=["$mdDialog","$interval","$document","version","toasty"],angular.module("app.settings").controller("UpdatesController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"sms",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsSmsRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.smsQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].SmsQueueId].paused++,g.queues[e[t].rows[n].SmsQueueId].loggedInDb++,g.queues[e[t].rows[n].SmsQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].SmsQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"sms",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.smsQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="SmsQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditSmsQueue=function(e,t){a.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:g.queues?g.queues.rows:[],realtime:!1,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.smsQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onSaveMember=function(e){g.queues[e.SmsQueueId]&&g.queues[e.SmsQueueId].loggedInDb++},g.onRemoveMember=function(e){g.queues[e.SmsQueueId]&&g.queues[e.SmsQueueId].loggedInDb--},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.SmsQueueId]&&(g.queues[e.SmsQueueId].loggedInDb+=1,g.queues[e.SmsQueueId].agents[e.UserId]=e.SmsQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.SmsQueueId]&&0<g.queues[e.SmsQueueId].loggedInDb&&(g.queues[e.SmsQueueId].loggedInDb-=1,delete g.queues[e.SmsQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.on("sms_queue:save",g.onSave),d.on("userSmsQueue:save",g.onSaveMember),d.on("userSmsQueue:remove",g.onRemoveMember),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("sms_queue:save"),d.removeAllListeners("userSmsQueue:remove"),d.removeAllListeners("userSmsQueue:save"),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.sms").controller("QueuesSmsRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){switch(t.disconnect(),t.connect(),this.selectedTab=0,n.current.name){case"app.sms.realtime.agents":this.selectedTab=0;break;case"app.sms.realtime.queues":this.selectedTab=1;break;default:this.selectedTab=0,n.go("app.sms.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.sms.realtime.agents");break;case 1:n.go("app.sms.realtime.queues");break;default:n.go("app.sms.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.sms").controller("SmsRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSACCOUNT",g.smsAccount=angular.copy(l),g.smsAccounts=r,g.newSmsAccount=!1,g.smsAccount||(g.smsAccount={remote:n.protocol()+"://"+n.host()+(n.port()?":"+n.port():""),type:"twilio",waitForTheAssignedAgent:10,notificationSound:!0,queueTransferTimeout:300,agentTransferTimeout:300},g.title="SMS.NEW_SMSACCOUNT",g.newSmsAccount=!0),t.params.id&&(g.smsAccount.SmsAccountId=t.params.id),g.addNewSmsAccount=function(){g.errors=[],d.smsAccount.save(g.smsAccount).$promise.then(function(e){g.smsAccounts.unshift(e.toJSON()),o.success({title:"SmsAccount properly created",msg:g.smsAccount.name?g.smsAccount.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsAccount=function(){g.errors=[],d.smsAccount.update({id:g.smsAccount.id},g.smsAccount).$promise.then(function(e){var t=_.find(g.smsAccounts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsAccount properly saved!",msg:g.smsAccount.name?g.smsAccount.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsAccount=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsAccount will be deleted.").ariaLabel("Delete SmsAccount").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.smsAccount.delete({id:g.smsAccount.id}).$promise.then(function(){_.remove(g.smsAccounts,{id:g.smsAccount.id}),o.success({title:"SmsAccount properly deleted!",msg:(g.smsAccount.name||"smsAccount")+" has been deleted!"}),v(g.smsAccount)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsAccount.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.lists=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.lists,{id:e.resourceId})}),n=null;if(g.smsAccount&&(n=_.find(g.lists,{id:Number(g.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.lists,{id:n.id});a.canSelect=!1,t.push(a)}g.lists=t})}else{var n=[],a=null;g.smsAccount&&(a=_.find(g.lists,{id:Number(g.smsAccount.ListId)}));for(var i=0;i<g.lists.length;i++)a&&g.lists[i].id===a.id&&(g.lists[i].canSelect=!1,n.push(g.lists[i]));g.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsAccounts","smsAccount","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsAccountDialogController",e)}(),function(){"use strict";function e(o,i,a,s,e){var r=this;function t(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccountApp:n,smsAccount:r.smsAccount,crudPermissions:r.crudPermissions}}).then(function(e){e&&(e.id?r.smsAccountApps.rows[t]=e:r.smsAccountApps.rows.splice(t,0,e),l())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function l(){for(var e=1,t=[],n=0;n<r.smsAccountApps.rows.length;n++,0){var a=r.smsAccountApps.rows[n],i=[],s=[];a.intervals="*,*,*,*"!==a.interval?[a.interval]:a.IntervalId?_.map(_.filter(r.intervals.rows,{IntervalId:a.IntervalId}),"interval"):[],a.context=r.smsAccount.context,a.exten=r.smsAccount.exten,a.type&&(a.type=a.type.toLowerCase()),a.priority=i.length?_.last(i).priority+1:e,e=(s.length?_.last(s).priority:a.priority)+1,t=_.concat(t,i,[a],s)}o.smsAccount.addApplications({id:r.smsAccount.id},_.sortBy(t,"priority")).$promise.then(function(e){r.smsAccountApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){r.smsAccountApps=e||{count:0,rows:[]}}r.currentUser=e.getCurrentUser(),r.smsAccount={},r.smsAccountApps={count:0,rows:[]},r.selectedSmsAccountApps=[],r.crudPermissions,r.query={sort:"priority"},r.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"noop",appType:"noop",type:"noop",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,fields:[{title:"Value",name:"value",type:"text",param:0}]},{app:"system",appType:"system",type:"system",icon:"icon-apps",interval:"*,*,*,*",required:!0,isApp:!0,extraApi:[{name:"variables",field:{name:"variable",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1012}}],fields:[{title:"Command",name:"command",type:"text",required:!0,param:0},{title:"Variable",name:"variable",type:"apiselect",values:"variables",value:"variable.name",option:"variable.name",defaultValues:[{value:"''",option:"None"}],defaultValue:"''",param:1}]},{app:"gotop",appType:"gotop",type:"goto",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Priority",name:"priority",type:"number",required:!0,min:0,param:0}]},{app:"gotoif",appType:"gotoif",type:"gotoif",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Condition",name:"condition",type:"text",required:!0,param:0},{title:"truepriority",name:"truepriority",type:"number",min:1,required:!0,param:1},{title:"falsepriority",name:"falsepriority",type:"number",min:1,required:!0,param:2}]},{app:"queue",appType:"queue",foreignKey:"SmsQueueId",type:"queue",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"queues",field:{name:"queue",key:"name"},route:"smsQueue",filters:{fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:701}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",defaultValue:300,required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:300,param:1}]},{app:"agent",appType:"agent",type:"agent",foreignKey:"UserId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"agents",field:{name:"agent",key:"name"},route:"user",filters:{fields:"id,name",sort:"name",nolimit:!0,role:"agent"},permissions:{section:202}}],fields:[{title:"Agent",name:"agent",type:"apiselect",values:"agents",value:"agent.name",option:"agent.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",max:2147483,min:0,required:!0,defaultValue:30,param:1}]},{app:"autoreply",appType:"autoreply",type:"autoreply",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"times",name:"times",type:"select",defaultValue:"1",values:[{option:"One Time",value:"1"},{option:"Always",value:"0"}],required:!0,param:0},{title:"Text",name:"text",type:"textarea",maxlength:255,required:!0,param:1}]},{app:"close",appType:"close",type:"close",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Disposition",name:"disposition",type:"text",required:!0,param:0}]},{app:"tag",appType:"tag",type:"tag",foreignKey:"TagId",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Tag",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",required:!0,param:0}]}],["app"]),{isApp:!1}),r.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},r.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){l()}},r.init=function(e,t){r.smsAccount=e,r.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},r.applications.disabled=!r.crudPermissions.canEdit,r.query.id=e.id,r.query.isApp=!0,r.query.nolimit=!0,r.getSmsAccountApps(),r.getIntervals()},r.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){r.smsAccountApps.rows.splice(t,1),l()},function(){console.log("CANCEL")})},r.getSmsAccountApps=function(){r.promise=o.smsAccount.getApplications(r.query,n).$promise},r.editSmsAccountApp=t,r.editInterval=function(e,t){if(r.smsAccountApps.rows.length){var n=r.smsAccountApps.rows[t]?r.smsAccountApps.rows[t]:r.smsAccountApps.rows[0];i.show({controller:"EditSmsAccountAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:r.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,l())})}},r.deleteSmsAccountApp=function(e){_.remove(r.smsAccountApps.rows,{id:e.id}),l(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},r.deleteSelectedSmsAccountApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+r.selectedSmsAccountApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){r.selectedSmsAccountApps.forEach(function(e){_.remove(r.smsAccountApps.rows,{id:e.id})}),r.selectedSmsAccountApps=[],l()})},r.rewriteRouting=l,r.getIntervals=function(){return o.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){r.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.sms").controller("SmsAccountActionsController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsAccount.getAgents({id:c.smsAccount.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserSmsAccount?"penalty "+e.UserSmsAccount.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.smsAccount=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsAccount.removeAgents({id:c.smsAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsAccount.addAgents({id:c.smsAccount.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","smsAccount","smsAccounts","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsAccountagentaddController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.agent=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agent.appdata)switch(l.agent.appType?l.agent.appType.toLowerCase():l.agent.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agent.appdata.split(",");l.agent.key=d[0],l.agent.language=d[1],l.agent.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agent.appdata.split(",");l.agent.accesskeyid=d[0],l.agent.secretaccesskey=d[1],l.agent.lexregion=d[2],l.agent.botname=d[3],l.agent.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agent.appdata.split(",");l.agent.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agent.text=d.slice(1,d.length).join(",");break;case"message":l.agent.text=l.agent.appdata;break;case"set":l.agent.name=l.agent.appdata.split("=")[0],l.agent.value=l.agent.appdata.split("=")[1];break;case"agi":l.agent.project=l.agent.appdata;break;default:var c=l.agent.appdata.split(",");l.agent.agent=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.agent.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.agent.timeout=30;function m(e){t.hide(e)}l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outbounddial"===l.agent.appType.toLowerCase()&&(l.agent.prefix=l.agent.phone?l.agent.phone.split("$")[0]:void 0,l.agent.callerId=l.agent.callerID?"CALLERID(all)="+l.agent.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.agent.type&&"outbound"===l.agent.type.toLowerCase()&&"outboundDial"===l.agent.appType&&(l.agent.phone=i.cutdigits?(l.agent.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agent.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agent.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agent.options+="U(xcally-mixmonitor-context)"):l.agent.options=l.agent.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.agents,{name:l.agent.agent});t&&(l.agent.UserId=t.id);if(l.agent.appType&&"custom"===l.agent.appType);else switch((l.agent.app||l.agent.appType).toLowerCase()){case"set":l.agent.appdata=l.agent.name+"="+l.agent.value;break;case"custom":break;default:e[0]=l.agent.agent,e[1]=l.agent.timeout,l.agent.appdata=e.join(",")}m(l.agent)},l.closeDialog=m,o.hasRole("admin")?s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.user.get({fields:"id,name",sort:"name",nolimit:"true",role:"agent"}).$promise.then(function(e){l.agents=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:202}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.agents,{id:e.resourceId})}),n=null;if(l.agent&&(n=_.find(l.agents,{name:l.agent.agent})),n&&!_.some(t,["id",n.id])){var a=_.find(l.agents,{id:n.id});a.canSelect=!1,t.push(a)}l.agents=t})}else{var n=[],a=null;l.agent&&(a=_.find(l.agents,{name:l.agent.agent}));for(var i=0;i<l.agents.length;i++)a&&l.agents[i].id===a.id&&(l.agents[i].canSelect=!1,n.push(l.agents[i]));l.agents=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETagents",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppagentDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.autoreply=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.autoreply.appdata)switch(l.autoreply.appType?l.autoreply.appType.toLowerCase():l.autoreply.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.autoreply.appdata.split(",");l.autoreply.key=d[0],l.autoreply.language=d[1],l.autoreply.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.autoreply.appdata.split(",");l.autoreply.accesskeyid=d[0],l.autoreply.secretaccesskey=d[1],l.autoreply.lexregion=d[2],l.autoreply.botname=d[3],l.autoreply.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.autoreply.appdata.split(",");l.autoreply.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.autoreply.text=d.slice(1,d.length).join(",");break;case"message":l.autoreply.text=l.autoreply.appdata;break;case"set":l.autoreply.name=l.autoreply.appdata.split("=")[0],l.autoreply.value=l.autoreply.appdata.split("=")[1];break;case"agi":l.autoreply.project=l.autoreply.appdata;break;default:var c=l.autoreply.appdata.split(",");l.autoreply.times=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.autoreply.text=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.autoreply.times=1;function m(e){t.hide(e)}l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outbounddial"===l.autoreply.appType.toLowerCase()&&(l.autoreply.prefix=l.autoreply.phone?l.autoreply.phone.split("$")[0]:void 0,l.autoreply.callerId=l.autoreply.callerID?"CALLERID(all)="+l.autoreply.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.autoreply.type&&"outbound"===l.autoreply.type.toLowerCase()&&"outboundDial"===l.autoreply.appType&&(l.autoreply.phone=i.cutdigits?(l.autoreply.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.autoreply.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.autoreply.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.autoreply.options+="U(xcally-mixmonitor-context)"):l.autoreply.options=l.autoreply.options.replace("U(xcally-mixmonitor-context)",""));if(l.autoreply.appType&&"custom"===l.autoreply.appType);else switch((l.autoreply.app||l.autoreply.appType).toLowerCase()){case"set":l.autoreply.appdata=l.autoreply.name+"="+l.autoreply.value;break;case"custom":break;default:e[0]=l.autoreply.times,e[1]=l.autoreply.text,l.autoreply.appdata=e.join(",")}m(l.autoreply)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppautoreplyDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.close=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.close.appdata)switch(l.close.appType?l.close.appType.toLowerCase():l.close.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.close.appdata.split(",");l.close.key=d[0],l.close.language=d[1],l.close.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.close.appdata.split(",");l.close.accesskeyid=d[0],l.close.secretaccesskey=d[1],l.close.lexregion=d[2],l.close.botname=d[3],l.close.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.close.appdata.split(",");l.close.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.close.text=d.slice(1,d.length).join(",");break;case"message":l.close.text=l.close.appdata;break;case"set":l.close.name=l.close.appdata.split("=")[0],l.close.value=l.close.appdata.split("=")[1];break;case"agi":l.close.project=l.close.appdata;break;default:var c=l.close.appdata.split(",");l.close.disposition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outbounddial"===l.close.appType.toLowerCase()&&(l.close.prefix=l.close.phone?l.close.phone.split("$")[0]:void 0,l.close.callerId=l.close.callerID?"CALLERID(all)="+l.close.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.close.type&&"outbound"===l.close.type.toLowerCase()&&"outboundDial"===l.close.appType&&(l.close.phone=i.cutdigits?(l.close.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.close.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.close.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.close.options+="U(xcally-mixmonitor-context)"):l.close.options=l.close.options.replace("U(xcally-mixmonitor-context)",""));if(l.close.appType&&"custom"===l.close.appType);else switch((l.close.app||l.close.appType).toLowerCase()){case"set":l.close.appdata=l.close.name+"="+l.close.value;break;case"custom":break;default:e[0]=l.close.disposition,l.close.appdata=e.join(",")}m(l.close)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppcloseDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotoif=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotoif.appdata)switch(l.gotoif.appType?l.gotoif.appType.toLowerCase():l.gotoif.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotoif.appdata.split(",");l.gotoif.key=d[0],l.gotoif.language=d[1],l.gotoif.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotoif.appdata.split(",");l.gotoif.accesskeyid=d[0],l.gotoif.secretaccesskey=d[1],l.gotoif.lexregion=d[2],l.gotoif.botname=d[3],l.gotoif.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotoif.appdata.split(",");l.gotoif.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotoif.text=d.slice(1,d.length).join(",");break;case"message":l.gotoif.text=l.gotoif.appdata;break;case"set":l.gotoif.name=l.gotoif.appdata.split("=")[0],l.gotoif.value=l.gotoif.appdata.split("=")[1];break;case"agi":l.gotoif.project=l.gotoif.appdata;break;default:var c=l.gotoif.appdata.split(",");l.gotoif.condition=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.gotoif.truepriority=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.gotoif.falsepriority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outbounddial"===l.gotoif.appType.toLowerCase()&&(l.gotoif.prefix=l.gotoif.phone?l.gotoif.phone.split("$")[0]:void 0,l.gotoif.callerId=l.gotoif.callerID?"CALLERID(all)="+l.gotoif.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotoif.type&&"outbound"===l.gotoif.type.toLowerCase()&&"outboundDial"===l.gotoif.appType&&(l.gotoif.phone=i.cutdigits?(l.gotoif.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotoif.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotoif.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotoif.options+="U(xcally-mixmonitor-context)"):l.gotoif.options=l.gotoif.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotoif.appType&&"custom"===l.gotoif.appType);else switch((l.gotoif.app||l.gotoif.appType).toLowerCase()){case"set":l.gotoif.appdata=l.gotoif.name+"="+l.gotoif.value;break;case"custom":break;default:e[0]=l.gotoif.condition,e[1]=l.gotoif.truepriority,e[2]=l.gotoif.falsepriority,l.gotoif.appdata=e.join(",")}m(l.gotoif)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotoifDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.gotop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.gotop.appdata)switch(l.gotop.appType?l.gotop.appType.toLowerCase():l.gotop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.gotop.appdata.split(",");l.gotop.key=d[0],l.gotop.language=d[1],l.gotop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.gotop.appdata.split(",");l.gotop.accesskeyid=d[0],l.gotop.secretaccesskey=d[1],l.gotop.lexregion=d[2],l.gotop.botname=d[3],l.gotop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.gotop.appdata.split(",");l.gotop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.gotop.text=d.slice(1,d.length).join(",");break;case"message":l.gotop.text=l.gotop.appdata;break;case"set":l.gotop.name=l.gotop.appdata.split("=")[0],l.gotop.value=l.gotop.appdata.split("=")[1];break;case"agi":l.gotop.project=l.gotop.appdata;break;default:var c=l.gotop.appdata.split(",");l.gotop.priority=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outbounddial"===l.gotop.appType.toLowerCase()&&(l.gotop.prefix=l.gotop.phone?l.gotop.phone.split("$")[0]:void 0,l.gotop.callerId=l.gotop.callerID?"CALLERID(all)="+l.gotop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.gotop.type&&"outbound"===l.gotop.type.toLowerCase()&&"outboundDial"===l.gotop.appType&&(l.gotop.phone=i.cutdigits?(l.gotop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.gotop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.gotop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.gotop.options+="U(xcally-mixmonitor-context)"):l.gotop.options=l.gotop.options.replace("U(xcally-mixmonitor-context)",""));if(l.gotop.appType&&"custom"===l.gotop.appType);else switch((l.gotop.app||l.gotop.appType).toLowerCase()){case"set":l.gotop.appdata=l.gotop.name+"="+l.gotop.value;break;case"custom":break;default:e[0]=l.gotop.priority,l.gotop.appdata=e.join(",")}m(l.gotop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppgotopDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditSmsAccountAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.noop=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.noop.appdata)switch(l.noop.appType?l.noop.appType.toLowerCase():l.noop.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.noop.appdata.split(",");l.noop.key=d[0],l.noop.language=d[1],l.noop.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.noop.appdata.split(",");l.noop.accesskeyid=d[0],l.noop.secretaccesskey=d[1],l.noop.lexregion=d[2],l.noop.botname=d[3],l.noop.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.noop.appdata.split(",");l.noop.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.noop.text=d.slice(1,d.length).join(",");break;case"message":l.noop.text=l.noop.appdata;break;case"set":l.noop.name=l.noop.appdata.split("=")[0],l.noop.value=l.noop.appdata.split("=")[1];break;case"agi":l.noop.project=l.noop.appdata;break;default:var c=l.noop.appdata.split(",");l.noop.value=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outbounddial"===l.noop.appType.toLowerCase()&&(l.noop.prefix=l.noop.phone?l.noop.phone.split("$")[0]:void 0,l.noop.callerId=l.noop.callerID?"CALLERID(all)="+l.noop.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.noop.type&&"outbound"===l.noop.type.toLowerCase()&&"outboundDial"===l.noop.appType&&(l.noop.phone=i.cutdigits?(l.noop.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.noop.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.noop.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.noop.options+="U(xcally-mixmonitor-context)"):l.noop.options=l.noop.options.replace("U(xcally-mixmonitor-context)",""));if(l.noop.appType&&"custom"===l.noop.appType);else switch((l.noop.app||l.noop.appType).toLowerCase()){case"set":l.noop.appdata=l.noop.name+"="+l.noop.value;break;case"custom":break;default:e[0]=l.noop.value,l.noop.appdata=e.join(",")}m(l.noop)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppnoopDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.queue.queue=300,l.queue.timeout=300;function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.queues,{name:l.queue.queue});t&&(l.queue[_.capitalize("sms")+"QueueId"]=t.id);if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.timeout,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.smsQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppqueueDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.system=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.system.appdata)switch(l.system.appType?l.system.appType.toLowerCase():l.system.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.system.appdata.split(",");l.system.key=d[0],l.system.language=d[1],l.system.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.system.appdata.split(",");l.system.accesskeyid=d[0],l.system.secretaccesskey=d[1],l.system.lexregion=d[2],l.system.botname=d[3],l.system.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.system.appdata.split(",");l.system.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.system.text=d.slice(1,d.length).join(",");break;case"message":l.system.text=l.system.appdata;break;case"set":l.system.name=l.system.appdata.split("=")[0],l.system.value=l.system.appdata.split("=")[1];break;case"agi":l.system.project=l.system.appdata;break;default:var c=l.system.appdata.split(",");l.system.command=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.system.variable=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}else l.system.variable="";function m(e){t.hide(e)}l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outbounddial"===l.system.appType.toLowerCase()&&(l.system.prefix=l.system.phone?l.system.phone.split("$")[0]:void 0,l.system.callerId=l.system.callerID?"CALLERID(all)="+l.system.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.system.type&&"outbound"===l.system.type.toLowerCase()&&"outboundDial"===l.system.appType&&(l.system.phone=i.cutdigits?(l.system.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.system.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.system.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.system.options+="U(xcally-mixmonitor-context)"):l.system.options=l.system.options.replace("U(xcally-mixmonitor-context)",""));if(l.system.appType&&"custom"===l.system.appType);else switch((l.system.app||l.system.appType).toLowerCase()){case"set":l.system.appdata=l.system.name+"="+l.system.value;break;case"custom":break;default:e[0]=l.system.command,e[1]=l.system.variable,l.system.appdata=e.join(",")}m(l.system)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.system&&(n=_.find(l.variables,{name:l.system.variable})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.system&&(a=_.find(l.variables,{name:l.system.variable}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountAppsystemDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="SMS.EDIT_"+(a.appType||a.app).toUpperCase(),l.tag=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.tag.appdata)switch(l.tag.appType?l.tag.appType.toLowerCase():l.tag.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.tag.appdata.split(",");l.tag.key=d[0],l.tag.language=d[1],l.tag.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.tag.appdata.split(",");l.tag.accesskeyid=d[0],l.tag.secretaccesskey=d[1],l.tag.lexregion=d[2],l.tag.botname=d[3],l.tag.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.tag.appdata.split(",");l.tag.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.tag.text=d.slice(1,d.length).join(",");break;case"message":l.tag.text=l.tag.appdata;break;case"set":l.tag.name=l.tag.appdata.split("=")[0],l.tag.value=l.tag.appdata.split("=")[1];break;case"agi":l.tag.project=l.tag.appdata;break;default:var c=l.tag.appdata.split(",");l.tag.tag=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outbounddial"===l.tag.appType.toLowerCase()&&(l.tag.prefix=l.tag.phone?l.tag.phone.split("$")[0]:void 0,l.tag.callerId=l.tag.callerID?"CALLERID(all)="+l.tag.callerID:void 0),l.saveSmsAccountApp=function(){l.errors=[];var e=[];l.tag.type&&"outbound"===l.tag.type.toLowerCase()&&"outboundDial"===l.tag.appType&&(l.tag.phone=i.cutdigits?(l.tag.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.tag.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.tag.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.tag.options+="U(xcally-mixmonitor-context)"):l.tag.options=l.tag.options.replace("U(xcally-mixmonitor-context)",""));var t=_.find(l.tags,{name:l.tag.tag});t&&(l.tag.TagId=t.id);if(l.tag.appType&&"custom"===l.tag.appType);else switch((l.tag.app||l.tag.appType).toLowerCase()){case"set":l.tag.appdata=l.tag.name+"="+l.tag.value;break;case"custom":break;default:e[0]=l.tag.tag,l.tag.appdata=e.join(",")}m(l.tag)},l.closeDialog=m,o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.tag&&(n=_.find(l.tags,{name:l.tag.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.tag&&(a=_.find(l.tags,{name:l.tag.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","smsAccountApp","smsAccount","api","Auth","crudPermissions"],angular.module("app.sms").controller("EditSmsAccountApptagDialogController",e)}(),function(){"use strict";function e(e,a,t,n,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountInteractions={count:0,rows:[]},c.selectedSmsAccountInteractions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,Contact.firstName,Owner.name,closedAt,disposition,note,UserId,ContactId,SmsAccountId,tag",sort:"-createdAt",includeAll:"true",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.getSmsAccountInteractions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interaction?").htmlContent("<b>"+(e.name||"interaction")+"</b> will be deleted.").ariaLabel("delete interaction").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.smsInteractionDownload=function(s,e,t){return l.smsInteraction.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="interaction"+s.id,a=new Blob(t,{type:e.type});n="sms-interaction"+s.id+".zip";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsAccount.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getSmsAccountInteractions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getInteractions(c.query,p).$promise},c.createOrEditSmsAccountInteraction=function(e,t){s.show({controller:"CreateOrEditInteractionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/interactions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,interaction:t,interactions:c.smsAccountInteractions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.spysmsInteraction=function(e,n){s.show({controller:"AgentGeneralInteractionController",controllerAs:"vm",templateUrl:"app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,onShowing:function(e,t){e.vm.init({id:1,channel:"sms",interaction:n,spy:!0},a.$parent.vm.setting)}})},c.exportSelectedSmsAccountInteractions=function(){var e=angular.copy(c.selectedSmsAccountInteractions);return c.selectedSmsAccountInteractions=[],e},c.deleteSmsAccountInteraction=g,c.deleteSelectedSmsAccountInteractions=function(e){var t=s.confirm().title("Are you sure want to delete the selected interactions?").htmlContent("<b>"+c.selectedSmsAccountInteractions.length+" selected</b> will be deleted.").ariaLabel("delete interactions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountInteractions.forEach(function(e){g(e)}),c.selectedSmsAccountInteractions=[]})};var m=!0,u=1;function p(e){c.smsAccountInteractions=e||{count:0,rows:[]}}function g(e){l.smsInteraction.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountInteractions.rows,{id:e.id}),c.smsAccountInteractions.count-=1,c.smsAccountInteractions.rows.length||c.getSmsAccountInteractions(),r.success({title:"Interaction deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}a.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountInteractions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountInteractionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsCannedAnswers={count:0,rows:[]},c.selectedSmsAccountSmsCannedAnswers=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,key,value,description",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsCannedAnswers()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the smsCannedAnswer?").htmlContent("<b>"+(e.name||"smsCannedAnswer")+"</b> will be deleted.").ariaLabel("delete smsCannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsCannedAnswers=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getAnswers(c.query,p).$promise},c.createOrEditSmsAccountSmsCannedAnswer=function(e,t){s.show({controller:"CreateOrEditSmsCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsCannedAnswer:t,smsCannedAnswers:c.smsAccountSmsCannedAnswers.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedSmsAccountSmsCannedAnswers=function(){var e=angular.copy(c.selectedSmsAccountSmsCannedAnswers);return c.selectedSmsAccountSmsCannedAnswers=[],e},c.deleteSmsAccountSmsCannedAnswer=g,c.deleteSelectedSmsAccountSmsCannedAnswers=function(e){var t=s.confirm().title("Are you sure want to delete the selected smsCannedAnswers?").htmlContent("<b>"+c.selectedSmsAccountSmsCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete smsCannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountSmsCannedAnswers.forEach(function(e){g(e)}),c.selectedSmsAccountSmsCannedAnswers=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsCannedAnswers=e||{count:0,rows:[]}}function g(e){l.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsCannedAnswers.rows,{id:e.id}),c.smsAccountSmsCannedAnswers.count-=1,c.smsAccountSmsCannedAnswers.rows.length||c.getSmsAccountSmsCannedAnswers(),r.success({title:"SmsCannedAnswer deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsCannedAnswers())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsCannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSCANNEDANSWER",g.smsCannedAnswer=angular.copy(l),g.smsCannedAnswers=r,g.newSmsCannedAnswer=!1,g.smsCannedAnswer||(g.smsCannedAnswer={},g.title="SMS.NEW_SMSCANNEDANSWER",g.newSmsCannedAnswer=!0),t.params.id&&(g.smsCannedAnswer.SmsAccountId=t.params.id),g.addNewSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.smsCannedAnswer).$promise.then(function(e){g.smsCannedAnswers.unshift(e.toJSON()),o.success({title:"SmsCannedAnswer properly created",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.smsCannedAnswer.id},g.smsCannedAnswer).$promise.then(function(e){var t=_.find(g.smsCannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsCannedAnswer properly saved!",msg:g.smsCannedAnswer.name?g.smsCannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsCannedAnswer will be deleted.").ariaLabel("Delete SmsCannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.smsCannedAnswer.id}).$promise.then(function(){_.remove(g.smsCannedAnswers,{id:g.smsCannedAnswer.id}),o.success({title:"SmsCannedAnswer properly deleted!",msg:(g.smsCannedAnswer.name||"smsCannedAnswer")+" has been deleted!"}),v(g.smsCannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsCannedAnswers","smsCannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.smsAccount={},c.smsAccountSmsDispositions={count:0,rows:[]},c.selectedSmsAccountSmsDispositions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,name",limit:10,page:1},c.init=function(e,t){c.smsAccount=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.smsAccount.id,c.query.SmsAccountId=c.smsAccount.id,c.getSmsAccountSmsDispositions()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the smsDisposition?").htmlContent("<b>"+(e.name||"smsDisposition")+"</b> will be deleted.").ariaLabel("delete smsDisposition").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getSmsAccountSmsDispositions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.smsAccount.getDispositions(c.query,p).$promise},c.createOrEditSmsAccountSmsDisposition=function(e,t){s.show({controller:"CreateOrEditSmsDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:c.smsAccount,smsDisposition:t,smsDispositions:c.smsAccountSmsDispositions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedSmsAccountSmsDispositions=function(){var e=angular.copy(c.selectedSmsAccountSmsDispositions);return c.selectedSmsAccountSmsDispositions=[],e},c.deleteSmsAccountSmsDisposition=g,c.deleteSelectedSmsAccountSmsDispositions=function(e){var t=s.confirm().title("Are you sure want to delete the selected smsDispositions?").htmlContent("<b>"+c.selectedSmsAccountSmsDispositions.length+" selected</b> will be deleted.").ariaLabel("delete smsDispositions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedSmsAccountSmsDispositions.forEach(function(e){g(e)}),c.selectedSmsAccountSmsDispositions=[]})};var m=!0,u=1;function p(e){c.smsAccountSmsDispositions=e||{count:0,rows:[]}}function g(e){l.disposition.delete({id:e.id}).$promise.then(function(){_.remove(c.smsAccountSmsDispositions.rows,{id:e.id}),c.smsAccountSmsDispositions.count-=1,c.smsAccountSmsDispositions.rows.length||c.getSmsAccountSmsDispositions(),r.success({title:"SmsDisposition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getSmsAccountSmsDispositions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.sms").controller("SmsAccountSmsDispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSDISPOSITION",g.smsDisposition=angular.copy(l),g.smsDispositions=r,g.newSmsDisposition=!1,g.smsDisposition||(g.smsDisposition={},g.title="SMS.NEW_SMSDISPOSITION",g.newSmsDisposition=!0),t.params.id&&(g.smsDisposition.SmsAccountId=t.params.id),g.addNewSmsDisposition=function(){g.errors=[],d.disposition.save(g.smsDisposition).$promise.then(function(e){g.smsDispositions.unshift(e.toJSON()),o.success({title:"SmsDisposition properly created",msg:g.smsDisposition.name?g.smsDisposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsDisposition=function(){g.errors=[],d.disposition.update({id:g.smsDisposition.id},g.smsDisposition).$promise.then(function(e){var t=_.find(g.smsDispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsDisposition properly saved!",msg:g.smsDisposition.name?g.smsDisposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsDisposition will be deleted.").ariaLabel("Delete SmsDisposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.smsDisposition.id}).$promise.then(function(){_.remove(g.smsDispositions,{id:g.smsDisposition.id}),o.success({title:"SmsDisposition properly deleted!",msg:(g.smsDisposition.name||"smsDisposition")+" has been deleted!"}),v(g.smsDisposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsDispositions","smsDisposition","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.smsAccount=c||e.params.smsAccount||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.agentadddialog=function(e,t){n.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:u.smsAccounts?u.smsAccounts.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsAccounts=function(){e.go("app.sms.smsAccounts")},u.saveSmsAccount=function(){r.smsAccount.update({id:u.smsAccount.id},u.smsAccount).$promise.then(function(){l.success({title:"SmsAccount updated!",msg:u.smsAccount.name?u.smsAccount.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccount",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.lists=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.lists,{id:e.resourceId})}),n=null;if(u.smsAccount&&(n=_.find(u.lists,{id:Number(u.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(u.lists,{id:n.id});a.canSelect=!1,t.push(a)}u.lists=t})}else{var n=[],a=null;u.smsAccount&&(a=_.find(u.lists,{id:Number(u.smsAccount.ListId)}));for(var i=0;i<u.lists.length;i++)a&&u.lists[i].id===a.id&&(u.lists[i].canSelect=!1,n.push(u.lists[i]));u.lists=n}}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsAccount","userProfileSection"],angular.module("app.sms").controller("SmsAccountController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.smsAccounts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="smsAccounts",b.listOrder="",b.listOrderAsc=null,b.selectedSmsAccounts=[],b.query={fields:"createdAt,updatedAt,id,name,key,token,remote,ListId,type,phone,accountSid,authId,authToken,smsMethod,username,password,baseUrl,apiKey,senderString,deliveryReport,waitForTheAssignedAgent,mandatoryDisposition,mandatoryDispositionPauseId,description,receiveUrl,deliveryReportUrl,notificationSound,notificationShake,notificationTemplate,queueTransfer,queueTransferTimeout,agentTransfer,agentTransferTimeout",sort:"-updatedAt",limit:10,page:1},b.arraytype=_.keyBy([{option:"Twilio",value:"'twilio'"},{option:"Skebby",value:"'skebby'"},{option:"Connectel",value:"'connectel'"},{option:"ClickSend",value:"'clicksend'"},{option:"Plivo",value:"'plivo'"},{option:"Infobip",value:"'infobip'"},{option:"Clickatell",value:"'clickatell'"},{option:"CSCTelecom",value:"'csc'"},{option:"Intelepeer",value:"'intelepeer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysmsMethod=_.keyBy([{option:"Basic",value:"'SI'"},{option:"Classic",value:"'TI'"},{option:"Classic+",value:"'GP'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,smsAccount:e,crudPermissions:b.crudPermissions})},b.interactionsgoto=function(e,t){n.go("app.sms.smsAccounts.edit",{id:e.id,tab:5})},b.agentadddialog=function(e,t){i.show({controller:"SmsAccountagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsAccount:e,smsAccounts:b.smsAccounts?b.smsAccounts.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("smsAccount")+"?").htmlContent("<b>"+(e.name||"smsAccount")+"</b> will be deleted.").ariaLabel("delete smsAccount").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSmsAccounts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.smsAccount.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SmsAccounts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSmsAccount=function(e,t){i.show({controller:"CreateOrEditSmsAccountDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsAccounts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsAccount:t,smsAccounts:b.smsAccounts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSmsAccount=S,b.exportSelectedSmsAccounts=function(){var e=angular.copy(b.selectedSmsAccounts);return b.selectedSmsAccounts=[],e},b.deleteSelectedSmsAccounts=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsAccounts?").htmlContent("<b>"+b.selectedSmsAccounts.length+" selected</b> will be deleted.").ariaLabel("delete SmsAccounts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSmsAccounts.forEach(function(e){S(e)}),b.selectedSmsAccounts=[]})},b.deselectSmsAccounts=function(){b.selectedSmsAccounts=[]},b.selectAllSmsAccounts=function(){b.selectedSmsAccounts=b.smsAccounts.rows},g.hasRole("admin")?m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.cmList.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.lists=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.lists,{id:e.resourceId})}),n=null;if(b.smsAccount&&(n=_.find(b.lists,{id:Number(b.smsAccount.ListId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.lists,{id:n.id});a.canSelect=!1,t.push(a)}b.lists=t})}else{var n=[],a=null;b.smsAccount&&(a=_.find(b.lists,{id:Number(b.smsAccount.ListId)}));for(var i=0;i<b.lists.length;i++)a&&b.lists[i].id===a.id&&(b.lists[i].canSelect=!1,n.push(b.lists[i]));b.lists=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.smsAccounts=e||{count:0,rows:[]}}function S(e){m.smsAccount.delete({id:e.id}).$promise.then(function(){_.remove(b.smsAccounts.rows,{id:e.id}),b.smsAccounts.count-=1,b.smsAccounts.rows.length||b.getSmsAccounts(),p.success({title:_.startCase("SmsAccount")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsAccount"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsAccount",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSmsAccounts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsAccounts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsAccountsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="SMS.EDIT_SMSQUEUE",g.smsQueue=angular.copy(l),g.smsQueues=r,g.newSmsQueue=!1,g.smsQueue||(g.smsQueue={strategy:"beepall",timeout:10},g.title="SMS.NEW_SMSQUEUE",g.newSmsQueue=!0),g.addNewSmsQueue=function(){g.errors=[],d.smsQueue.save(g.smsQueue).$promise.then(function(e){g.smsQueues.unshift(e.toJSON()),o.success({title:"SmsQueue properly created",msg:g.smsQueue.name?g.smsQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSmsQueue=function(){g.errors=[],d.smsQueue.update({id:g.smsQueue.id},g.smsQueue).$promise.then(function(e){var t=_.find(g.smsQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"SmsQueue properly saved!",msg:g.smsQueue.name?g.smsQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSmsQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The smsQueue will be deleted.").ariaLabel("Delete SmsQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.smsQueue.delete({id:g.smsQueue.id}).$promise.then(function(){_.remove(g.smsQueues,{id:g.smsQueue.id}),o.success({title:"SmsQueue properly deleted!",msg:(g.smsQueue.name||"smsQueue")+" has been deleted!"}),v(g.smsQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.smsQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.smsQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","smsQueues","smsQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.sms").controller("CreateOrEditSmsQueueDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsQueue.getAgents({id:c.smsQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserSmsQueue?"penalty "+e.UserSmsQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.smsQueue=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.removeAgents({id:c.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.addAgents({id:c.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("SMS.ALL_AGENTS"),labelSelected:r.instant("SMS.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","smsQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueagentaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.smsQueue.getTeams({id:l.smsQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.smsQueue=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("SMS.ALL_TEAMS"),labelSelected:n.instant("SMS.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.removeTeams({id:l.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.smsQueue.addTeams({id:l.smsQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","smsQueue","$translate","Auth","crudPermissions"],angular.module("app.sms").controller("SmsQueueteamaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.smsQueue=c||e.params.smsQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.teamadddialog=function(e,t){n.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){n.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:u.smsQueues?u.smsQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.alert=l.info,u.gotoSmsQueues=function(){e.go("app.sms.smsQueues")},u.saveSmsQueue=function(){r.smsQueue.update({id:u.smsQueue.id},u.smsQueue).$promise.then(function(){l.success({title:"SmsQueue updated!",msg:u.smsQueue.name?u.smsQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","smsQueue","userProfileSection"],angular.module("app.sms").controller("SmsQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.smsQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="smsQueues",b.listOrder="",b.listOrderAsc=null,b.selectedSmsQueues=[],b.query={fields:"createdAt,updatedAt,id,name,strategy,timeout,description",sort:"-updatedAt",channel:"sms",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Beepall",value:"'beepall'"},{option:"RR Memory",value:"'rrmemory'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.sms.smsQueues.edit",{id:e.id,smsQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"SmsQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:b.smsQueues?b.smsQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"SmsQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{smsQueue:e,smsQueues:b.smsQueues?b.smsQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("smsQueue")+"?").htmlContent("<b>"+(e.name||"smsQueue")+"</b> will be deleted.").ariaLabel("delete smsQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:710}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.sms.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.sms.realtime.queues",{})}},b.success=y,b.getSmsQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.smsQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="SmsQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSmsQueue=function(e,t){i.show({controller:"CreateOrEditSmsQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/sms/views/smsQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{smsQueue:t,smsQueues:b.smsQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSmsQueue=S,b.exportSelectedSmsQueues=function(){var e=angular.copy(b.selectedSmsQueues);return b.selectedSmsQueues=[],e},b.deleteSelectedSmsQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected smsQueues?").htmlContent("<b>"+b.selectedSmsQueues.length+" selected</b> will be deleted.").ariaLabel("delete SmsQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSmsQueues.forEach(function(e){S(e)}),b.selectedSmsQueues=[]})},b.deselectSmsQueues=function(){b.selectedSmsQueues=[]},b.selectAllSmsQueues=function(){b.selectedSmsQueues=b.smsQueues.rows};var E=!0,A=1;function y(e){b.smsQueues=e||{count:0,rows:[]}}function S(e){m.smsQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.smsQueues.rows,{id:e.id}),b.smsQueues.count-=1,b.smsQueues.rows.length||b.getSmsQueues(),p.success({title:_.startCase("SmsQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsmsQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsmsQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSmsQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","smsQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.sms").controller("SmsQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.agents=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="agents",b.listOrder="",b.listOrderAsc=null,b.selectedAgents=[],b.query={fields:"createdAt,updatedAt,id,role,fullname,name,alias,showWebBar,email,phone,mobile,userpic,password,hotdesk,autointernal,internal,loginInPause,description,dtlscertfile,dtlsprivatekey,voicemail,transport,host,nat,type,allow,callerid,context,callgroup,pickupgroup,chanspy,videosupport,extensionMonitor,chatCapacity,mailCapacity,faxCapacity,smsCapacity,openchannelCapacity,phoneBarEnableSettings,phoneBarAutoAnswer,phoneBarAutoAnswerDelay,phoneBarRingInUse,phoneBarEnableRecording,phoneBarEnableDtmfTone,phoneBarDnd,phoneBarUnansweredCallBadge,phoneBarEnableJaws,phoneBarOutboundProxy,phoneBarUnconditional,phoneBarUnconditionalNumber,phoneBarRemoteControl,phoneBarRemoteControlPort,phoneBarExpires,phoneBarListenPort,permissions,allowmessenger,phoneBarPrefixRequired,passwordResetAt,phoneBarEnableVideoRecording",role:"agent",sort:"-updatedAt",limit:10,page:1},b.arrayshowWebBar=_.keyBy([{option:"Phonebar",value:"0"},{option:"External",value:"1"},{option:"WebRTC",value:"2"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'",ngIf:"vm.agent.showWebBar == 1"},{option:"wss",value:"'wss'",ngIf:"vm.agent.showWebBar == 1"},{option:"tls",value:"'tls'",ngIf:"vm.agent.showWebBar == 1"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayextensionMonitor=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.agents.edit",{id:e.id,agent:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:b.agents?b.agents.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("agent")+"?").htmlContent("<b>"+(e.name||"agent")+"</b> will be deleted.").ariaLabel("delete agent").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getAgents=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Agents",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditAgent=function(e,t){i.show({controller:"CreateOrEditAgentDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{agent:t,agents:b.agents.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteAgent=S,b.exportSelectedAgents=function(){var e=angular.copy(b.selectedAgents);return b.selectedAgents=[],e},b.deleteSelectedAgents=function(e){var t=i.confirm().title("Are you sure want to delete the selected agents?").htmlContent("<b>"+b.selectedAgents.length+" selected</b> will be deleted.").ariaLabel("delete Agents").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedAgents.forEach(function(e){S(e)}),b.selectedAgents=[]})},b.deselectAgents=function(){b.selectedAgents=[]},b.selectAllAgents=function(){b.selectedAgents=b.agents.rows};var E=!0,A=1;function y(e){b.agents=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.agents.rows,{id:e.id}),b.agents.count-=1,b.agents.rows.length||b.getAgents(),p.success({title:_.startCase("Agent")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getAgents())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","agents","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("AgentsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_AGENT",g.agent=angular.copy(l),g.agents=r,g.newAgent=!1,g.agent||(g.agent={role:"agent",showWebBar:"0",autointernal:!0,type:"friend",context:"from-sip",phoneBarRemoteControl:!0,phoneBarRemoteControlPort:9888,allowmessenger:!0},g.title="STAFF.NEW_AGENT",g.newAgent=!0),g.addNewAgent=function(){g.errors=[],d.user.save(g.agent).$promise.then(function(e){g.agents.unshift(e.toJSON()),o.success({title:"Agent properly created",msg:g.agent.name?g.agent.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveAgent=function(){g.errors=[],d.user.update({id:g.agent.id},g.agent).$promise.then(function(e){var t=_.find(g.agents,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Agent properly saved!",msg:g.agent.name?g.agent.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteAgent=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The agent will be deleted.").ariaLabel("Delete Agent").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.agent.id}).$promise.then(function(){_.remove(g.agents,{id:g.agent.id}),o.success({title:"Agent properly deleted!",msg:(g.agent.name||"agent")+" has been deleted!"}),v(g.agent)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","agents","agent","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditAgentDialogController",e)}(),function(){"use strict";function e(e,a){var i=this;i.agent={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.agent.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.agent.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.agent=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.agent.id+"/avatar",i.agent.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Agentchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.agent=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.agent.id,newPassword:o.password};o.currentUser.id==o.agent.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"Agent password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.agent.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.agent.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","agent","setting","Auth"],angular.module("app.staff").controller("AgentchangepasswordController",e)}(),function(){"use strict";function e(e,t,i,n,s){var o=this;o.agent={},o.navigation=n.getNavigation(),o.crudPermissions,o.init=function(e,t){o.agent=e,o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1}},o.onChange=function(t,n){if((n||t).enabled){if(n)n.enabled=!0,o.agent.permissions.push(n.id);else for(var e=0;e<t.children.length;e++)t.children[e].enabled=!0,o.agent.permissions.push(t.children[e].id);t.enabled=!0,o.agent.permissions.push(t.id)}else if(n)n.enabled=!1,_.remove(o.agent.permissions,function(e){return n.id===e}),_.filter(t.children,{enabled:!1}).length===t.children.length&&(t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e}));else{t.enabled=!1,_.remove(o.agent.permissions,function(e){return t.id===e});for(var a=0;a<t.children.length;a++)t.children[a].enabled=!1,_.remove(o.agent.permissions,function(e){return t.children[a].id===e})}return i.user.update({id:o.agent.id,permissions:_.uniq(o.agent.permissions)}).$promise.then(function(){s.success({title:"agent updated!",msg:o.agent.name?o.agent.name+" has been updated!":""})}).catch(function(e){console.error(e)})}}e.$inject=["$document","$mdDialog","api","msNavigationAgentService","toasty"],angular.module("app.staff").controller("AgentPermissionsController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d[c.apiName].get({fields:"id,name,strategy,type",channel:"bull"===c.channel?"voice":c.channel,type:c.direction,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.user.getQueues({id:c.agent.id,fields:"id,name,strategy,type,penalty",nolimit:!0,type:c.direction,channel:c.channel}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return"voice"===c.channel&&(t.penalty=void 0!==t&&void 0!==e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"penalty 0"),t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.agent=t,c.crudPermissions=r,c.penalty=0,c.channel=n,c.direction=i,c.apiName=c.channel+"Queue",c.title=s.instant("STAFF.QUEUEADD_AGENT_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"type",line3:"voice"===c.channel?"penalty":"",labelAll:s.instant("STAFF.ALL_QUEUES_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),labelSelected:s.instant("STAFF.SELECTED_QUEUES_"+c.channel.toUpperCase()+"_"+c.direction.toUpperCase()),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}},c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){var e;switch(c.channel){case"voice":switch(c.direction){case"inbound":e="VoiceQueues";break;case"outbound":e="QueueCampaigns"}break;case"chat":e="ChatQueues";break;case"mail":e="MailQueues";break;case"sms":e="SmsQueues";break;case"openchannel":e="OpenchannelQueues";break;case"fax":e="FaxQueues"}d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:e}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveQueues=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.user.removeQueues({id:c.agent.id,ids:_.map(n,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else if("voice"===c.channel){for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.user.addQueues({id:c.agent.id,ids:_.map(o,"id"),channel:c.channel,penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}else d.user.addQueues({id:c.agent.id,ids:_.map(r,"id"),channel:c.channel}).$promise.then(function(){e()}).catch(function(e){t(e)})});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Queues association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:QUEUES_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","channel","direction","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentqueueaddController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r){var l=this;function d(){return a(function(n,t){return a(function(t,n){return s.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return l.items=e.rows?e.rows:[],o.hasRole("admin")?e:l.section?l.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:l.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return l.allowedItems=_.map(t,function(e){return _.find(l.items,{id:o.hasRole("admin")||l.section.autoAssociation?e.id:e.resourceId})}),l.startingAllowedItems=angular.copy(l.allowedItems),l.items.forEach(function(e){var t=_.find(l.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.user.getTeams({id:l.agent.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];l.selectedItems=_.map(t,function(e){return _.find(l.items,{id:e.id})}),l.startingSelectedItems=angular.copy(l.selectedItems),l.dualMultiselectOptions.selectedItems=l.selectedItems,l.dualMultiselectOptions.items=_.differenceBy(l.allowedItems,l.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}l.currentUser=o.getCurrentUser(),l.agent=t,l.crudPermissions=r,l.items=[],l.allowedItems=[],l.selectedItems=[],l.startingAllowedItems=[],l.startingSelectedItems=[],l.pendingChanges=!1,l.dualMultiselectOptions={readOnly:!l.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("STAFF.ALL_TEAMS"),labelSelected:n.instant("STAFF.SELECTED_TEAMS"),transferCallback:function(e,t){var n=_.xorBy(l.startingSelectedItems,l.selectedItems,"id");l.pendingChanges=!_.isEmpty(n)}},l.onInit=function(){return o.hasRole("admin")?d().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return l.section=e,d()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},l.saveTeams=function(){var e=_.differenceBy(l.startingSelectedItems,l.selectedItems,"id"),t=_.differenceBy(l.selectedItems,l.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.user.removeTeams({id:l.agent.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.user.addTeams({id:l.agent.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){l.pendingChanges=!1,l.startingAllowedItems=angular.copy(l.allowedItems),l.startingSelectedItems=angular.copy(l.selectedItems),i.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},l.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","agent","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("AgentteamaddController",e)}(),function(){"use strict";function e(e,t,i,s,n,a,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=a,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.agent=c||e.params.agent||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.queueaddchannel=function(e,t,n,a){i.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(s.body),targetEvent:n,clickOutsideToClose:!0,locals:{agent:e,agents:u.agents?u.agents.rows:[],channel:t,direction:a||"inbound",crudPermissions:u.crudPermissions}})},u.teamadddialog=function(e,t){i.show({controller:"AgentteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:u.agents?u.agents.rows:[],crudPermissions:u.crudPermissions}})},u.changepassworddialog=function(e,t){i.show({controller:"AgentchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,setting:o,agents:u.agents?u.agents.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoAgents=function(){e.go("app.staff.agents")},u.saveAgent=function(){u.agent=_.omit(u.agent,"userpic"),r.user.update({id:u.agent.id},u.agent).$promise.then(function(){l.success({title:"Agent updated!",msg:u.agent.name?u.agent.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.agent&&(n=_.find(u.contexts,{name:u.agent.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","agent","userProfileSection"],angular.module("app.staff").controller("AgentController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TEAM",g.team=angular.copy(l),g.teams=r,g.newTeam=!1,g.team||(g.team={},g.title="STAFF.NEW_TEAM",g.newTeam=!0),g.addNewTeam=function(){g.errors=[],d.team.save(g.team).$promise.then(function(e){g.teams.unshift(e.toJSON()),o.success({title:"Team properly created",msg:g.team.name?g.team.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTeam=function(){g.errors=[],d.team.update({id:g.team.id},g.team).$promise.then(function(e){var t=_.find(g.teams,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Team properly saved!",msg:g.team.name?g.team.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTeam=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The team will be deleted.").ariaLabel("Delete Team").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.team.delete({id:g.team.id}).$promise.then(function(){_.remove(g.teams,{id:g.team.id}),o.success({title:"Team properly deleted!",msg:(g.team.name||"team")+" has been deleted!"}),v(g.team)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.team.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.team.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","teams","team","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTeamDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.team.getAgents({id:c.team.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserTeam?"penalty "+e.UserTeam.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.team=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.team.removeAgents({id:c.team.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.team.addAgents({id:c.team.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("STAFF.ALL_AGENTS"),labelSelected:r.instant("STAFF.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","team","teams","realtime","$translate","Auth","crudPermissions"],angular.module("app.staff").controller("TeamagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.teams=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="teams",b.listOrder="",b.listOrderAsc=null,b.selectedTeams=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:b.teams.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"TeamagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{team:e,teams:b.teams?b.teams.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("team")+"?").htmlContent("<b>"+(e.name||"team")+"</b> will be deleted.").ariaLabel("delete team").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTeams=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.team.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Teams",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTeam=function(e,t){i.show({controller:"CreateOrEditTeamDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/teams/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{team:t,teams:b.teams.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTeam=S,b.exportSelectedTeams=function(){var e=angular.copy(b.selectedTeams);return b.selectedTeams=[],e},b.deleteSelectedTeams=function(e){var t=i.confirm().title("Are you sure want to delete the selected teams?").htmlContent("<b>"+b.selectedTeams.length+" selected</b> will be deleted.").ariaLabel("delete Teams").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTeams.forEach(function(e){S(e)}),b.selectedTeams=[]})},b.deselectTeams=function(){b.selectedTeams=[]},b.selectAllTeams=function(){b.selectedTeams=b.teams.rows};var E=!0,A=1;function y(e){b.teams=e||{count:0,rows:[]}}function S(e){m.team.delete({id:e.id}).$promise.then(function(){_.remove(b.teams.rows,{id:e.id}),b.teams.count-=1,b.teams.rows.length||b.getTeams(),p.success({title:_.startCase("Team")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEteam"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEteam",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTeams())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","teams","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TeamsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_TELEPHONE",g.telephone=angular.copy(l),g.telephones=r,g.newTelephone=!1,g.telephone||(g.telephone={role:"telephone",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_TELEPHONE",g.newTelephone=!0),g.addNewTelephone=function(){g.errors=[],d.user.save(g.telephone).$promise.then(function(e){g.telephones.unshift(e.toJSON()),o.success({title:"Telephone properly created",msg:g.telephone.name?g.telephone.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTelephone=function(){g.errors=[],d.user.update({id:g.telephone.id},g.telephone).$promise.then(function(e){var t=_.find(g.telephones,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Telephone properly saved!",msg:g.telephone.name?g.telephone.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTelephone=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The telephone will be deleted.").ariaLabel("Delete Telephone").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.telephone.id}).$promise.then(function(){_.remove(g.telephones,{id:g.telephone.id}),o.success({title:"Telephone properly deleted!",msg:(g.telephone.name||"telephone")+" has been deleted!"}),v(g.telephone)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","telephones","telephone","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditTelephoneDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.telephone=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.telephone.id,newPassword:o.password};o.currentUser.id==o.telephone.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"Telephone password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.telephone.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.telephone.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","telephone","setting","Auth"],angular.module("app.staff").controller("TelephonechangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.telephone=c||e.params.telephone||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.changepassworddialog=function(e,t){n.show({controller:"TelephonechangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{telephone:e,setting:o,telephones:u.telephones?u.telephones.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTelephones=function(){e.go("app.staff.telephones")},u.saveTelephone=function(){r.user.update({id:u.telephone.id},u.telephone).$promise.then(function(){l.success({title:"Telephone updated!",msg:u.telephone.name?u.telephone.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.telephone&&(n=_.find(u.contexts,{name:u.telephone.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","telephone","userProfileSection"],angular.module("app.staff").controller("TelephoneController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.telephones=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="telephones",b.listOrder="",b.listOrderAsc=null,b.selectedTelephones=[],b.query={fields:"createdAt,updatedAt,id,role,fullname,name,email,password,description,autointernal,internal,voicemail,transport,nat,allow,callerid,context,callgroup,pickupgroup,videosupport,encryption,phone,mobile",role:"telephone",sort:"-updatedAt",limit:10,page:1},b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.telephones.edit",{id:e.id,telephone:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("telephone")+"?").htmlContent("<b>"+(e.name||"telephone")+"</b> will be deleted.").ariaLabel("delete telephone").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTelephones=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Telephones",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTelephone=function(e,t){i.show({controller:"CreateOrEditTelephoneDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/telephones/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{telephone:t,telephones:b.telephones.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTelephone=S,b.exportSelectedTelephones=function(){var e=angular.copy(b.selectedTelephones);return b.selectedTelephones=[],e},b.deleteSelectedTelephones=function(e){var t=i.confirm().title("Are you sure want to delete the selected telephones?").htmlContent("<b>"+b.selectedTelephones.length+" selected</b> will be deleted.").ariaLabel("delete Telephones").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTelephones.forEach(function(e){S(e)}),b.selectedTelephones=[]})},b.deselectTelephones=function(){b.selectedTelephones=[]},b.selectAllTelephones=function(){b.selectedTelephones=b.telephones.rows};var E=!0,A=1;function y(e){b.telephones=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.telephones.rows,{id:e.id}),b.telephones.count-=1,b.telephones.rows.length||b.getTelephones(),p.success({title:_.startCase("Telephone")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTelephones())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","telephones","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("TelephonesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USERPROFILE",g.userProfile=angular.copy(l),g.userProfiles=r,g.newUserProfile=!1,g.userProfile||(g.userProfile={crudPermissions:["r"]},g.title="STAFF.NEW_USERPROFILE",g.newUserProfile=!0),g.addNewUserProfile=function(){g.errors=[],d.userProfile.save(g.userProfile).$promise.then(function(e){var t,n;n=[],(t=e).crudPermissions.forEach(function(e){var t;switch(e){case"r":t="READ_PERMISSION";break;case"e":t="EDIT_PERMISSION";break;case"d":t="DELETE_PERMISSION"}n.push(s.instant("STAFF."+t))}),t.selectedcrudPermissions=n.join(", "),g.userProfiles.unshift(e.toJSON()),o.success({title:"UserProfile properly created",msg:g.userProfile.name?g.userProfile.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUserProfile=function(){g.errors=[],d.userProfile.update({id:g.userProfile.id},g.userProfile).$promise.then(function(e){var t=_.find(g.userProfiles,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"UserProfile properly saved!",msg:g.userProfile.name?g.userProfile.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUserProfile=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The userProfile will be deleted.").ariaLabel("Delete UserProfile").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.userProfile.delete({id:g.userProfile.id}).$promise.then(function(){_.remove(g.userProfiles,{id:g.userProfile.id}),o.success({title:"UserProfile properly deleted!",msg:(g.userProfile.name||"userProfile")+" has been deleted!"}),v(g.userProfile)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","userProfiles","userProfile","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserProfileDialogController",e)}(),function(){"use strict";function e(t,a,i,e,n,s,o){var r=this;function l(e){t.hide(e)}r.newUserProfile=!0,r.userProfile=angular.copy(n),r.userProfiles=s,r.title=o.instant("STAFF.CLONE_USERPROFILE"),n&&n.name&&(r.title+=": "+n.name),r.cloneUserProfile=function(){return e.userProfile.clone({id:n.id},r.userProfile).$promise.then(function(e){var t,n;n=[],(t=e).crudPermissions.forEach(function(e){var t;switch(e){case"r":t="READ_PERMISSION";break;case"e":t="EDIT_PERMISSION";break;case"d":t="DELETE_PERMISSION"}n.push(o.instant("STAFF."+t))}),t.selectedcrudPermissions=n.join(", "),r.userProfiles.unshift(e.toJSON()),i.success({title:"UserProfile properly cloned",msg:r.userProfile.name?r.userProfile.name+" has been cloned!":""}),a.go("app.staff.userProfiles.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.userProfile.clone"}];for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.userProfile.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","userProfile","userProfiles","$translate"],angular.module("app.staff").controller("UserProfilecloneController",e)}(),function(){"use strict";function e(n,o,r,l,d,e,t,c){var m=this;function u(e,t){switch(e.allResourcesEnabled="full"===t,t){case"full":return _.find(m.statusList,["tag","full"]);case"partial":return _.find(m.statusList,["tag","partial"]);case"disabled":return _.find(m.statusList,["tag","disabled"]);case"unlicensed":return _.find(m.statusList,["tag","unlicensed"]);case"unknown":default:return _.find(m.statusList,["tag","unknown"])}}function p(e){return l(function(t,n){var i,a;void 0!==e.channel&&_.includes(e.route,"Queue")?(a=e,l(function(t,n){var e=void 0!==a.channel&&"bull"===a.channel?"outbound":"inbound";return d[a.route].get({fields:"id,name,strategy,type",channel:"bull"===a.channel?"voice":a.channel,type:e,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})).then(function(e){t(e)}).catch(function(e){n(e)}):(i=e,l(function(a,t){switch(i.route){case"voiceExtension":var e;switch(i.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}break;case"user":var n;switch(i.title){case"Agents":n="agent";break;case"Telephones":n="telephone";break;case"Users":n="user"}}if("Reports"===i.title){if(!i.reportType)return d.analyticDefaultReport.get({nolimit:!0}).$promise.then(function(n){d.analyticCustomReport.get({nolimit:!0}).$promise.then(function(e){var t=_.union(n.rows,e.rows);a({count:t.length,rows:t.rows})})}).catch(function(e){t(e)});switch(i.reportType){case"default":i.route="analyticDefaultReport";break;case"custom":i.route="analyticCustomReport"}}return d[i.route].get({role:n||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,nolimit:!0}).$promise.then(function(e){a(e)}).catch(function(e){t(e)})})).then(function(e){t(e)}).catch(function(e){n(e)})})}function g(e,t,n){var a=e&&0<e.length?e[0]:null;if(!a)return n;var i,s,o=_.find(t,["sectionId",a.id]);return o?(t=_.remove(t,["sectionId",a.id]),(i=a,s=o.id,l(function(t,n){d.userProfileResource.get({sectionId:s}).$promise.then(function(t){return p(i).then(function(e){return _.differenceBy(t.rows,e.rows,"id")})}).then(function(e){_.isEmpty(e)?t():n()}).catch(function(e){n(e)})})).then(function(){return n="full",g(e.shift(),t,n)}).catch(function(e){return l.reject(e)})):void 0}function a(a){var n="Marketplace"===a.title?"AppZone":a.title;m.license?void 0===a.permissions||a.permissions.association?void 0===a.license||m.license[a.license]?d.userProfileSection.get({userProfileId:m.userProfile.id,category:n}).$promise.then(function(e){var t=e&&e.rows&&0<e.rows.length?e.rows:[];if("Dashboards"===a.title)return _.isEmpty(t)?"disabled":t[0].autoAssociation?"full":d.userProfileResource.get({sectionId:t[0].id,resourceId:101}).$promise.then(function(e){return(e&&e.rows?e.rows[0]:null)?"full":"partial"});var n=_.filter(a.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e});return t.length!==n.length?0===t.length?"disabled":"partial":_.every(t,["autoAssociation",!0])?"full":g(_.filter(n,function(e){return void 0===e.permissions||e.permissions.association?e:void 0}),t,"partial")}).then(function(e){a.status=u(a,e)}).catch(function(e){var t=e?"unknown":"partial";a.status=u(a,t),e&&c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GETRESOURCES("+n.toUpperCase()+")",msg:e.status?JSON.stringify(e.data):e.toString()})}):a.status=u(a,"unlicensed"):d.userProfileSection.get({userProfileId:m.userProfile.id,sectionId:a.id}).$promise.then(function(e){var t=(e&&1===e.rows.length?e.rows[0]:null)?"full":"disabled";a.status=u(a,t)}):a.status=u(a,"unknown")}m.userProfile={},m.license={},m.navigation=e.getNavigation(),m.modules=m.navigation[0].children,m.statusList=[{id:0,name:"Fully Enabled",color:"green-A700-bg",info:"All resources enabled",tag:"full"},{id:1,name:"Partially Enabled",color:"orange-A700-bg",info:"Some resources enabled",tag:"partial"},{id:2,name:"Disabled",color:"grey-A400-bg",info:"No resources enabled",tag:"disabled"},{id:3,name:"Unlicensed",color:"red-A700-bg",info:"Module not included in the license",tag:"unlicensed"},{id:4,name:"Unknown",color:"grey-A700-bg",info:"Unknown status",tag:"unknown"}],m.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],m.init=function(e,t){m.userProfile=e,m.license=t},m.onChangeEnableAllResources=function(t){var e=void 0!==t.permissions&&!t.permissions.association,a="Marketplace"===t.title?"AppZone":t.title;if("Fully Enabled"!==t.status.name){var i=[];if(e)return i.push({category:a,sectionId:t.id,name:a,enabled:!0,crudPermissions:"red"}),d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){t.status=u(t,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})});var n=o.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_ENABLE_ALL",{sectionName:r.instant(t.translate)})).ariaLabel("Warning").ok(r.instant("STAFF.CONFIRM")).cancel(r.instant("STAFF.CANCEL"));o.show(n).then(function(){switch(a){case"Dashboards":_.map(m.dashboardSections,function(e){i.push({category:a,sectionId:e.id,name:e.title,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})});break;default:_.map(t.children,function(e){var t=!(void 0===e.permissions||!e.permissions.hidden);if(!t){var n=e.title;switch(a){case"CallySquare":n="Projects"===n?"SquareProjects":n}i.push({category:a,sectionId:e.id,name:n,enabled:!0,autoAssociation:!0,crudPermissions:_.map(m.userProfile.crudPermissions).join("")})}})}return d.userProfile.addSections({id:m.userProfile.id},i).$promise.then(function(){t.status=u(t,"full"),c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})})}).catch(function(e){e?c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()}):t.status=u(t,t.status.tag)})}else if("Fully Enabled"===t.status.name){t.status=u(t,"disabled");var s=[];switch(a){case"Settings":case"Help":s=[t.id];break;case"Dashboards":s=_.map(m.dashboardSections,function(e){return e.id});break;default:s=_.map(t.children,function(e){return e.id})}return d.userProfile.removeSections({id:m.userProfile.id,ids:s}).$promise.then(function(){c.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE",{sectionName:r.instant(t.translate),userProfileName:m.userProfile.name})})}).catch(function(e){c.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.REMOVESECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})}},m.manageResources=function(e,t){o.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!1,locals:{userProfile:m.userProfile,userProfiles:[],section:e}}).then(function(){a(e)})},m.checkSectionResources=a}e.$inject=["$document","$mdDialog","$translate","$q","api","msNavigationService","Auth","toasty"],angular.module("app.staff").controller("UserProfilePermissionsController",e)}(),function(){"use strict";function e(n,s,t,o,e,a,r,i,l){var d=this;function c(){var a=void 0!==d.selectedSection.pending&&d.selectedSection.pending;return s(function(n,t){o.userProfileSection.get({userProfileId:d.userProfile.id,sectionId:d.selectedSection.id}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;a||(d.selectedSection.enabled=!!t&&!!t.enabled,d.selectedSection.autoAssociation=!!t&&!!t.autoAssociation,d.selectedSection.crudPermissions=p(t?t.crudPermissions:d.userProfile.crudPermissions)),n(t)}).catch(function(e){t(e)})})}function m(){return s(function(t,n){void 0!==d.selectedSection.channel&&_.includes(d.selectedSection.route,"Queue")?s(function(t,n){var e=void 0!==d.selectedSection.channel&&"bull"===d.selectedSection.channel?"outbound":"inbound";return o[d.selectedSection.route].get({fields:"id,name,strategy,type",channel:"bull"===d.selectedSection.channel?"voice":d.selectedSection.channel,type:e,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){t(e)}).catch(function(e){n(e)}):s(function(t,n){var e,a;if("voiceExtension"===d.selectedSection.route)switch(d.selectedSection.title){case"InboundRoutes":e="inbound";break;case"OutboundRoutes":e="outbound";break;case"InternalRoutes":e="internal"}if("user"===d.selectedSection.route)switch(d.selectedSection.title){case"Agents":a="agent";break;case"Telephones":a="telephone";break;case"Users":a="user"}if("interval"===d.selectedSection.route)var i=!0;if("Reports"===d.selectedSection.title)switch(d.selectedSection.reportType){case"default":d.selectedSection.route="analyticDefaultReport";break;case"custom":d.selectedSection.route="analyticCustomReport"}if("Dashboards"!==d.selectedSection.title)return o[d.selectedSection.route].get({role:a||void 0,type:e||void 0,VoiceExtensionId:e?"null":void 0,IntervalId:i?"null":void 0,nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)});t({count:1,rows:[{id:101,name:r.instant("DASHBOARDS.GENERAL")}]})}).then(function(e){t(e)}).catch(function(e){n(e)})})}function u(){var a=void 0!==d.selectedSection.pending&&d.selectedSection.pending,i=[];return s(function(t,n){d.loadedSection?o.userProfileResource.get({sectionId:d.loadedSection.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)}):t(null)}).then(function(e){return i=e&&e.rows?e.rows:[],"Reports"===d.selectedSection.title&&(d.associatedReports=d.associatedReports?d.associatedReports:i,i=function(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.filter(e,{type:"DefaultReports"});break;case"custom":t=_.filter(e,{type:"CustomReports"})}return t}(d.associatedReports)),void 0===d.selectedSection.permissions||d.selectedSection.permissions.association?m():{rows:[]}}).then(function(e){d.items=e.rows?_.map(e.rows,function(e){var t,n;return"Reports"===d.selectedSection.title&&(e.fullPath=(t=e.parent,n=d.treeStructure[0].text,n=function e(t,n,a){if(!a||_.isEmpty(a.children))return t;var a=_.find(a.children,function(e){return _.includes(n,e.id)?e:void 0});return t+=a?"/"+a.text:"",e(t,n,a)}(n,t,d.treeStructure[0])).replace(" ","_")),e.isValid=!0,e}):[],a||(d.selectedSection.selectedItems=_.map(i,function(e){return _.find(d.items,{id:e.resourceId})}));var t=_.differenceBy(d.selectedSection.selectedItems,d.items,"id");switch(_.isEmpty(t)||(d.selectedSection.selectedItems=_.pullAllBy(d.selectedSection.selectedItems,t,"id")),d.selectedSection.title){case"Contexts":d.selectedSection.selectedItems=_.filter(d.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(i,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"MusicOnHolds":d.selectedSection.selectedItems=_.filter(d.items,function(e){return e.defaultEntry?(e.isValid=!1,e):void 0!==_.find(i,{resourceId:e.id})?(e.isValid=!0,e):void 0});break;case"Reports":var n=function(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.filter(e,function(e){return _.startsWith(e.parent,"motion")});break;case"custom":t=_.filter(e,function(e){return _.startsWith(e.parent,"custom")})}return t}(d.allReportsSelected);d.selectedSection.selectedItems=h(d.selectedSection.selectedItems),d.selectedSection.selectedItems=_.unionBy(d.selectedSection.selectedItems,n,"parent")}d.dualMultiselectOptions.selectedItems=d.selectedSection.selectedItems,d.dualMultiselectOptions.items=_.differenceBy(d.items,d.dualMultiselectOptions.selectedItems,"id")}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+d.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})}function p(e){return e&&(d.selectedSection.allowEdit=!!_.includes(e,"e"),d.selectedSection.allowDelete=!!_.includes(e,"d")),function(){var e=["r"];if(d.selectedSection.allowEdit)e.push("e");else{var t=_.indexOf(e,["e"]);0<t&&d.selectedSection.crudPermissions.replace("e","")}if(d.selectedSection.allowDelete)e.push("d");else{var t=_.indexOf(e,["d"]);0<t&&d.selectedSection.crudPermissions.replace("d","")}return e}()}function g(e){var t=_.findIndex(d.subsections,function(e){return e.id==d.selectedSection.id});d.subsections[t].pending=e,v()}function v(){return d.pendingChanges=_.some(d.subsections,["pending",!0])}function h(e){var t=[];switch(d.selectedSection.reportType){case"default":t=_.remove(e,function(e){return _.startsWith(e.parent,"motion")});break;case"custom":t=_.remove(e,function(e){return _.startsWith(e.parent,"custom")})}return t}d.userProfile=e,d.penalty=0,d.section=angular.copy(l),d.title=r.instant("STAFF.PERMISSIONS_SECTION_TITLE",{sectionName:r.instant(d.section.translate)}),d.items=[],d.selectedItems=[],d.subsections=_.filter(d.section.children,function(e){return void 0!==e.permissions&&e.permissions.hidden?void 0:e}),d.dashboardSections=[{title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",id:100}],d.dashboardItems=[],"Dashboards"===d.section.title&&(d.dashboardItems=d.subsections,d.subsections=d.dashboardSections),d.selectedSection=null,d.loadedSection=null,d.closeDialog=function(e){if(d.pendingChanges){var t=n.confirm({skipHide:!0}).title("Warning").textContent(r.instant("STAFF.PERMISSIONS_WARNING_CLOSE")).ariaLabel("Warning").targetEvent(e).ok(r.instant("STAFF.CLOSE")).cancel(r.instant("STAFF.CANCEL"));n.show(t).then(function(){n.hide()})}else n.hide()},d.onChangeSection=function(){return c().then(function(e){if(d.loadedSection=e,"Reports"===d.selectedSection.title)return s(function(t,n){o.analyticTreeReport.get({}).$promise.then(function(e){d.treeReports=e.rows||[],t(d.treeReports)}).catch(function(e){n(e)})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREE_REPORT_STRUCTURE",msg:e.data?JSON.stringify(e.data):e.toString()})});u()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET"+d.selectedSection.title.toUpperCase(),msg:e.status?JSON.stringify(e.data):e.toString()})})},d.onChangeVisibility=function(){d.selectedSection.enabled=!d.selectedSection.enabled,g(!0)},d.onChangeAutoAssociation=function(){if(!d.selectedSection.autoAssociation){for(var e=[],t=0;t<d.dualMultiselectOptions.items.length;t++)e.push(d.dualMultiselectOptions.items[t]),d.dualMultiselectOptions.selectedItems.push(d.dualMultiselectOptions.items[t]);d.dualMultiselectOptions.items=[],d.dualMultiselectOptions.transferCallback(e,!1)}g(!0)},d.onChangeReportType=function(){d.treeStructure=function(){var e={};switch(d.selectedSection.reportType){case"default":e=d.treeReports[0]?angular.fromJson(d.treeReports[0].tree):[];break;case"custom":e=d.treeReports[1]?angular.fromJson(d.treeReports[1].tree):[]}return e}(),d.selectedSection.selectedItems&&(d.allReportsSelected=h(d.allReportsSelected),d.allReportsSelected=_.unionBy(d.allReportsSelected,d.selectedSection.selectedItems,"parent"));u()},d.setPermission=function(e){switch(e){case"edit":d.selectedSection.allowEdit=!d.selectedSection.allowEdit;break;case"delete":d.selectedSection.allowDelete=!d.selectedSection.allowDelete}d.selectedSection.crudPermissions=p(),g(!0)},d.saveSection=function(){var n="Marketplace"===d.section.title?"AppZone":d.section.title,e=_.map(_.filter(d.subsections,{pending:!0}),function(e){var t=e.selectedItems,a=e.title;switch("Reports"===a&&(t=_.unionBy(d.allReportsSelected,e.selectedItems,"parent")),n){case"CallySquare":a="Projects"===a?"SquareProjects":a;break;case"Integrations":e.autoAssociation=!0}return{category:n,sectionId:e.id,name:a,enabled:e.enabled,autoAssociation:e.autoAssociation,crudPermissions:_.map(e.crudPermissions).join(""),Resources:t?_.map(t,function(e){return{name:e.name,resourceId:e.id,type:(t=a,n=e,"Reports"!==t?t:(_.startsWith(n.parent,"motion")?"Default":"Custom")+t)};var t,n}):[]}});return o.userProfile.addSections({id:d.userProfile.id},e).$promise.then(function(){d.subsections.forEach(function(e){e.pending=void 0}),d.allReportsSelected=[],d.associatedReports=null,v(),t.success({title:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_TITLE",{sectionName:r.instant(n.translate)}),msg:r.instant("STAFF.NOTIFICATIONS.PERMISSIONS_SAVED_SUCCESS_MESSAGE")})}).then(function(){return c().then(function(e){d.loadedSection=e})}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:USERPROFILE.ADDSECTIONS",msg:e.status?JSON.stringify(e.data):e.toString()})})},d.dualMultiselectOptions={readOnly:!1,items:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",line4:"fullPath",labelAll:r.instant("STAFF.PERMISSIONS_ALL_RESOURCES"),labelSelected:r.instant("STAFF.PERMISSIONS_SELECTED_RESOURCES"),labelSearch:r.instant("STAFF.PERMISSIONS_PLACEHOLDER_SEARCH"),transferCallback:function(e,t){g(!0),t?(d.selectedSection.selectedItems=_.pullAllBy(d.selectedSection.selectedItems,e,"id"),d.selectedSection.autoAssociation=!1):d.selectedSection.selectedItems=_.unionBy(d.selectedSection.selectedItems,e,"id")}}}e.$inject=["$mdDialog","$q","toasty","api","userProfile","userProfiles","$translate","Auth","section"],angular.module("app.staff").controller("UserProfilepermissionsmanageController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.userProfile=c||e.params.userProfile||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.permissionsmanagedialog=function(e,t){n.show({controller:"UserProfilepermissionsmanageController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.clonedialog=function(e,t){n.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:u.userProfiles?u.userProfiles.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUserProfiles=function(){e.go("app.staff.userProfiles")},u.saveUserProfile=function(){r.userProfile.update({id:u.userProfile.id},u.userProfile).$promise.then(function(){l.success({title:"UserProfile updated!",msg:u.userProfile.name?u.userProfile.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuserProfile",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","userProfile","userProfileSection"],angular.module("app.staff").controller("UserProfileController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.userProfiles=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="userProfiles",b.listOrder="",b.listOrderAsc=null,b.selectedUserProfiles=[],b.query={fields:"createdAt,updatedAt,id,name,description,crudPermissions",sort:"-updatedAt",limit:10,page:1},b.arraycrudPermissions=_.keyBy([{option:"Read_permission",value:"'r'",disabled:!0},{option:"Edit_permission",value:"'e'"},{option:"Delete_permission",value:"'d'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.userProfiles&&0<b.userProfiles.count&&b.userProfiles.rows.forEach(function(e){var t=[];e.crudPermissions.forEach(function(e){t.push(b.arraycrudPermissions[e].option)});var n=[];t.forEach(function(e){n.push(r.instant("STAFF."+e.toUpperCase()))}),e.selectedcrudPermissions=n.join(", ")}),b.editstate=function(e,t){n.go("app.staff.userProfiles.edit",{id:e.id,userProfile:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"UserProfilecloneController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{userProfile:e,userProfiles:b.userProfiles?b.userProfiles.rows:[],crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("userProfile")+"?").htmlContent("<b>"+(e.name||"userProfile")+"</b> will be deleted.").ariaLabel("delete userProfile").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getUserProfiles=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.userProfile.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="UserProfiles",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditUserProfile=function(e,t){i.show({controller:"CreateOrEditUserProfileDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/userProfiles/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{userProfile:t,userProfiles:b.userProfiles.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteUserProfile=S,b.exportSelectedUserProfiles=function(){var e=angular.copy(b.selectedUserProfiles);return b.selectedUserProfiles=[],e},b.deleteSelectedUserProfiles=function(e){var t=i.confirm().title("Are you sure want to delete the selected userProfiles?").htmlContent("<b>"+b.selectedUserProfiles.length+" selected</b> will be deleted.").ariaLabel("delete UserProfiles").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedUserProfiles.forEach(function(e){S(e)}),b.selectedUserProfiles=[]})},b.deselectUserProfiles=function(){b.selectedUserProfiles=[]},b.selectAllUserProfiles=function(){b.selectedUserProfiles=b.userProfiles.rows};var E=!0,A=1;function y(e){b.userProfiles=e||{count:0,rows:[]}}function S(e){m.userProfile.delete({id:e.id}).$promise.then(function(){_.remove(b.userProfiles.rows,{id:e.id}),b.userProfiles.count-=1,b.userProfiles.rows.length||b.getUserProfiles(),p.success({title:_.startCase("UserProfile")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuserProfile"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuserProfile",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getUserProfiles())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","userProfiles","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UserProfilesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="STAFF.EDIT_USER",g.user=angular.copy(l),g.users=r,g.newUser=!1,g.user||(g.user={role:"user",autointernal:!0,context:"from-sip"},g.title="STAFF.NEW_USER",g.newUser=!0),g.addNewUser=function(){g.errors=[],d.user.save(g.user).$promise.then(function(e){g.users.unshift(e.toJSON()),o.success({title:"User properly created",msg:g.user.name?g.user.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveUser=function(){g.errors=[],d.user.update({id:g.user.id},g.user).$promise.then(function(e){var t=_.find(g.users,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"User properly saved!",msg:g.user.name?g.user.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteUser=function(e){if(c.getCurrentUser().id===g.user.id)return o.error({title:"User not deleted!",msg:"You can't remove yourself"});g.errors=[];var t=a.confirm().title("Are you sure?").content("The user will be deleted.").ariaLabel("Delete User").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.user.delete({id:g.user.id}).$promise.then(function(){_.remove(g.users,{id:g.user.id}),o.success({title:"User properly deleted!",msg:(g.user.name||"user")+" has been deleted!"}),v(g.user)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.user.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,d.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.userProfiles=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","users","user","api","Auth","license","setting","crudPermissions"],angular.module("app.staff").controller("CreateOrEditUserDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i){var s=this;function o(){e.hide()}s.currentUser=i.getCurrentUser(),s.errors=[],s.user=a,s.generateApiKey=function(){s.errors=[],n.user.createApiKey({id:s.user.id}).$promise.then(function(e){s.user.apiKey=e.api_key||"N/A",t.success({title:"User API key updated!"}),o()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.createApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.createApiKey"}]})},s.removeApiKey=function(){s.errors=[],n.user.removeApiKey({id:s.user.id}).$promise.then(function(){s.user.apiKey="N/A",t.success({title:"User API key removed!"}),o()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.removeApiKey",msg:e.data?JSON.stringify(e.data.message):e.toString()}),s.errors=e.data.errors||[{message:e.toString(),type:"api.user.removeApiKey"}]})},s.closeDialog=o}e.$inject=["$mdDialog","toasty","api","user","Auth"],angular.module("app.staff").controller("UserapikeymanagerController",e)}(),function(){"use strict";function e(e,a){var i=this;i.user={},i.crudPermissions,i.ngFlowOptions={singleFile:!0,maxChunkRetries:1,chunkSize:8388608,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0},i.ngFlow={flow:{}},i.dropping=!1,i.fileAdded=function(e){var t=["png","jpg"];if(!_.includes(t,e.getExtension()))return a.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(8388608<e.size)return a.error({title:"File too big",msg:"The max allowed size is 8MB"}),!1;var n={id:e.uniqueIdentifier,file:e,type:"uploading"};return i.user.images.unshift(n),!0},i.upload=function(){i.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},i.ngFlow.flow.upload()},i.fileSuccess=function(a,e){angular.forEach(i.user.images,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result},t.type="image"}})},i.init=function(e,t){i.user=angular.copy(e),i.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},i.ngFlowOptions.target="api/users/"+i.user.id+"/avatar",i.user.images=[]}}e.$inject=["$cookies","toasty"],angular.module("app.staff").controller("Userchange_avatarController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.currentUser=s.getCurrentUser(),o.errors=[],o.setting=i,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.user=a,o.password="",o.oldPassword="",o.savePassword=function(){o.errors=[];var e={id:o.user.id,newPassword:o.password};o.currentUser.id==o.user.id&&(e.oldPassword=o.oldPassword);n.user.changePassword(e).$promise.then(function(){t.success({title:"User password properly updated!"}),r()}).catch(function(e){t.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.user.save",msg:e.data?JSON.stringify(e.data.message):e.toString()}),o.errors=e.data.errors||[{message:e.toString(),type:"api.user.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","toasty","api","user","setting","Auth"],angular.module("app.staff").controller("UserchangepasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.user=c||e.params.user||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.apikeymanagerdialog=function(e,t){n.show({controller:"UserapikeymanagerController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,users:u.users?u.users.rows:[],crudPermissions:u.crudPermissions}})},u.changepassworddialog=function(e,t){n.show({controller:"UserchangepasswordController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/edit/changepassword/changepassword.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{user:e,setting:o,users:u.users?u.users.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoUsers=function(){e.go("app.staff.users")},u.saveUser=function(){u.user=_.omit(u.user,"userpic"),r.user.update({id:u.user.id},u.user).$promise.then(function(){l.success({title:"User updated!",msg:u.user.name?u.user.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETuser",msg:e.data?JSON.stringify(e.data):e.toString()})})},r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.userProfiles=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})}),r.user.getApiKey({id:u.user.id}).$promise.then(function(e){u.user.apiKey=e.api_key?e.api_key:"N/A"}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_APIKEY",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","user","userProfileSection"],angular.module("app.staff").controller("UserController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.users=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="users",b.listOrder="",b.listOrderAsc=null,b.selectedUsers=[],b.query={fields:"createdAt,updatedAt,role,userProfileId,id,fullname,name,email,phone,mobile,userpic,password,description,autointernal,internal,transport,nat,allow,context,callgroup,pickupgroup,passwordResetAt,apiKey,videosupport",role:"admin,user",sort:"-updatedAt",limit:10,page:1},b.arrayrole=_.keyBy([{option:"Admin",value:"'admin'"},{option:"User",value:"'user'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.staff.users.edit",{id:e.id,user:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("user")+"?").htmlContent("<b>"+(e.name||"user")+"</b> will be deleted.").ariaLabel("delete user").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getUsers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.user.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Users",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditUser=function(e,t){i.show({controller:"CreateOrEditUserDialogController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/users/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{user:t,users:b.users.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteUser=S,b.exportSelectedUsers=function(){var e=angular.copy(b.selectedUsers);return b.selectedUsers=[],e},b.deleteSelectedUsers=function(e){var t=i.confirm().title("Are you sure want to delete the selected users?").htmlContent("<b>"+b.selectedUsers.length+" selected</b> will be deleted.").ariaLabel("delete Users").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedUsers.forEach(function(e){S(e)}),b.selectedUsers=[]})},b.deselectUsers=function(){b.selectedUsers=[]},b.selectAllUsers=function(){b.selectedUsers=b.users.rows},m.userProfile.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.userProfiles=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERPROFILES",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.users=e||{count:0,rows:[]}}function S(e){m.user.delete({id:e.id}).$promise.then(function(){_.remove(b.users.rows,{id:e.id}),b.users.count-=1,b.users.rows.length||b.getUsers(),p.success({title:_.startCase("User")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEuser"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEuser",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getUsers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","users","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.staff").controller("UsersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.cannedAnswers=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="cannedAnswers",b.listOrder="",b.listOrderAsc=null,b.selectedCannedAnswers=[],b.query={fields:"createdAt,updatedAt,id,key,value,description",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{cannedAnswer:e,cannedAnswers:b.cannedAnswers.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("cannedAnswer")+"?").htmlContent("<b>"+(e.name||"cannedAnswer")+"</b> will be deleted.").ariaLabel("delete cannedAnswer").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCannedAnswers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.cannedAnswer.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="CannedAnswers",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCannedAnswer=function(e,t){i.show({controller:"CreateOrEditCannedAnswerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/cannedAnswers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{cannedAnswer:t,cannedAnswers:b.cannedAnswers.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCannedAnswer=S,b.exportSelectedCannedAnswers=function(){var e=angular.copy(b.selectedCannedAnswers);return b.selectedCannedAnswers=[],e},b.deleteSelectedCannedAnswers=function(e){var t=i.confirm().title("Are you sure want to delete the selected cannedAnswers?").htmlContent("<b>"+b.selectedCannedAnswers.length+" selected</b> will be deleted.").ariaLabel("delete CannedAnswers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCannedAnswers.forEach(function(e){S(e)}),b.selectedCannedAnswers=[]})},b.deselectCannedAnswers=function(){b.selectedCannedAnswers=[]},b.selectAllCannedAnswers=function(){b.selectedCannedAnswers=b.cannedAnswers.rows};var E=!0,A=1;function y(e){b.cannedAnswers=e||{count:0,rows:[]}}function S(e){m.cannedAnswer.delete({id:e.id}).$promise.then(function(){_.remove(b.cannedAnswers.rows,{id:e.id}),b.cannedAnswers.count-=1,b.cannedAnswers.rows.length||b.getCannedAnswers(),p.success({title:_.startCase("CannedAnswer")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEcannedAnswer"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEcannedAnswer",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCannedAnswers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","cannedAnswers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CannedAnswersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CANNEDANSWER",g.cannedAnswer=angular.copy(l),g.cannedAnswers=r,g.newCannedAnswer=!1,g.cannedAnswer||(g.cannedAnswer={},g.title="TOOLS.NEW_CANNEDANSWER",g.newCannedAnswer=!0),g.addNewCannedAnswer=function(){g.errors=[],d.cannedAnswer.save(g.cannedAnswer).$promise.then(function(e){g.cannedAnswers.unshift(e.toJSON()),o.success({title:"CannedAnswer properly created",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCannedAnswer=function(){g.errors=[],d.cannedAnswer.update({id:g.cannedAnswer.id},g.cannedAnswer).$promise.then(function(e){var t=_.find(g.cannedAnswers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CannedAnswer properly saved!",msg:g.cannedAnswer.name?g.cannedAnswer.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCannedAnswer=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The cannedAnswer will be deleted.").ariaLabel("Delete CannedAnswer").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.cannedAnswer.delete({id:g.cannedAnswer.id}).$promise.then(function(){_.remove(g.cannedAnswers,{id:g.cannedAnswer.id}),o.success({title:"CannedAnswer properly deleted!",msg:(g.cannedAnswer.name||"cannedAnswer")+" has been deleted!"}),v(g.cannedAnswer)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.cannedAnswer.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.cannedAnswer.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","cannedAnswers","cannedAnswer","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCannedAnswerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_CUSTOMDASHBOARD",g.customDashboard=angular.copy(l),g.customDashboards=r,g.newCustomDashboard=!1,g.customDashboard||(g.customDashboard={},g.title="TOOLS.NEW_CUSTOMDASHBOARD",g.newCustomDashboard=!0),g.addNewCustomDashboard=function(){g.errors=[],d.dashboard.save(g.customDashboard).$promise.then(function(e){g.customDashboards.unshift(e.toJSON()),o.success({title:"CustomDashboard properly created",msg:g.customDashboard.name?g.customDashboard.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveCustomDashboard=function(){g.errors=[],d.dashboard.update({id:g.customDashboard.id},g.customDashboard).$promise.then(function(e){var t=_.find(g.customDashboards,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"CustomDashboard properly saved!",msg:g.customDashboard.name?g.customDashboard.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteCustomDashboard=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The customDashboard will be deleted.").ariaLabel("Delete CustomDashboard").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.dashboard.delete({id:g.customDashboard.id}).$promise.then(function(){_.remove(g.customDashboards,{id:g.customDashboard.id}),o.success({title:"CustomDashboard properly deleted!",msg:(g.customDashboard.name||"customDashboard")+" has been deleted!"}),v(g.customDashboard)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","customDashboards","customDashboard","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditCustomDashboardDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.customDashboards=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="customDashboards",b.listOrder="",b.listOrderAsc=null,b.selectedCustomDashboards=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editstate=function(e,t){n.go("app.tools.customDashboards.edit",{id:e.id,customDashboard:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:b.customDashboards?b.customDashboards.rows:[],crudPermissions:b.crudPermissions}})},b.gotodashboardgoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("customDashboard")+"?").htmlContent("<b>"+(e.name||"customDashboard")+"</b> will be deleted.").ariaLabel("delete customDashboard").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getCustomDashboards=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.dashboard.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="CustomDashboards",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditCustomDashboard=function(e,t){i.show({controller:"CreateOrEditCustomDashboardDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{customDashboard:t,customDashboards:b.customDashboards.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteCustomDashboard=S,b.exportSelectedCustomDashboards=function(){var e=angular.copy(b.selectedCustomDashboards);return b.selectedCustomDashboards=[],e},b.deleteSelectedCustomDashboards=function(e){var t=i.confirm().title("Are you sure want to delete the selected customDashboards?").htmlContent("<b>"+b.selectedCustomDashboards.length+" selected</b> will be deleted.").ariaLabel("delete CustomDashboards").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedCustomDashboards.forEach(function(e){S(e)}),b.selectedCustomDashboards=[]})},b.deselectCustomDashboards=function(){b.selectedCustomDashboards=[]},b.selectAllCustomDashboards=function(){b.selectedCustomDashboards=b.customDashboards.rows};var E=!0,A=1;function y(e){b.customDashboards=e||{count:0,rows:[]}}function S(e){m.dashboard.delete({id:e.id}).$promise.then(function(){_.remove(b.customDashboards.rows,{id:e.id}),b.customDashboards.count-=1,b.customDashboards.rows.length||b.getCustomDashboards(),p.success({title:_.startCase("CustomDashboard")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdashboard"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getCustomDashboards())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","customDashboards","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("CustomDashboardsController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newCustomDashboard=!0,r.customDashboard=angular.copy(i),r.customDashboards=s,r.title=o.instant("TOOLS.CLONE_CUSTOMDASHBOARD"),i&&i.name&&(r.title+=": "+i.name),r.cloneCustomDashboard=function(){return e.dashboard.clone({id:i.id,includeAll:!0},r.customDashboard).$promise.then(function(e){r.customDashboards.unshift(e.toJSON()),a.success({title:"CustomDashboard properly cloned",msg:r.customDashboard.name?r.customDashboard.name+" has been cloned!":""}),n.go("app.tools.customDashboards.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.dashboard.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboard.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","customDashboard","customDashboards","$translate"],angular.module("app.tools").controller("CustomDashboardcloneController",e)}(),function(){"use strict";function e(n,a,e,i,s){var o=this;function r(e,t,n){return s.dashboardItem.update(n).$promise.catch(function(e){console.error(e)})}o.customDashboard={},o.voiceQueues=s.rpc.getVoiceQueues({fields:"id,name"}),o.init=function(e,t){return o.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},o.customDashboard=e,o.customDashboard.draggable={enabled:!0,handle:".draggable",stop:r},o.customDashboard.resizable={enabled:!0,handle:".resizable",stop:r},o.customDashboard.widgets=[],s.dashboard.getItems({id:e.id}).$promise.then(function(e){if(e&&e.count&&e.rows)for(var t=0;t<e.rows.length;t+=1)e.rows[t].voiceQueues=o.voiceQueues,e.rows[t].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),e.rows[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+e.rows[t].type+"/ms-widget-engine."+e.rows[t].type+".html",o.customDashboard.widgets.push(e.rows[t])}).catch(function(e){console.error(e)})},o.createOrEditWidget=function(e){if(e&&e.attrs)for(var t=0;t<e.attrs.length;t+=1)"attrReport"===e.attrs[t].name&&(e.reportType=e.attrs[t].type),e[e.attrs[t].name]=e.attrs[t].value;n.show({controller:"CreateOrEditDashboardItemDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",parent:angular.element(a.body),clickOutsideToClose:!0,locals:{dashboarditem:e,dashboard:o.customDashboard.widgets,license:null,setting:null,crudPermissions:o.crudPermissions}}).then(function(e){if(e)for(var t=0;t<o.customDashboard.widgets.length;t+=1)o.customDashboard.widgets[t].id===e.id&&(o.customDashboard.widgets[t].attrs=e.attrs,o.customDashboard.widgets[t].voiceQueues=o.voiceQueues,o.customDashboard.widgets[t].voiceQueuesSelected=_.map(o.voiceQueues.rows,"id"),o.customDashboard.widgets[t].templateUrl="app/core/directives/ms-widget-engine/ms-widget-engine-"+o.customDashboard.widgets[t].type+"/ms-widget-engine."+o.customDashboard.widgets[t].type+".html")})},o.deleteWidget=function(t){var e=n.confirm().title("Would you like to delete "+t.title+"?").textContent("").ariaLabel("Delete Widget").ok("YES").cancel("NO");n.show(e).then(function(){return s.dashboardItem.delete({id:t.id}).$promise.then(function(e){_.remove(o.customDashboard.widgets,{id:t.id}),i.success({title:"Widget deleted!",msg:t.name?t.name+" has been deleted!":"Widget has been deleted!"})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){o.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETE.customDashboard"}];for(var t=0;t<e.data.errors.length;t++)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdashboard",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()});console.error(e)})})}}e.$inject=["$mdDialog","$document","socket","toasty","api"],angular.module("app.tools").controller("CustomDashboardItemsController",e)}(),function(){"use strict";function e(t,e,n,a,o,i,s,r,l,d,c,m,u,p){var g=this;g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DASHBOARDITEM",g.dashboarditem=angular.copy(l),g.dashboard=r,g.newDashboardItem=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.dashboarditem?"web-report"==g.dashboarditem.type&&(g.apiName="custom"===g.dashboarditem.reportType?"analyticCustomReport":"analyticDefaultReport",d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:g.dashboarditem.attrReport}),g.dashboarditem.report=g.currentReport.name,g.query.parent=g.currentReport.parent})):(g.dashboarditem={type:"counter",attrUrl:"https://",attrHourFormat:"HH:mm:ss",attrTimezone:"0.00",attrMetric:"total",attrSerie1:"total",attrSerie2:"null",attrSerie3:"null",attrRefresh:10,attrFontSize:20,foreground:"#2196f3",background:"#ffffff"},g.title="TOOLS.NEW_DASHBOARDITEM",g.newDashboardItem=!0),g.addNewDashboardItem=function(){g.errors=[],d.dashboard.addItem({id:e.params.id},g.dashboarditem).$promise.then(function(e){g.dashboard.unshift(e.toJSON()),s.success({title:"DashboardItem properly created",msg:g.dashboarditem.name?g.dashboarditem.name+" has been created!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDashboardItem=function(){g.errors=[],d.dashboardItem.update({id:g.dashboarditem.id},g.dashboarditem).$promise.then(function(e){var t=_.find(g.dashboard,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"DashboardItem properly saved!",msg:g.dashboarditem.name?g.dashboarditem.name+" has been saved!":""}),I(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDashboardItem=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The dashboarditem will be deleted.").ariaLabel("Delete DashboardItem").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.dashboardItem.delete({id:g.dashboarditem.id}).$promise.then(function(){_.remove(g.dashboard,{id:g.dashboarditem.id}),s.success({title:"DashboardItem properly deleted!",msg:(g.dashboarditem.name||"dashboarditem")+" has been deleted!"}),I(g.dashboarditem)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.dashboardItem.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.dashboardItem.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.selectReport=function(){if(g.dashboarditem.report=g.selectedReport[0].name,g.dashboarditem.attrReport=g.selectedReport[0].id,g.dashboarditem.reportType=g.currentNode.custom?"custom":"default",!g.newDashboardItem){var e={name:"attrReport",type:g.dashboarditem.reportType,value:g.selectedReport[0].id};g.dashboarditem.attrs.splice(_.findIndex(g.dashboarditem.attrs,1,e))}t.dashboarditemForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(t={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,t}).catch(function(e){s.error({title:"ERROR",msg:e.message})}):t),g.treeDefaultEvents=f(!1),g.treeCustomEvents=f(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var t},g.closeDialog=I,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})});var v=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],h=null;function f(e){return e?{loaded:A,select_node:b}:{loaded:y,select_node:E}}function b(e,t){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=t.node.id,S()}function E(e,t){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=t.node.id,S()}function A(){if(!g.newDashboardItem&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(!g.newDashboardItem&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);E(0,{node:e,selected:e.id})}}function S(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,T).$promise;else{if(!g.userProfileSection)return T(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,T).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),T({count:n.length,rows:n})}return T(null)}):T(null)}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function T(e){g.reports=e||{count:0,rows:[]},g.newDashboardItem||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function I(e){a.hide(e)}c.hasRole("admin")?d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){g.voiceQueues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEQUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){h=e.rows||[]}).then(function(){for(var e=[],t=0;t<v.length;t++)e.push(d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:v[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<v.length;a++){var i=_.find(t,["sectionId",v[a].id]);if(i)if(i.autoAssociation){var s=[];h.forEach(function(e){e.type===v[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(d.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;g.dashboarditem&&(n=_.find(h,{id:Number(g.dashboarditem.attrVoiceQueues)}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&h.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),g.voiceQueues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dashboard","dashboarditem","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDashboardItemDialogController",e)}(),function(){"use strict";function e(n,e,a,i,t,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.customDashboard=c||n.params.customDashboard||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.clonedialog=function(e,t){a.show({controller:"CustomDashboardcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/customDashboards/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{customDashboard:e,customDashboards:u.customDashboards?u.customDashboards.rows:[],crudPermissions:u.crudPermissions}})},u.gotogoto=function(e,t){n.go("app.dashboards.custom",{id:e.id})},u.alert=l.info,u.gotoCustomDashboards=function(){n.go("app.tools.customDashboards")},u.saveCustomDashboard=function(){r.dashboard.update({id:u.customDashboard.id},u.customDashboard).$promise.then(function(){l.success({title:"CustomDashboard updated!",msg:u.customDashboard.name?u.customDashboard.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETdashboard",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","customDashboard","userProfileSection"],angular.module("app.tools").controller("CustomDashboardController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_DISPOSITION",g.disposition=angular.copy(l),g.dispositions=r,g.newDisposition=!1,g.disposition||(g.disposition={},g.title="TOOLS.NEW_DISPOSITION",g.newDisposition=!0),g.addNewDisposition=function(){g.errors=[],d.disposition.save(g.disposition).$promise.then(function(e){g.dispositions.unshift(e.toJSON()),o.success({title:"Disposition properly created",msg:g.disposition.name?g.disposition.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveDisposition=function(){g.errors=[],d.disposition.update({id:g.disposition.id},g.disposition).$promise.then(function(e){var t=_.find(g.dispositions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Disposition properly saved!",msg:g.disposition.name?g.disposition.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteDisposition=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The disposition will be deleted.").ariaLabel("Delete Disposition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.disposition.delete({id:g.disposition.id}).$promise.then(function(){_.remove(g.dispositions,{id:g.disposition.id}),o.success({title:"Disposition properly deleted!",msg:(g.disposition.name||"disposition")+" has been deleted!"}),v(g.disposition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.disposition.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.disposition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","dispositions","disposition","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditDispositionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.dispositions=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="dispositions",b.listOrder="",b.listOrderAsc=null,b.selectedDispositions=[],b.query={fields:"createdAt,updatedAt,id,name",sort:"-updatedAt",MailAccountId:"null",FaxAccountId:"null",SmsAccountId:"null",OpenchannelAccountId:"null",ChatWebsiteId:"null",ListId:"null",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{disposition:e,dispositions:b.dispositions.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("disposition")+"?").htmlContent("<b>"+(e.name||"disposition")+"</b> will be deleted.").ariaLabel("delete disposition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getDispositions=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.disposition.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Dispositions",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditDisposition=function(e,t){i.show({controller:"CreateOrEditDispositionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/dispositions/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{disposition:t,dispositions:b.dispositions.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteDisposition=S,b.exportSelectedDispositions=function(){var e=angular.copy(b.selectedDispositions);return b.selectedDispositions=[],e},b.deleteSelectedDispositions=function(e){var t=i.confirm().title("Are you sure want to delete the selected dispositions?").htmlContent("<b>"+b.selectedDispositions.length+" selected</b> will be deleted.").ariaLabel("delete Dispositions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedDispositions.forEach(function(e){S(e)}),b.selectedDispositions=[]})},b.deselectDispositions=function(){b.selectedDispositions=[]},b.selectAllDispositions=function(){b.selectedDispositions=b.dispositions.rows};var E=!0,A=1;function y(e){b.dispositions=e||{count:0,rows:[]}}function S(e){m.disposition.delete({id:e.id}).$promise.then(function(){_.remove(b.dispositions.rows,{id:e.id}),b.dispositions.count-=1,b.dispositions.rows.length||b.getDispositions(),p.success({title:_.startCase("Disposition")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEdisposition"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEdisposition",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getDispositions())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","dispositions","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("DispositionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var t=_.find(g.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditAppintervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.interval={},c.intervalIntervals={count:0,rows:[]},c.selectedIntervalIntervals=[],c.crudPermissions,c.sortableTable={animation:100,onSort:function(e){l.interval.addIntervals({id:c.interval.id},e.models).$promise.then(function(e){c.intervalIntervals.rows=e}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:SORTABLETABLE",msg:e.data?JSON.stringify(e.data):e.toString()})})}},c.query={fields:"createdAt,updatedAt,id,name,interval",nolimit:"true",limit:10,page:1},c.init=function(e,t){c.interval=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.sortableTable.disabled=!c.crudPermissions.canEdit,c.query.id=c.interval.id,c.getIntervalIntervals()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the interval?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getIntervalIntervals=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.interval.getIntervals(c.query,p).$promise},c.createOrEditIntervalInterval=function(e,t){s.show({controller:"EditAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:c.interval,interval:t,intervals:c.intervalIntervals.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedIntervalIntervals=function(){var e=angular.copy(c.selectedIntervalIntervals);return c.selectedIntervalIntervals=[],e},c.deleteIntervalInterval=g,c.deleteSelectedIntervalIntervals=function(e){var t=s.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+c.selectedIntervalIntervals.length+" selected</b> will be deleted.").ariaLabel("delete intervals").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedIntervalIntervals.forEach(function(e){g(e)}),c.selectedIntervalIntervals=[]})};var m=!0,u=1;function p(e){c.intervalIntervals=e||{count:0,rows:[]}}function g(e){l.interval.delete({id:e.id}).$promise.then(function(){_.remove(c.intervalIntervals.rows,{id:e.id}),c.intervalIntervals.count-=1,c.intervalIntervals.rows.length||c.getIntervalIntervals(),r.success({title:"Interval deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETinterval"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getIntervalIntervals())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("IntervalIntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_INTERVAL",g.interval=angular.copy(l),g.intervals=r,g.newInterval=!1,g.interval||(g.interval={},g.title="TOOLS.NEW_INTERVAL",g.newInterval=!0),g.addNewInterval=function(){g.errors=[],d.interval.save(g.interval).$promise.then(function(e){g.intervals.unshift(e.toJSON()),o.success({title:"Interval properly created",msg:g.interval.name?g.interval.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInterval=function(){g.errors=[],d.interval.update({id:g.interval.id},g.interval).$promise.then(function(e){var t=_.find(g.intervals,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Interval properly saved!",msg:g.interval.name?g.interval.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInterval=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The interval will be deleted.").ariaLabel("Delete Interval").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.interval.delete({id:g.interval.id}).$promise.then(function(){_.remove(g.intervals,{id:g.interval.id}),o.success({title:"Interval properly deleted!",msg:(g.interval.name||"interval")+" has been deleted!"}),v(g.interval)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.interval.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.interval.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","intervals","interval","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditIntervalDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.interval=c||e.params.interval||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoIntervals=function(){e.go("app.tools.intervals")},u.saveInterval=function(){r.interval.update({id:u.interval.id},u.interval).$promise.then(function(){l.success({title:"Interval updated!",msg:u.interval.name?u.interval.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETinterval",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","interval","userProfileSection"],angular.module("app.tools").controller("IntervalController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.intervals=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="intervals",b.listOrder="",b.listOrderAsc=null,b.selectedIntervals=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",IntervalId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.tools.intervals.edit",{id:e.id,interval:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("interval")+"?").htmlContent("<b>"+(e.name||"interval")+"</b> will be deleted.").ariaLabel("delete interval").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getIntervals=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.interval.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Intervals",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInterval=function(e,t){i.show({controller:"CreateOrEditIntervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/intervals/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:t,intervals:b.intervals.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInterval=S,b.exportSelectedIntervals=function(){var e=angular.copy(b.selectedIntervals);return b.selectedIntervals=[],e},b.deleteSelectedIntervals=function(e){var t=i.confirm().title("Are you sure want to delete the selected intervals?").htmlContent("<b>"+b.selectedIntervals.length+" selected</b> will be deleted.").ariaLabel("delete Intervals").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedIntervals.forEach(function(e){S(e)}),b.selectedIntervals=[]})},b.deselectIntervals=function(){b.selectedIntervals=[]},b.selectAllIntervals=function(){b.selectedIntervals=b.intervals.rows};var E=!0,A=1;function y(e){b.intervals=e||{count:0,rows:[]}}function S(e){m.interval.delete({id:e.id}).$promise.then(function(){_.remove(b.intervals.rows,{id:e.id}),b.intervals.count-=1,b.intervals.rows.length||b.getIntervals(),p.success({title:_.startCase("Interval")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEinterval"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEinterval",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getIntervals())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","intervals","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("IntervalsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_PAUSE",g.pause=angular.copy(l),g.pauses=r,g.newPause=!1,g.pause||(g.pause={},g.title="TOOLS.NEW_PAUSE",g.newPause=!0),g.addNewPause=function(){g.errors=[],d.pause.save(g.pause).$promise.then(function(e){g.pauses.unshift(e.toJSON()),o.success({title:"Pause properly created",msg:g.pause.name?g.pause.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savePause=function(){g.errors=[],d.pause.update({id:g.pause.id},g.pause).$promise.then(function(e){var t=_.find(g.pauses,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Pause properly saved!",msg:g.pause.name?g.pause.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletePause=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The pause will be deleted.").ariaLabel("Delete Pause").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.pause.delete({id:g.pause.id}).$promise.then(function(){_.remove(g.pauses,{id:g.pause.id}),o.success({title:"Pause properly deleted!",msg:(g.pause.name||"pause")+" has been deleted!"}),v(g.pause)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.pause.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.pause.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","pauses","pause","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditPauseDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.pauses=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="pauses",b.listOrder="",b.listOrderAsc=null,b.selectedPauses=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{pause:e,pauses:b.pauses.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("pause")+"?").htmlContent("<b>"+(e.name||"pause")+"</b> will be deleted.").ariaLabel("delete pause").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getPauses=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.pause.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Pauses",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditPause=function(e,t){i.show({controller:"CreateOrEditPauseDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/pauses/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{pause:t,pauses:b.pauses.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletePause=S,b.exportSelectedPauses=function(){var e=angular.copy(b.selectedPauses);return b.selectedPauses=[],e},b.deleteSelectedPauses=function(e){var t=i.confirm().title("Are you sure want to delete the selected pauses?").htmlContent("<b>"+b.selectedPauses.length+" selected</b> will be deleted.").ariaLabel("delete Pauses").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedPauses.forEach(function(e){S(e)}),b.selectedPauses=[]})},b.deselectPauses=function(){b.selectedPauses=[]},b.selectAllPauses=function(){b.selectedPauses=b.pauses.rows};var E=!0,A=1;function y(e){b.pauses=e||{count:0,rows:[]}}function S(e){m.pause.delete({id:e.id}).$promise.then(function(){_.remove(b.pauses.rows,{id:e.id}),b.pauses.count-=1,b.pauses.rows.length||b.getPauses(),p.success({title:_.startCase("Pause")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEpause"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEpause",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getPauses())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","pauses","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("PausesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;if(g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SCHEDULE",g.schedule=angular.copy(l),g.schedules=r,g.newSchedule=!1,g.selectedReport=[],g.query={fields:"createdAt,updatedAt,id,name,description,table,parent,conditions,joins",limit:10,page:1,sort:"-updatedAt"},g.schedule){g.apiName=g.schedule.DefaultReportId?"analyticDefaultReport":"analyticCustomReport";var v=g.schedule.DefaultReportId?g.schedule.DefaultReportId:g.schedule.CustomReportId;d[g.apiName].get({fields:"id,name,parent"}).$promise.then(function(e){g.currentReport=_.find(e.rows,{id:v}),g.schedule.report=g.currentReport.name,g.query.parent=g.currentReport.parent})}else g.schedule={output:"xlsx",active:!0,startAt:new Date,endAt:new Date(Date.now()+2592e6),cron:"0 0 * * *",subtractNumber:1,subtractUnit:"days",sendMail:!1,sendIfEmpty:!0},g.title="TOOLS.NEW_SCHEDULE",g.newSchedule=!0;function h(e){return e?{loaded:E,select_node:f}:{loaded:A,select_node:b}}function f(e,t){g.treeDefaultInstance.jstree(!0).deselect_all(),g.treeDefaultInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!0,g.currentPath=g.treeCustomInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticCustomReport",g.query.parent=t.node.id,y()}function b(e,t){g.treeCustomInstance.jstree(!0).deselect_all(),g.treeCustomInstance.jstree(!0).close_all(),g.currentNode=t.node,g.currentNode.custom=!1,g.currentPath=g.treeDefaultInstance.jstree(!0).get_path(g.currentNode).join("/ "),g.apiName="analyticDefaultReport",g.query.parent=t.node.id,y()}function E(){if(!g.newSchedule&&"analyticCustomReport"===g.apiName){var e=g.treeCustomInstance.jstree(!0).get_node(g.query.parent);f(0,{node:e,selected:e.id})}}function A(){if(!g.newSchedule&&"analyticDefaultReport"===g.apiName){var e=g.treeDefaultInstance.jstree(!0).get_node(g.query.parent);b(0,{node:e,selected:e.id})}}function y(){if(g.query.offset=(g.query.page-1)*g.query.limit,g.apiName)if("admin"===g.currentUser.role)g.promise=d[g.apiName].get(g.query,S).$promise;else{if(!g.userProfileSection)return S(null);if(g.userProfileSection.autoAssociation)g.promise=d[g.apiName].get(g.query,S).$promise;else{var a=[];g.promise=d[g.apiName].get(g.query).$promise.then(function(e){return 0<(a=e&&e.rows?e.rows:[]).length?d.userProfileResource.get({sectionId:g.userProfileSection.id,type:"analyticDefaultReport"===g.apiName?"DefaultReports":"CustomReports"}).$promise.then(function(e){var t=e&&e.rows?e.rows:[];if(0<t.length){var n=[];return a.forEach(function(e){_.find(t,["resourceId",e.id])&&n.push(e)}),S({count:n.length,rows:n})}return S(null)}):S(null)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_REPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})})}}}function S(e){g.reports=e||{count:0,rows:[]},g.newSchedule||g.selectedReport.push(_.find(g.reports.rows,{id:g.currentReport.id}))}function T(e){a.hide(e)}g.addNewSchedule=function(){g.errors=[],d.schedule.save(g.schedule).$promise.then(function(e){g.schedules.unshift(e.toJSON()),o.success({title:"Schedule properly created",msg:g.schedule.name?g.schedule.name+" has been created!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSchedule=function(){g.errors=[],d.schedule.update({id:g.schedule.id},g.schedule).$promise.then(function(e){var t=_.find(g.schedules,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Schedule properly saved!",msg:g.schedule.name?g.schedule.name+" has been saved!":""}),T(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSchedule=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The schedule will be deleted.").ariaLabel("Delete Schedule").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.schedule.delete({id:g.schedule.id}).$promise.then(function(){_.remove(g.schedules,{id:g.schedule.id}),o.success({title:"Schedule properly deleted!",msg:(g.schedule.name||"schedule")+" has been deleted!"}),T(g.schedule)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.schedule.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.schedule.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.selectReport=function(){g.schedule.report=g.selectedReport[0].name,g.currentNode.custom?(g.schedule.CustomReportId=g.selectedReport[0].id,delete g.schedule.DefaultReportId):(g.schedule.DefaultReportId=g.selectedReport[0].id,delete g.schedule.CustomReportId);e.scheduleForm.report.$setDirty(),a.hide()},g.closeReportDialog=function(){a.hide()},g.searchReport=function(){g.treeDefaultData=g.treeReports[0]?angular.fromJson(g.treeReports[0].tree):[],g.treeCustomData=g.treeReports[1]?angular.fromJson(g.treeReports[1].tree):[],g.treeConfig=(t={core:{multiple:!1,animation:!0,error:function(e){console.error("treeCtrl: error from js tree - "+angular.toJson(e))},check_callback:!0,worker:!0},version:1,plugins:["wholerow"]},"admin"!==g.currentUser.role?d.userProfileSection.get({fields:"id,name,enabled,includeAll,autoAssociation,crudPermissions",userProfileId:g.currentUser.userProfileId,sectionId:1203}).$promise.then(function(e){return g.userProfileSection=e&&1==e.count?e.rows[0]:null,t}).catch(function(e){o.error({title:"ERROR",msg:e.message})}):t),g.treeDefaultEvents=h(!1),g.treeCustomEvents=h(!0),a.show({controller:function(){return g},controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",autoWrap:!0,skipHide:!0});var t},g.closeDialog=T,d.analyticTreeReport.get({}).$promise.then(function(e){g.treeReports=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.hasRole("admin")?d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.mailAccounts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.mailAccounts,{id:e.resourceId})}),n=null;if(g.schedule&&(n=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}g.mailAccounts=t})}else{var n=[],a=null;g.schedule&&(a=_.find(g.mailAccounts,{id:Number(g.schedule.MailAccountId)}));for(var i=0;i<g.mailAccounts.length;i++)a&&g.mailAccounts[i].id===a.id&&(g.mailAccounts[i].canSelect=!1,n.push(g.mailAccounts[i]));g.mailAccounts=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","schedules","schedule","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditScheduleDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.schedules=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="schedules",b.listOrder="",b.listOrderAsc=null,b.selectedScheduler=[],b.query={fields:"createdAt,updatedAt,id,name,CustomReportId,DefaultReportId,output,active,startAt,endAt,cron,subtractNumber,subtractUnit,sendMail,MailAccountId,email,cc,bcc,sendIfEmpty,description",sort:"-updatedAt",limit:10,page:1},b.arrayoutput=_.keyBy([{option:"CSV",value:"'csv'"},{option:"PDF",value:"'pdf'"},{option:"Excel",value:"'xlsx'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysubtractUnit=_.keyBy([{option:"Minutes",value:"'minutes'"},{option:"Hours",value:"'hours'"},{option:"Days",value:"'days'"},{option:"Weeks",value:"'weeks'"},{option:"Months",value:"'months'"},{option:"Quarters",value:"'quarters'"},{option:"Years",value:"'years'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{schedule:e,schedules:b.schedules.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.runconfirm=function(e,t){var n=i.confirm().title("Are you sure want to run the schedule?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be run.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){return m.schedule.run({id:e.id}).$promise},function(){console.log("CANCEL")})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("schedule")+"?").htmlContent("<b>"+(e.name||"schedule")+"</b> will be deleted.").ariaLabel("delete schedule").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getScheduler=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.schedule.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Scheduler",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSchedule=function(e,t){i.show({controller:"CreateOrEditScheduleDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/schedules/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{schedule:t,schedules:b.schedules.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSchedule=S,b.exportSelectedScheduler=function(){var e=angular.copy(b.selectedScheduler);return b.selectedScheduler=[],e},b.deleteSelectedScheduler=function(e){var t=i.confirm().title("Are you sure want to delete the selected schedules?").htmlContent("<b>"+b.selectedScheduler.length+" selected</b> will be deleted.").ariaLabel("delete Schedules").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedScheduler.forEach(function(e){S(e)}),b.selectedScheduler=[]})},b.deselectScheduler=function(){b.selectedScheduler=[]},b.selectAllScheduler=function(){b.selectedScheduler=b.schedules.rows},m.analyticTreeReport.get({}).$promise.then(function(e){b.treeReports=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TREEREPORTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),g.hasRole("admin")?m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.mailAccounts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.mailAccount.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.mailAccounts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.mailAccounts,{id:e.resourceId})}),n=null;if(b.schedule&&(n=_.find(b.mailAccounts,{id:Number(b.schedule.MailAccountId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}b.mailAccounts=t})}else{var n=[],a=null;b.schedule&&(a=_.find(b.mailAccounts,{id:Number(b.schedule.MailAccountId)}));for(var i=0;i<b.mailAccounts.length;i++)a&&b.mailAccounts[i].id===a.id&&(b.mailAccounts[i].canSelect=!1,n.push(b.mailAccounts[i]));b.mailAccounts=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.schedules=e||{count:0,rows:[]}}function S(e){m.schedule.delete({id:e.id}).$promise.then(function(){_.remove(b.schedules.rows,{id:e.id}),b.schedules.count-=1,b.schedules.rows.length||b.getScheduler(),p.success({title:_.startCase("Schedule")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEschedule"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEschedule",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getScheduler())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","schedules","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SchedulesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_SOUND",g.sound=angular.copy(l),g.sounds=r,g.newSound=!1,g.sound||(g.sound={},g.title="TOOLS.NEW_SOUND",g.newSound=!0),g.addNewSound=function(){g.errors=[],d.sound.save(g.sound).$promise.then(function(e){g.sounds.unshift(e.toJSON()),o.success({title:"Sound properly created",msg:g.sound.name?g.sound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveSound=function(){g.errors=[],d.sound.update({id:g.sound.id},g.sound).$promise.then(function(e){var t=_.find(g.sounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Sound properly saved!",msg:g.sound.name?g.sound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteSound=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The sound will be deleted.").ariaLabel("Delete Sound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.sound.delete({id:g.sound.id}).$promise.then(function(){_.remove(g.sounds,{id:g.sound.id}),o.success({title:"Sound properly deleted!",msg:(g.sound.name||"sound")+" has been deleted!"}),v(g.sound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.sound.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","sounds","sound","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.sounds=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="sounds",b.listOrder="",b.listOrderAsc=null,b.selectedSounds=[],b.query={fields:"createdAt,updatedAt,id,save_name,converted_format,name,audio,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{sound:e,sounds:b.sounds.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.downloadfile2=function(s,e){return m.sound.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.sound.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("sound")+"?").htmlContent("<b>"+(e.name||"sound")+"</b> will be deleted.").ariaLabel("delete sound").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getSounds=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.sound.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Sounds",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditSound=function(e,t){i.show({controller:"CreateOrEditSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sound:t,sounds:b.sounds.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteSound=S,b.exportSelectedSounds=function(){var e=angular.copy(b.selectedSounds);return b.selectedSounds=[],e},b.deleteSelectedSounds=function(e){var t=i.confirm().title("Are you sure want to delete the selected sounds?").htmlContent("<b>"+b.selectedSounds.length+" selected</b> will be deleted.").ariaLabel("delete Sounds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedSounds.forEach(function(e){S(e)}),b.selectedSounds=[]})},b.deselectSounds=function(){b.selectedSounds=[]},b.selectAllSounds=function(){b.selectedSounds=b.sounds.rows},b.uploadSound=function(e){i.show({controller:"UploadSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/sounds/upload/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{sounds:b.sounds.rows}})};var E=!0,A=1;function y(e){b.sounds=e||{count:0,rows:[]}}function S(e){m.sound.delete({id:e.id}).$promise.then(function(){_.remove(b.sounds.rows,{id:e.id}),b.sounds.count-=1,b.sounds.rows.length||b.getSounds(),p.success({title:_.startCase("Sound")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEsound"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEsound",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getSounds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","sounds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("SoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this,r=15,l=1024*r*1024;o.currentUser=s.getCurrentUser(),o.errors=[],o.title="TOOLS.UPLOAD_SOUND",o.sounds=a,o.uploadSounds=[],o.uploadState="none",o.sound={},o.ngFlowOptions={maxChunkRetries:1,chunkSize:l,simultaneousUploads:1,testChunks:!1,progressCallbacksInterval:1e3,allowDuplicateUploads:!0,target:"api/sounds"},o.ngFlow={flow:{}},o.dropping=!1,o.fileAdded=function(e){var t=["wav","mp3","gsm"];if(!_.includes(t,e.getExtension()))return n.error({title:"Invalid extension: "+e.getExtension(),msg:"Supported extension: "+t.join()}),!1;if(e.size>l)return n.error({title:"File too big",msg:"The max allowed size is "+r+"MB"}),!1;return o.sound={id:e.uniqueIdentifier,file:e},o.uploadSounds.unshift(o.sound),!0},o.upload=function(){o.uploadState="uploading",o.ngFlow.flow.opts.headers={"X-Requested-With":"XMLHttpRequest",Authorization:"Bearer "+e.get("motion.token")},o.ngFlow.flow.opts.query={role:o.currentUser.role,userProfileId:o.currentUser.userProfileId},o.ngFlow.flow.upload()},o.fileSuccess=function(a,e){o.sounds.unshift(JSON.parse(e)),angular.forEach(o.uploadSounds,function(t,e){if(t.id===a.uniqueIdentifier){var n=new FileReader;n.readAsDataURL(t.file.file),n.onload=function(e){t.url=e.target.result}}})},o.uploadError=function(e,t){o.ngFlow.flow.cancel(),n.error({title:"Upload error",msg:"Cannot upload the sound"}),o.uploadState="failed"},o.uploadComplete=function(){"failed"!==o.uploadState&&(o.uploadState="completed",n.success({title:"Upload completed",msg:o.sound.file.name+" uploaded successfully"}))},o.closeDialog=function(){t.hide()}}e.$inject=["$cookies","$mdDialog","toasty","sounds","api","Auth"],angular.module("app.tools").controller("UploadSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TAG",g.tag=angular.copy(l),g.tags=r,g.newTag=!1,g.tag||(g.tag={},g.title="TOOLS.NEW_TAG",g.newTag=!0),g.addNewTag=function(){g.errors=[],d.tag.save(g.tag).$promise.then(function(e){g.tags.unshift(e.toJSON()),o.success({title:"Tag properly created",msg:g.tag.name?g.tag.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTag=function(){g.errors=[],d.tag.update({id:g.tag.id},g.tag).$promise.then(function(e){var t=_.find(g.tags,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Tag properly saved!",msg:g.tag.name?g.tag.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTag=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The tag will be deleted.").ariaLabel("Delete Tag").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.tag.delete({id:g.tag.id}).$promise.then(function(){_.remove(g.tags,{id:g.tag.id}),o.success({title:"Tag properly deleted!",msg:(g.tag.name||"tag")+" has been deleted!"}),v(g.tag)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.tag.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.tag.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","tags","tag","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTagDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.tags=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="tags",b.listOrder="",b.listOrderAsc=null,b.selectedTags=[],b.query={fields:"createdAt,updatedAt,id,name,description,color",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{tag:e,tags:b.tags.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("tag")+"?").htmlContent("<b>"+(e.name||"tag")+"</b> will be deleted.").ariaLabel("delete tag").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTags=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.tag.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Tags",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTag=function(e,t){i.show({controller:"CreateOrEditTagDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/tags/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{tag:t,tags:b.tags.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTag=S,b.exportSelectedTags=function(){var e=angular.copy(b.selectedTags);return b.selectedTags=[],e},b.deleteSelectedTags=function(e){var t=i.confirm().title("Are you sure want to delete the selected tags?").htmlContent("<b>"+b.selectedTags.length+" selected</b> will be deleted.").ariaLabel("delete Tags").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTags.forEach(function(e){S(e)}),b.selectedTags=[]})},b.deselectTags=function(){b.selectedTags=[]},b.selectAllTags=function(){b.selectedTags=b.tags.rows};var E=!0,A=1;function y(e){b.tags=e||{count:0,rows:[]}}function S(e){m.tag.delete({id:e.id}).$promise.then(function(){_.remove(b.tags.rows,{id:e.id}),b.tags.count-=1,b.tags.rows.length||b.getTags(),p.success({title:_.startCase("Tag")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtag"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtag",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTags())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","tags","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TagsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TEMPLATE",g.template=angular.copy(l),g.templates=r,g.newTemplate=!1,g.template||(g.template={},g.title="TOOLS.NEW_TEMPLATE",g.newTemplate=!0),g.addNewTemplate=function(){g.errors=[],d.template.save(g.template).$promise.then(function(e){g.templates.unshift(e.toJSON()),o.success({title:"Template properly created",msg:g.template.name?g.template.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTemplate=function(){g.errors=[],d.template.update({id:g.template.id},g.template).$promise.then(function(e){var t=_.find(g.templates,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Template properly saved!",msg:g.template.name?g.template.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTemplate=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The template will be deleted.").ariaLabel("Delete Template").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.template.delete({id:g.template.id}).$promise.then(function(){_.remove(g.templates,{id:g.template.id}),o.success({title:"Template properly deleted!",msg:(g.template.name||"template")+" has been deleted!"}),v(g.template)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.template.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.template.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","templates","template","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTemplateDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.templates=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="templates",b.listOrder="",b.listOrderAsc=null,b.selectedTemplates=[],b.query={fields:"createdAt,updatedAt,id,name,html,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{template:e,templates:b.templates.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("template")+"?").htmlContent("<b>"+(e.name||"template")+"</b> will be deleted.").ariaLabel("delete template").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTemplates=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.template.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Templates",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTemplate=function(e,t){i.show({controller:"CreateOrEditTemplateDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/templates/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{template:t,templates:b.templates.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTemplate=S,b.exportSelectedTemplates=function(){var e=angular.copy(b.selectedTemplates);return b.selectedTemplates=[],e},b.deleteSelectedTemplates=function(e){var t=i.confirm().title("Are you sure want to delete the selected templates?").htmlContent("<b>"+b.selectedTemplates.length+" selected</b> will be deleted.").ariaLabel("delete Templates").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTemplates.forEach(function(e){S(e)}),b.selectedTemplates=[]})},b.deselectTemplates=function(){b.selectedTemplates=[]},b.selectAllTemplates=function(){b.selectedTemplates=b.templates.rows};var E=!0,A=1;function y(e){b.templates=e||{count:0,rows:[]}}function S(e){m.template.delete({id:e.id}).$promise.then(function(){_.remove(b.templates.rows,{id:e.id}),b.templates.count-=1,b.templates.rows.length||b.getTemplates(),p.success({title:_.startCase("Template")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtemplate"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtemplate",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTemplates())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","templates","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TemplatesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRIGGER",g.trigger=angular.copy(l),g.triggers=r,g.newTrigger=!1,g.trigger||(g.trigger={channel:"voice"},g.title="TOOLS.NEW_TRIGGER",g.newTrigger=!0),g.addNewTrigger=function(){g.errors=[],d.trigger.save(g.trigger).$promise.then(function(e){g.triggers.unshift(e.toJSON()),o.success({title:"Trigger properly created",msg:g.trigger.name?g.trigger.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrigger=function(){g.errors=[],d.trigger.update({id:g.trigger.id},g.trigger).$promise.then(function(e){var t=_.find(g.triggers,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Trigger properly saved!",msg:g.trigger.name?g.trigger.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrigger=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The trigger will be deleted.").ariaLabel("Delete Trigger").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.trigger.delete({id:g.trigger.id}).$promise.then(function(){_.remove(g.triggers,{id:g.trigger.id}),o.success({title:"Trigger properly deleted!",msg:(g.trigger.name||"trigger")+" has been deleted!"}),v(g.trigger)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trigger.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trigger.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","triggers","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTriggerDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerActions={count:0,rows:[]},c.selectedTriggerActions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,action,data1,data2,data7,data3,data4,data5,data6",limit:10,page:1},c.arrayaction=_.keyBy([{option:"CONTACT_MANAGER",value:"'contactManager'",ngIf:"vm.trigger.channel == 'voice'"},{option:"INTEGRATIONS",value:"'integration'",ngIf:"vm.trigger.channel == 'voice' && ((vm.newAction && vm.hasModulePermissions.Integrations) || !vm.newAction)"},{option:"MOTION_BAR",value:"'motionbar'"},{option:"JSCRIPTY",value:"'jscripty'"},{option:"URL_FORWARD",value:"'urlForward'"},{option:"BROWSER",value:"'browser'"},{option:"BOT",value:"'bot'",ngIf:"vm.trigger.channel == 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.browserValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.autoCreateContact=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.urlForwardValues=_.keyBy([{option:"GET",value:"'GET'"},{option:"POST",value:"'POST'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.integrationValues=_.keyBy([{option:"Zendesk",value:"'zendesk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1301])"},{option:"Salesforce",value:"'salesforce'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1302])"},{option:"SugarCRM",value:"'sugarcrm'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1305])"},{option:"Freshdesk",value:"'freshdesk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1303])"},{option:"Desk",value:"'desk'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1306])"},{option:"Zoho",value:"'zoho'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1307])"},{option:"vTiger",value:"'vtiger'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1308])"},{option:"Dynamics365",value:"'dynamics365'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1309])"},{option:"ServiceNow",value:"'servicenow'",ngIf:"(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction",disabled:"(!vm.newAction && !vm.hasSectionPermissions[1310])"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.motionbarValues=_.keyBy([{option:"Popup",value:"'0'"},{option:"CTI URL",value:"'1'"},{option:"Windows App",value:"'2'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.eventVariables=_.keyBy([{option:"yes",value:"'1'"},{option:"no",value:"'0'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.location=_.keyBy([{option:"NEW_TAB",value:"'0'"},{option:"NEW_WINDOW",value:"'1'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.ActionId=c.trigger.id,c.getTriggerActions(),n=[1301,1302,1303,1305,1306,1307,1308],d.hasModulesPermissions(["Integrations"]).then(function(e){c.hasModulePermissions=_.merge(c.hasModulePermissions,e)}).then(function(){d.hasSectionsPermissions(n).then(function(e){c.hasSectionPermissions=_.merge(c.hasSectionPermissions,e)})}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTEGRATIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})});var n},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the action?").htmlContent("<b>"+(e.name||"action")+"</b> will be deleted.").ariaLabel("delete action").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.success=p,c.getTriggerActions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getActions(c.query,p).$promise},c.createOrEditTriggerAction=function(e,t){s.show({controller:"CreateOrEditActionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/actions/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,action:t,actions:c.triggerActions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerActions=function(){var e=angular.copy(c.selectedTriggerActions);return c.selectedTriggerActions=[],e},c.deleteTriggerAction=g,c.deleteSelectedTriggerActions=function(e){var t=s.confirm().title("Are you sure want to delete the selected actions?").htmlContent("<b>"+c.selectedTriggerActions.length+" selected</b> will be deleted.").ariaLabel("delete actions").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedTriggerActions.forEach(function(e){g(e)}),c.selectedTriggerActions=[]})},d.hasRole("admin")?l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.lists=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.lists,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var t=_.find(c.lists,{id:Number(e.data1)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.lists,{id:e.id});t.canSelect=!1,n.push(t)}}),c.lists=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("contactManager"===e.action){var t=_.find(c.lists,{id:Number(e.data1)});a.push(t)}});for(var i=0;i<c.lists.length;i++){_.some(a,{id:c.lists[i].id})&&(c.lists[i].canSelect=!1,n.push(c.lists[i]))}c.lists=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){c.projects=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.projects,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var t=_.find(c.projects,{id:Number(e.data1)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.projects,{id:e.id});t.canSelect=!1,n.push(t)}}),c.projects=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("jscripty"===e.action){var t=_.find(c.projects,{id:Number(e.data1)});a.push(t)}});for(var i=0;i<c.projects.length;i++){_.some(a,{id:c.projects[i].id})&&(c.projects[i].canSelect=!1,n.push(c.projects[i]))}c.projects=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCEACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intVtigerAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.vtigerAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDynamics365Account.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.dynamics365Accounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intServicenowAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.servicenowAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zendeskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.deskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.zohoConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.salesforceConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCECONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.sugarcrmConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.freshdeskConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intVtigerConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.vtigerConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intDynamics365Configuration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.dynamics365Configurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),l.intServicenowConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){c.servicenowConfigurations=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.templates=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.templates,{id:e.resourceId})}),a=null;a=[],c.triggerActions.rows.forEach(function(e){if("motionbar"===e.action){var t=_.find(c.templates,{id:Number(e.data2)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.templates,{id:e.id});t.canSelect=!1,n.push(t)}}),c.templates=n})}else{var n=[],a=[];c.triggerActions.rows.forEach(function(e){if("motionbar"===e.action){var t=_.find(c.templates,{id:Number(e.data2)});a.push(t)}});for(var i=0;i<c.templates.length;i++){_.some(a,{id:c.templates[i].id})&&(c.templates[i].canSelect=!1,n.push(c.templates[i]))}c.templates=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.triggerActions=e||{count:0,rows:[]}}function g(e){l.action.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerActions.rows,{id:e.id}),c.triggerActions.count-=1,c.triggerActions.rows.length||c.getTriggerActions(),r.success({title:"Action deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getTriggerActions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerActionsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g){var v=this;function h(e){a.hide(e)}v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ACTION",v.action=angular.copy(l),v.actions=r,v.newAction=!1,v.trigger=angular.copy(d),v.action||(v.action={data3:"0",data4:"0",data5:"800",data6:"600"},v.title="TOOLS.NEW_ACTION",v.newAction=!0),t.params.id&&(v.action.ActionId=t.params.id),v.addNewAction=function(){v.errors=[],c.trigger.addAction({id:t.params.id},v.action).$promise.then(function(e){v.actions.unshift(e.toJSON()),o.success({title:"Action properly created",msg:v.action.name?v.action.name+" has been created!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAction=function(){v.errors=[],c.action.update({id:v.action.id},v.action).$promise.then(function(e){var t=_.find(v.actions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Action properly saved!",msg:v.action.name?v.action.name+" has been saved!":""}),h(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAction=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The action will be deleted.").ariaLabel("Delete Action").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.action.delete({id:v.action.id}).$promise.then(function(){_.remove(v.actions,{id:v.action.id}),o.success({title:"Action properly deleted!",msg:(v.action.name||"action")+" has been deleted!"}),h(v.action)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.action.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.action.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.onActionInit=function(){m.hasModulesPermissions(["Integrations"]).then(function(e){v.hasModulePermissions=_.merge(v.hasModulePermissions,e)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MODULES_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.onIntegrationInit=function(){m.hasSectionsPermissions([1301,1302,1303,1305,1306,1307,1308,1309,1310]).then(function(e){v.hasSectionPermissions=_.merge(v.hasSectionPermissions,e)}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SECTIONS_PERMISSIONS",msg:e.data?JSON.stringify(e.data):e.toString()})})},v.closeDialog=h,m.hasRole("admin")?c.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.lists=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_LISTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.cmList.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.lists=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:301}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.lists,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.lists,{id:Number(v.action.data1)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.lists,{id:n.id});a.canSelect=!1,t.push(a)}v.lists=t})}else{var n=[],a=null;v.action&&(a=_.find(v.lists,{id:Number(v.action.data1)}));for(var i=0;i<v.lists.length;i++)a&&v.lists[i].id===a.id&&(v.lists[i].canSelect=!1,n.push(v.lists[i]));v.lists=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETlists",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.projects=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.jscriptyProject.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){v.projects=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:1701}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.projects,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.projects,{id:Number(v.action.data1)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.projects,{id:n.id});a.canSelect=!1,t.push(a)}v.projects=t})}else{var n=[],a=null;v.action&&(a=_.find(v.projects,{id:Number(v.action.data1)}));for(var i=0;i<v.projects.length;i++)a&&v.projects[i].id===a.id&&(v.projects[i].canSelect=!1,n.push(v.projects[i]));v.projects=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zendeskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.deskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zohoAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.salesforceAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCEACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.sugarcrmAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.freshdeskAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.vtigerAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Account.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.dynamics365Accounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365ACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.servicenowAccounts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZendeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zendeskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZENDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.deskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intZohoConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.zohoConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_ZOHOCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSalesforceConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.salesforceConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SALESFORCECONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intSugarcrmConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.sugarcrmConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SUGARCRMCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intFreshdeskConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.freshdeskConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FRESHDESKCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intVtigerConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.vtigerConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VTIGERCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intDynamics365Configuration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.dynamics365Configurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_DYNAMICS365CONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),c.intServicenowConfiguration.get({fields:"id,name,AccountId",sort:"id",nolimit:"true"}).$promise.then(function(e){v.servicenowConfigurations=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SERVICENOWCONFIGURATIONS",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.templates=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEMPLATES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.template.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.templates=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:1009}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.templates,{id:e.resourceId})}),n=null;if(v.action&&(n=_.find(v.templates,{id:Number(v.action.data2)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.templates,{id:n.id});a.canSelect=!1,t.push(a)}v.templates=t})}else{var n=[],a=null;v.action&&(a=_.find(v.templates,{id:Number(v.action.data2)}));for(var i=0;i<v.templates.length;i++)a&&v.templates[i].id===a.id&&(v.templates[i].canSelect=!1,n.push(v.templates[i]));v.templates=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtemplates",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","actions","action","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditActionDialogController",e)}(),function(){"use strict";function e(e,t,n,o,a,i,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAllConditions={count:0,rows:[]},c.selectedTriggerAllConditions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,field,operator,value",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.TriggerAllId=c.trigger.id,c.getTriggerAllConditions()},c.deleteConfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the allCondition?").htmlContent("<b>"+(e.name||"allCondition")+"</b> will be deleted.").ariaLabel("delete allCondition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},c.success=v,c.getTriggerAllConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAllConditions(c.query,v).$promise},c.createOrEditTriggerAllCondition=function(e,t){i.show({controller:"CreateOrEditAllConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,allCondition:t,allconditions:c.triggerAllConditions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerAllConditions=function(){var e=angular.copy(c.selectedTriggerAllConditions);return c.selectedTriggerAllConditions=[],e},c.deleteTriggerAllCondition=h,c.deleteSelectedTriggerAllConditions=function(e){var t=i.confirm().title("Are you sure want to delete the selected allconditions?").htmlContent("<b>"+c.selectedTriggerAllConditions.length+" selected</b> will be deleted.").ariaLabel("delete allconditions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){c.selectedTriggerAllConditions.forEach(function(e){h(e)}),c.selectedTriggerAllConditions=[]})},d.hasRole("admin")?l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.chatAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.chatAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.chatAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.chatAccounts.length;i++){_.some(a,{id:c.chatAccounts[i].id})&&(c.chatAccounts[i].canSelect=!1,n.push(c.chatAccounts[i]))}c.chatAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.mailAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.mailAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.mailAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.mailAccounts.length;i++){_.some(a,{id:c.mailAccounts[i].id})&&(c.mailAccounts[i].canSelect=!1,n.push(c.mailAccounts[i]))}c.mailAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.smsAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.smsAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.smsAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.smsAccounts.length;i++){_.some(a,{id:c.smsAccounts[i].id})&&(c.smsAccounts[i].canSelect=!1,n.push(c.smsAccounts[i]))}c.smsAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.faxAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.faxAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.faxAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.faxAccounts.length;i++){_.some(a,{id:c.faxAccounts[i].id})&&(c.faxAccounts[i].canSelect=!1,n.push(c.faxAccounts[i]))}c.faxAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.openchannelAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.openchannelAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.openchannelAccounts=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.openchannelAccounts.length;i++){_.some(a,{id:c.openchannelAccounts[i].id})&&(c.openchannelAccounts[i].canSelect=!1,n.push(c.openchannelAccounts[i]))}c.openchannelAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],u=null;d.hasRole("admin")?l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.type===m[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(l.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("queue"===e.field){var t=_.find(u,{name:e.value});a.push(t)}});for(var t=0;t<e.length;t++){(e[t].rows||[]).forEach(function(e){n.push(e)})}_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["resourceId",e.id])){var t=_.find(u,{id:e.id});t.canSelect=!1,n.push(t)}}),c.queues=n}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.outboundRoutes,{id:e.resourceId})}),a=null;a=[],c.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.outboundRoutes,{id:e.id});t.canSelect=!1,n.push(t)}}),c.outboundRoutes=n})}else{var n=[],a=[];c.triggerAllConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.outboundRoutes.length;i++){_.some(a,{id:c.outboundRoutes[i].id})&&(c.outboundRoutes[i].canSelect=!1,n.push(c.outboundRoutes[i]))}c.outboundRoutes=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var p=!0,g=1;function v(e){c.triggerAllConditions=e||{count:0,rows:[]}}function h(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAllConditions.rows,{id:e.id}),c.triggerAllConditions.count-=1,c.triggerAllConditions.rows.length||c.getTriggerAllConditions(),r.success({title:"AllCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){p?a(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getTriggerAllConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAllConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,o,i,s,r,l,d,c,m,u,p,g){var v=this;v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ALLCONDITION",v.allCondition=angular.copy(l),v.allconditions=r,v.newAllCondition=!1,v.trigger=angular.copy(d),v.allCondition||(v.allCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},v.title="TOOLS.NEW_ALLCONDITION",v.newAllCondition=!0),t.params.id&&(v.allCondition.TriggerAllId=t.params.id),v.addNewAllCondition=function(){v.errors=[],c.trigger.addAllCondition({id:t.params.id},v.allCondition).$promise.then(function(e){v.allconditions.unshift(e.toJSON()),s.success({title:"AllCondition properly created",msg:v.allCondition.name?v.allCondition.name+" has been created!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAllCondition=function(){v.errors=[],c.condition.update({id:v.allCondition.id},v.allCondition).$promise.then(function(e){var t=_.find(v.allconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"AllCondition properly saved!",msg:v.allCondition.name?v.allCondition.name+" has been saved!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAllCondition=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The allCondition will be deleted.").ariaLabel("Delete AllCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.condition.delete({id:v.allCondition.id}).$promise.then(function(){_.remove(v.allconditions,{id:v.allCondition.id}),s.success({title:"AllCondition properly deleted!",msg:(v.allCondition.name||"allCondition")+" has been deleted!"}),b(v.allCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=b,m.hasRole("admin")?c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.chatAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.chatAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.chatAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.chatAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.chatAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.chatAccounts.length;i++)a&&v.chatAccounts[i].id===a.id&&(v.chatAccounts[i].canSelect=!1,n.push(v.chatAccounts[i]));v.chatAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.mailAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.mailAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.mailAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.mailAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.mailAccounts.length;i++)a&&v.mailAccounts[i].id===a.id&&(v.mailAccounts[i].canSelect=!1,n.push(v.mailAccounts[i]));v.mailAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.smsAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.smsAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.smsAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.smsAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.smsAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.smsAccounts.length;i++)a&&v.smsAccounts[i].id===a.id&&(v.smsAccounts[i].canSelect=!1,n.push(v.smsAccounts[i]));v.smsAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.faxAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.faxAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.faxAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.faxAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.faxAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.faxAccounts.length;i++)a&&v.faxAccounts[i].id===a.id&&(v.faxAccounts[i].canSelect=!1,n.push(v.faxAccounts[i]));v.faxAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.openchannelAccounts,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.openchannelAccounts,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.openchannelAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.openchannelAccounts=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.openchannelAccounts,{id:Number(v.allCondition.value)}));for(var i=0;i<v.openchannelAccounts.length;i++)a&&v.openchannelAccounts[i].id===a.id&&(v.openchannelAccounts[i].canSelect=!1,n.push(v.openchannelAccounts[i]));v.openchannelAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],f=null;function b(e){a.hide(e)}m.hasRole("admin")?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){v.queues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){f=e.rows||[]}).then(function(){for(var e=[],t=0;t<h.length;t++)e.push(c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:h[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<h.length;a++){var i=_.find(t,["sectionId",h[a].id]);if(i)if(i.autoAssociation){var s=[];f.forEach(function(e){e.type===h[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(c.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;v.allCondition&&(n=_.find(f,{name:v.allCondition.value}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&f.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),v.queues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.outboundRoutes,{id:e.resourceId})}),n=null;if(v.allCondition&&(n=_.find(v.outboundRoutes,{id:Number(v.allCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}v.outboundRoutes=t})}else{var n=[],a=null;v.allCondition&&(a=_.find(v.outboundRoutes,{id:Number(v.allCondition.value)}));for(var i=0;i<v.outboundRoutes.length;i++)a&&v.outboundRoutes[i].id===a.id&&(v.outboundRoutes[i].canSelect=!1,n.push(v.outboundRoutes[i]));v.outboundRoutes=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","allconditions","allCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAllConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,o,a,i,s,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.trigger={},c.triggerAnyConditions={count:0,rows:[]},c.selectedTriggerAnyConditions=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,field,operator,value",limit:10,page:1},c.arrayfield=_.keyBy([{option:"Queue",value:"'queue'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Call_Status",value:"'lastevent'",ngIf:"vm.trigger.channel == 'voice'"},{option:"OutboundRoute",value:"'routeId'",ngIf:"vm.trigger.channel == 'voice'"},{option:"Account",value:"'account'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Interaction",value:"'interaction'",ngIf:"vm.trigger.channel != 'voice'"},{option:"Message",value:"'message'",ngIf:"vm.trigger.channel != 'voice'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.arrayoperator=_.keyBy([{option:"Equals",value:"'equals'"},{option:"Not_Equals",value:"'not_equals'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.callStatusValues=_.keyBy([{option:"Abandon",value:"'abandoned'"},{option:"Hangup",value:"'complete'"},{option:"Reject",value:"'rejected'"},{option:"Ring",value:"'called'"},{option:"Answer",value:"'connect'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.interactionStatusValues=_.keyBy([{option:"Opened",value:"'opened'"},{option:"Closed",value:"'closed'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.messageStatusValues=_.keyBy([{option:"Incoming",value:"'in'"},{option:"Outgoing",value:"'out'"},{option:"Accepted",value:"'accept'"},{option:"Rejected",value:"'reject'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),c.init=function(e,t){c.trigger=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.trigger.id,c.query.TriggerAnyId=c.trigger.id,c.getTriggerAnyConditions()},c.deleteConfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the anyCondition?").htmlContent("<b>"+(e.name||"anyCondition")+"</b> will be deleted.").ariaLabel("delete anyCondition").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){h(e)},function(){console.log("CANCEL")})},c.success=v,c.getTriggerAnyConditions=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.trigger.getAnyConditions(c.query,v).$promise},c.createOrEditTriggerAnyCondition=function(e,t){i.show({controller:"CreateOrEditAnyConditionDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:c.trigger,anyCondition:t,anyconditions:c.triggerAnyConditions.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedTriggerAnyConditions=function(){var e=angular.copy(c.selectedTriggerAnyConditions);return c.selectedTriggerAnyConditions=[],e},c.deleteTriggerAnyCondition=h,c.deleteSelectedTriggerAnyConditions=function(e){var t=i.confirm().title("Are you sure want to delete the selected anyconditions?").htmlContent("<b>"+c.selectedTriggerAnyConditions.length+" selected</b> will be deleted.").ariaLabel("delete anyconditions").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){c.selectedTriggerAnyConditions.forEach(function(e){h(e)}),c.selectedTriggerAnyConditions=[]})},d.hasRole("admin")?l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.chatAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.chatAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.chatAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.chatAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.chatAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.chatAccounts.length;i++){_.some(a,{id:c.chatAccounts[i].id})&&(c.chatAccounts[i].canSelect=!1,n.push(c.chatAccounts[i]))}c.chatAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.mailAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.mailAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.mailAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.mailAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.mailAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.mailAccounts.length;i++){_.some(a,{id:c.mailAccounts[i].id})&&(c.mailAccounts[i].canSelect=!1,n.push(c.mailAccounts[i]))}c.mailAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.smsAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.smsAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.smsAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.smsAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.smsAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.smsAccounts.length;i++){_.some(a,{id:c.smsAccounts[i].id})&&(c.smsAccounts[i].canSelect=!1,n.push(c.smsAccounts[i]))}c.smsAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.faxAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.faxAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.faxAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.faxAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.faxAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.faxAccounts.length;i++){_.some(a,{id:c.faxAccounts[i].id})&&(c.faxAccounts[i].canSelect=!1,n.push(c.faxAccounts[i]))}c.faxAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){c.openchannelAccounts=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.openchannelAccounts,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.openchannelAccounts,{id:e.id});t.canSelect=!1,n.push(t)}}),c.openchannelAccounts=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("account"===e.field){var t=_.find(c.openchannelAccounts,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.openchannelAccounts.length;i++){_.some(a,{id:c.openchannelAccounts[i].id})&&(c.openchannelAccounts[i].canSelect=!1,n.push(c.openchannelAccounts[i]))}c.openchannelAccounts=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],u=null;d.hasRole("admin")?l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){c.queues=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.type===m[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(l.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("queue"===e.field){var t=_.find(u,{name:e.value});a.push(t)}});for(var t=0;t<e.length;t++){(e[t].rows||[]).forEach(function(e){n.push(e)})}_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["resourceId",e.id])){var t=_.find(u,{id:e.id});t.canSelect=!1,n.push(t)}}),c.queues=n}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){c.outboundRoutes=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var n=_.map(e.rows,function(e){return _.find(c.outboundRoutes,{id:e.resourceId})}),a=null;a=[],c.triggerAnyConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}}),_.isEmpty(a)||a.forEach(function(e){if(!_.some(n,["id",e.id])){var t=_.find(c.outboundRoutes,{id:e.id});t.canSelect=!1,n.push(t)}}),c.outboundRoutes=n})}else{var n=[],a=[];c.triggerAnyConditions.rows.forEach(function(e){if("routeId"===e.field){var t=_.find(c.outboundRoutes,{id:Number(e.value)});a.push(t)}});for(var i=0;i<c.outboundRoutes.length;i++){_.some(a,{id:c.outboundRoutes[i].id})&&(c.outboundRoutes[i].canSelect=!1,n.push(c.outboundRoutes[i]))}c.outboundRoutes=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var p=!0,g=1;function v(e){c.triggerAnyConditions=e||{count:0,rows:[]}}function h(e){l.condition.delete({id:e.id}).$promise.then(function(){_.remove(c.triggerAnyConditions.rows,{id:e.id}),c.triggerAnyConditions.count-=1,c.triggerAnyConditions.rows.length||c.getTriggerAnyConditions(),r.success({title:"AnyCondition deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETtrigger"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){p?a(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getTriggerAnyConditions())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.tools").controller("TriggerAnyConditionsController",e)}(),function(){"use strict";function e(e,t,n,a,o,i,s,r,l,d,c,m,u,p,g){var v=this;v.currentUser=m.getCurrentUser(),v.errors=[],v.setting=p,v.license=u,v.crudPermissions=g,v.hasModulePermissions={},v.passwordPattern=v.setting&&v.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",v.title="TOOLS.EDIT_ANYCONDITION",v.anyCondition=angular.copy(l),v.anyconditions=r,v.newAnyCondition=!1,v.trigger=angular.copy(d),v.anyCondition||(v.anyCondition={field:"queue",operator:"equals",value:"abandoned",value:"opened",value:"in"},v.title="TOOLS.NEW_ANYCONDITION",v.newAnyCondition=!0),t.params.id&&(v.anyCondition.TriggerAnyId=t.params.id),v.addNewAnyCondition=function(){v.errors=[],c.trigger.addAnyCondition({id:t.params.id},v.anyCondition).$promise.then(function(e){v.anyconditions.unshift(e.toJSON()),s.success({title:"AnyCondition properly created",msg:v.anyCondition.name?v.anyCondition.name+" has been created!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.save"}];for(var t=0;t<e.data.errors.length;t+=1)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.saveAnyCondition=function(){v.errors=[],c.condition.update({id:v.anyCondition.id},v.anyCondition).$promise.then(function(e){var t=_.find(v.anyconditions,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),s.success({title:"AnyCondition properly saved!",msg:v.anyCondition.name?v.anyCondition.name+" has been saved!":""}),b(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.update"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},v.deleteAnyCondition=function(e){v.errors=[];var t=a.confirm().title("Are you sure?").content("The anyCondition will be deleted.").ariaLabel("Delete AnyCondition").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){c.condition.delete({id:v.anyCondition.id}).$promise.then(function(){_.remove(v.anyconditions,{id:v.anyCondition.id}),s.success({title:"AnyCondition properly deleted!",msg:(v.anyCondition.name||"anyCondition")+" has been deleted!"}),b(v.anyCondition)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){v.errors=e.data.errors||[{message:e.toString(),type:"api.condition.delete"}];for(var t=0;t<e.data.errors.length;t++)s.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.condition.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},v.getDateFromString=function(e){return null===e?void 0:new Date(e)},v.closeDialog=b,m.hasRole("admin")?c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CHATACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.chatWebsite.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.chatAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:502}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.chatAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.chatAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.chatAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.chatAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.chatAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.chatAccounts.length;i++)a&&v.chatAccounts[i].id===a.id&&(v.chatAccounts[i].canSelect=!1,n.push(v.chatAccounts[i]));v.chatAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETchatAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MAILACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.mailAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.mailAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:602}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.mailAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.mailAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.mailAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.mailAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.mailAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.mailAccounts.length;i++)a&&v.mailAccounts[i].id===a.id&&(v.mailAccounts[i].canSelect=!1,n.push(v.mailAccounts[i]));v.mailAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmailAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SMSACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.smsAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.smsAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:702}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.smsAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.smsAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.smsAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.smsAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.smsAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.smsAccounts.length;i++)a&&v.smsAccounts[i].id===a.id&&(v.smsAccounts[i].canSelect=!1,n.push(v.smsAccounts[i]));v.smsAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsmsAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_FAXACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.faxAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.faxAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:902}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.faxAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.faxAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.faxAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.faxAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.faxAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.faxAccounts.length;i++)a&&v.faxAccounts[i].id===a.id&&(v.faxAccounts[i].canSelect=!1,n.push(v.faxAccounts[i]));v.faxAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETfaxAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OPENCHANNELACCOUNTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.openchannelAccount.get({fields:"id,name",sort:"id",nolimit:"true"}).$promise.then(function(e){v.openchannelAccounts=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:802}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.openchannelAccounts,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.openchannelAccounts,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.openchannelAccounts,{id:n.id});a.canSelect=!1,t.push(a)}v.openchannelAccounts=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.openchannelAccounts,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.openchannelAccounts.length;i++)a&&v.openchannelAccounts[i].id===a.id&&(v.openchannelAccounts[i].canSelect=!1,n.push(v.openchannelAccounts[i]));v.openchannelAccounts=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETopenchannelAccounts",msg:e.data?JSON.stringify(e.data):e.toString()})});var h=[{id:401,type:"inbound"},{id:1501,type:"outbound"}],f=null;function b(e){a.hide(e)}m.hasRole("admin")?c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){v.queues=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceQueue.get({fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){f=e.rows||[]}).then(function(){for(var e=[],t=0;t<h.length;t++)e.push(c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:h[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<h.length;a++){var i=_.find(t,["sectionId",h[a].id]);if(i)if(i.autoAssociation){var s=[];f.forEach(function(e){e.type===h[a].type&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(c.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;v.anyCondition&&(n=_.find(f,{name:v.anyCondition.value}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&f.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),v.queues=t}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})}),m.hasRole("admin")?c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):c.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){v.outboundRoutes=e.rows||[]}).then(function(){return c.userProfileSection.get({userProfileId:v.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return c.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(v.outboundRoutes,{id:e.resourceId})}),n=null;if(v.anyCondition&&(n=_.find(v.outboundRoutes,{id:Number(v.anyCondition.value)})),n&&!_.some(t,["id",n.id])){var a=_.find(v.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}v.outboundRoutes=t})}else{var n=[],a=null;v.anyCondition&&(a=_.find(v.outboundRoutes,{id:Number(v.anyCondition.value)}));for(var i=0;i<v.outboundRoutes.length;i++)a&&v.outboundRoutes[i].id===a.id&&(v.outboundRoutes[i].canSelect=!1,n.push(v.outboundRoutes[i]));v.outboundRoutes=n}}).catch(function(e){s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","anyconditions","anyCondition","trigger","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditAnyConditionDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.trigger=c||e.params.trigger||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoTriggers=function(){e.go("app.tools.triggers")},u.saveTrigger=function(){r.trigger.update({id:u.trigger.id},u.trigger).$promise.then(function(){l.success({title:"Trigger updated!",msg:u.trigger.name?u.trigger.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrigger",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trigger","userProfileSection"],angular.module("app.tools").controller("TriggerController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.triggers=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="triggers",b.listOrder="",b.listOrderAsc=null,b.selectedTriggers=[],b.query={fields:"createdAt,updatedAt,id,name,channel,status,description",sort:"-updatedAt",limit:10,page:1},b.arraychannel=_.keyBy([{option:"Voice",value:"'voice'"},{option:"Openchannel",value:"'openchannel'",ngIf:"vm.license.openchannel"},{option:"Chat",value:"'chat'",ngIf:"vm.license.chat"},{option:"Mail",value:"'mail'",ngIf:"vm.license.mail"},{option:"Sms",value:"'sms'",ngIf:"vm.license.messaging"},{option:"Fax",value:"'fax'",ngIf:"vm.license.fax"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.tools.triggers.edit",{id:e.id,trigger:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("trigger")+"?").htmlContent("<b>"+(e.name||"trigger")+"</b> will be deleted.").ariaLabel("delete trigger").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTriggers=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.trigger.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Triggers",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTrigger=function(e,t){i.show({controller:"CreateOrEditTriggerDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/triggers/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trigger:t,triggers:b.triggers.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTrigger=S,b.exportSelectedTriggers=function(){var e=angular.copy(b.selectedTriggers);return b.selectedTriggers=[],e},b.deleteSelectedTriggers=function(e){var t=i.confirm().title("Are you sure want to delete the selected triggers?").htmlContent("<b>"+b.selectedTriggers.length+" selected</b> will be deleted.").ariaLabel("delete Triggers").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTriggers.forEach(function(e){S(e)}),b.selectedTriggers=[]})},b.deselectTriggers=function(){b.selectedTriggers=[]},b.selectAllTriggers=function(){b.selectedTriggers=b.triggers.rows};var E=!0,A=1;function y(e){b.triggers=e||{count:0,rows:[]}}function S(e){m.trigger.delete({id:e.id}).$promise.then(function(){_.remove(b.triggers.rows,{id:e.id}),b.triggers.count-=1,b.triggers.rows.length||b.getTriggers(),p.success({title:_.startCase("Trigger")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrigger"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrigger",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTriggers())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","triggers","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TriggersController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_TRUNK",g.trunk=angular.copy(l),g.trunks=r,g.newTrunk=!1,g.trunk||(g.trunk={active:!0,type:"friend",dtmfmode:"rfc2833",qualify:"yes",t38pt_udptl:"no"},g.title="TOOLS.NEW_TRUNK",g.newTrunk=!0),g.addNewTrunk=function(){g.errors=[],d.trunk.save(g.trunk).$promise.then(function(e){g.trunks.unshift(e.toJSON()),o.success({title:"Trunk properly created",msg:g.trunk.name?g.trunk.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveTrunk=function(){g.errors=[],d.trunk.update({id:g.trunk.id},g.trunk).$promise.then(function(e){var t=_.find(g.trunks,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Trunk properly saved!",msg:g.trunk.name?g.trunk.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteTrunk=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The trunk will be deleted.").ariaLabel("Delete Trunk").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.trunk.delete({id:g.trunk.id}).$promise.then(function(){_.remove(g.trunks,{id:g.trunk.id}),o.success({title:"Trunk properly deleted!",msg:(g.trunk.name||"trunk")+" has been deleted!"}),v(g.trunk)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","trunks","trunk","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditTrunkDialogController",e)}(),function(){"use strict";function e(t,n,a,e,i,s,o){var r=this;function l(e){t.hide(e)}r.newTrunk=!0,r.trunk=angular.copy(i),r.trunks=s,r.title=o.instant("TOOLS.CLONE_TRUNK"),i&&i.name&&(r.title+=": "+i.name),r.cloneTrunk=function(){return e.trunk.clone({id:i.id},r.trunk).$promise.then(function(e){r.trunks.unshift(e.toJSON()),a.success({title:"Trunk properly cloned",msg:r.trunk.name?r.trunk.name+" has been cloned!":""}),n.go("app.tools.trunks.edit",{id:e.id}),l(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){r.errors=e.data.errors||[{message:e.toString(),type:"api.trunk.clone"}];for(var t=0;t<e.data.errors.length;t+=1)a.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.trunk.clone",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},r.closeDialog=l}e.$inject=["$mdDialog","$state","toasty","api","trunk","trunks","$translate"],angular.module("app.tools").controller("TrunkcloneController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.trunk=c||n.params.trunk||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.trunks",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.trunks",{})}},u.clonedialog=function(e,t){a.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{trunk:e,trunks:u.trunks?u.trunks.rows:[],crudPermissions:u.crudPermissions}})},u.alert=l.info,u.gotoTrunks=function(){n.go("app.tools.trunks")},u.saveTrunk=function(){r.trunk.update({id:u.trunk.id},u.trunk).$promise.then(function(){l.success({title:"Trunk updated!",msg:u.trunk.name?u.trunk.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunk",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.trunk&&(n=_.find(u.contexts,{name:u.trunk.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","trunk","userProfileSection"],angular.module("app.tools").controller("TrunkController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.trunks=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="trunks",b.listOrder="",b.listOrderAsc=null,b.selectedTrunks=[],b.query={fields:"createdAt,updatedAt,id,name,active,host,secret,defaultuser,context,callerid,type,dtmfmode,nat,qualify,allow,insecure,call_limit,registry,description,directmedia,callcounter,fromdomain,fromuser,outboundproxy,usereqphone,trustrpid,sendrpid,encryption,port,transport,t38pt_udptl,videosupport,otherFields",sort:"-updatedAt",limit:10,page:1},b.arraytype=_.keyBy([{option:"Friend",value:"'friend'"},{option:"User",value:"'user'"},{option:"Peer",value:"'peer'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydtmfmode=_.keyBy([{option:"rfc2833",value:"'rfc2833'"},{option:"info",value:"'info'"},{option:"shortinfo",value:"'shortinfo'"},{option:"inband",value:"'inband'"},{option:"auto",value:"'auto'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraynat=_.keyBy([{option:"force_rport",value:"'force_rport'"},{option:"comedia",value:"'comedia'"},{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"never",value:"'never'"},{option:"route",value:"'route'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayqualify=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayallow=_.keyBy([{option:"ulaw",value:"'ulaw'"},{option:"alaw",value:"'alaw'"},{option:"gsm",value:"'gsm'"},{option:"g723",value:"'g723'"},{option:"g726",value:"'g726'"},{option:"g722",value:"'g722'"},{option:"g729",value:"'g729'"},{option:"ilbc",value:"'ilbc'"},{option:"opus",value:"'opus'"},{option:"h264",value:"'h264'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayinsecure=_.keyBy([{option:"port",value:"'port'"},{option:"invite",value:"'invite'"},{option:"very",value:"'very'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydirectmedia=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"nonat",value:"'nonat'"},{option:"update",value:"'update'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraycallcounter=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayusereqphone=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytrustrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysendrpid=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"},{option:"pai",value:"'pai'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayencryption=_.keyBy([{option:"yes",value:"'yes'"},{option:"no",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytransport=_.keyBy([{option:"udp",value:"'udp'"},{option:"tcp",value:"'tcp'"},{option:"ws",value:"'ws'"},{option:"wss",value:"'wss'"},{option:"tls",value:"'tls'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayvideosupport=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Always",value:"'always'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.tools.trunks.edit",{id:e.id,trunk:e,crudPermissions:b.crudPermissions})},b.clonedialog=function(e,t){i.show({controller:"TrunkcloneController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/edit/clone/clone.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{trunk:e,trunks:b.trunks?b.trunks.rows:[],crudPermissions:b.crudPermissions}})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.trunks",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.trunks",{})}},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("trunk")+"?").htmlContent("<b>"+(e.name||"trunk")+"</b> will be deleted.").ariaLabel("delete trunk").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getTrunks=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.trunk.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Trunks",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditTrunk=function(e,t){i.show({controller:"CreateOrEditTrunkDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/trunks/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{trunk:t,trunks:b.trunks.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteTrunk=S,b.exportSelectedTrunks=function(){var e=angular.copy(b.selectedTrunks);return b.selectedTrunks=[],e},b.deleteSelectedTrunks=function(e){var t=i.confirm().title("Are you sure want to delete the selected trunks?").htmlContent("<b>"+b.selectedTrunks.length+" selected</b> will be deleted.").ariaLabel("delete Trunks").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedTrunks.forEach(function(e){S(e)}),b.selectedTrunks=[]})},b.deselectTrunks=function(){b.selectedTrunks=[]},b.selectAllTrunks=function(){b.selectedTrunks=b.trunks.rows};var E=!0,A=1;function y(e){b.trunks=e||{count:0,rows:[]}}function S(e){m.trunk.delete({id:e.id}).$promise.then(function(){_.remove(b.trunks.rows,{id:e.id}),b.trunks.count-=1,b.trunks.rows.length||b.getTrunks(),p.success({title:_.startCase("Trunk")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEtrunk"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEtrunk",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getTrunks())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","trunks","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("TrunksController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="TOOLS.EDIT_VARIABLE",g.variable=angular.copy(l),g.variables=r,g.newVariable=!1,g.variable||(g.variable={},g.title="TOOLS.NEW_VARIABLE",g.newVariable=!0),g.addNewVariable=function(){g.errors=[],d.variable.save(g.variable).$promise.then(function(e){g.variables.unshift(e.toJSON()),o.success({title:"Variable properly created",msg:g.variable.name?g.variable.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVariable=function(){g.errors=[],d.variable.update({id:g.variable.id},g.variable).$promise.then(function(e){var t=_.find(g.variables,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Variable properly saved!",msg:g.variable.name?g.variable.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVariable=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The variable will be deleted.").ariaLabel("Delete Variable").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.variable.delete({id:g.variable.id}).$promise.then(function(){_.remove(g.variables,{id:g.variable.id}),o.success({title:"Variable properly deleted!",msg:(g.variable.name||"variable")+" has been deleted!"}),v(g.variable)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.variable.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.variable.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","variables","variable","api","Auth","license","setting","crudPermissions"],angular.module("app.tools").controller("CreateOrEditVariableDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.variables=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="variables",b.listOrder="",b.listOrderAsc=null,b.selectedVariables=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{variable:e,variables:b.variables.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("variable")+"?").htmlContent("<b>"+(e.name||"variable")+"</b> will be deleted.").ariaLabel("delete variable").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVariables=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.variable.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Variables",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVariable=function(e,t){i.show({controller:"CreateOrEditVariableDialogController",controllerAs:"vm",templateUrl:"app/main/apps/tools/views/variables/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{variable:t,variables:b.variables.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVariable=S,b.exportSelectedVariables=function(){var e=angular.copy(b.selectedVariables);return b.selectedVariables=[],e},b.deleteSelectedVariables=function(e){var t=i.confirm().title("Are you sure want to delete the selected variables?").htmlContent("<b>"+b.selectedVariables.length+" selected</b> will be deleted.").ariaLabel("delete Variables").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVariables.forEach(function(e){S(e)}),b.selectedVariables=[]})},b.deselectVariables=function(){b.selectedVariables=[]},b.selectAllVariables=function(){b.selectedVariables=b.variables.rows};var E=!0,A=1;function y(e){b.variables=e||{count:0,rows:[]}}function S(e){m.variable.delete({id:e.id}).$promise.then(function(){_.remove(b.variables.rows,{id:e.id}),b.variables.count-=1,b.variables.rows.length||b.getVariables(),p.success({title:_.startCase("Variable")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvariable"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvariable",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVariables())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","variables","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.tools").controller("VariablesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.chanSpies=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="chanSpies",b.listOrder="",b.listOrderAsc=null,b.selectedChanSpies=[],b.query={fields:"createdAt,updatedAt,id,name,prefix,options,auth,password,record,recordingFormat,description",sort:"-updatedAt",limit:10,page:1},b.arrayoptions=_.keyBy([{option:"b: Only spy on channels involved in a bridged call.",value:"'b'"},{option:"B: Instead of whispering on a single channel barge in on both channels involved in the call.",value:"'B'"},{option:"E: Exit when the spied-on channel hangs up.",value:"'E'"},{option:"o: Only listen to audio coming from this channel.",value:"'o'"},{option:"q: Don't play a beep when beginning to spy on a channel, or speak the selected channel name.",value:"'q'"},{option:"s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.",value:"'s'"},{option:"S: Stop when no more channels are left to spy on.",value:"'S'"},{option:"w: Enable whisper mode, so the spying channel can talk to the spied-on channel.",value:"'w'"},{option:"W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.",value:"'W'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayrecordingFormat=_.keyBy([{option:"wav",value:"'wav'"},{option:"gsm",value:"'gsm'"},{option:"wav49",value:"'WAV'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editdialog=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{chanSpy:e,chanSpies:b.chanSpies.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("chanSpy")+"?").htmlContent("<b>"+(e.name||"chanSpy")+"</b> will be deleted.").ariaLabel("delete chanSpy").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getChanSpies=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceChanSpy.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="ChanSpies",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditchanSpy=function(e,t){i.show({controller:"CreateOrEditchanSpyDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/chanSpies/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{chanSpy:t,chanSpies:b.chanSpies.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletechanSpy=S,b.exportSelectedChanSpies=function(){var e=angular.copy(b.selectedChanSpies);return b.selectedChanSpies=[],e},b.deleteSelectedChanSpies=function(e){var t=i.confirm().title("Are you sure want to delete the selected chanSpies?").htmlContent("<b>"+b.selectedChanSpies.length+" selected</b> will be deleted.").ariaLabel("delete chanSpys").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedChanSpies.forEach(function(e){S(e)}),b.selectedChanSpies=[]})},b.deselectChanSpies=function(){b.selectedChanSpies=[]},b.selectAllChanSpies=function(){b.selectedChanSpies=b.chanSpies.rows};var E=!0,A=1;function y(e){b.chanSpies=e||{count:0,rows:[]}}function S(e){m.voiceChanSpy.delete({id:e.id}).$promise.then(function(){_.remove(b.chanSpies.rows,{id:e.id}),b.chanSpies.count-=1,b.chanSpies.rows.length||b.getChanSpies(),p.success({title:_.startCase("chanSpy")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceChanSpy"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceChanSpy",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getChanSpies())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","chanSpies","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ChanSpiesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CHANSPY",g.chanSpy=angular.copy(l),g.chanSpies=r,g.newchanSpy=!1,g.chanSpy||(g.chanSpy={recordingFormat:"wav"},g.title="VOICE.NEW_CHANSPY",g.newchanSpy=!0),g.addNewchanSpy=function(){g.errors=[],d.voiceChanSpy.save(g.chanSpy).$promise.then(function(e){g.chanSpies.unshift(e.toJSON()),o.success({title:"chanSpy properly created",msg:g.chanSpy.name?g.chanSpy.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savechanSpy=function(){g.errors=[],d.voiceChanSpy.update({id:g.chanSpy.id},g.chanSpy).$promise.then(function(e){var t=_.find(g.chanSpies,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"chanSpy properly saved!",msg:g.chanSpy.name?g.chanSpy.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletechanSpy=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The chanSpy will be deleted.").ariaLabel("Delete chanSpy").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceChanSpy.delete({id:g.chanSpy.id}).$promise.then(function(){_.remove(g.chanSpies,{id:g.chanSpy.id}),o.success({title:"chanSpy properly deleted!",msg:(g.chanSpy.name||"chanSpy")+" has been deleted!"}),v(g.chanSpy)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceChanSpy.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceChanSpy.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","chanSpies","chanSpy","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditchanSpyDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.contexts=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="contexts",b.listOrder="",b.listOrderAsc=null,b.selectedContexts=[],b.query={fields:"createdAt,updatedAt,id,name,description",sort:"-updatedAt",defaultEntry:"false",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{context:e,contexts:b.contexts.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("context")+"?").htmlContent("<b>"+(e.name||"context")+"</b> will be deleted.").ariaLabel("delete context").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getContexts=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceContext.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Contexts",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditContext=function(e,t){i.show({controller:"CreateOrEditContextDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/contexts/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{context:t,contexts:b.contexts.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteContext=S,b.exportSelectedContexts=function(){var e=angular.copy(b.selectedContexts);return b.selectedContexts=[],e},b.deleteSelectedContexts=function(e){var t=i.confirm().title("Are you sure want to delete the selected contexts?").htmlContent("<b>"+b.selectedContexts.length+" selected</b> will be deleted.").ariaLabel("delete Contexts").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedContexts.forEach(function(e){S(e)}),b.selectedContexts=[]})},b.deselectContexts=function(){b.selectedContexts=[]},b.selectAllContexts=function(){b.selectedContexts=b.contexts.rows};var E=!0,A=1;function y(e){b.contexts=e||{count:0,rows:[]}}function S(e){m.voiceContext.delete({id:e.id}).$promise.then(function(){_.remove(b.contexts.rows,{id:e.id}),b.contexts.count-=1,b.contexts.rows.length||b.getContexts(),p.success({title:_.startCase("Context")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceContext"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceContext",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getContexts())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","contexts","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("ContextsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_CONTEXT",g.context=angular.copy(l),g.contexts=r,g.newContext=!1,g.context||(g.context={},g.title="VOICE.NEW_CONTEXT",g.newContext=!0),g.addNewContext=function(){g.errors=[],d.voiceContext.save(g.context).$promise.then(function(e){g.contexts.unshift(e.toJSON()),o.success({title:"Context properly created",msg:g.context.name?g.context.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveContext=function(){g.errors=[],d.voiceContext.update({id:g.context.id},g.context).$promise.then(function(e){var t=_.find(g.contexts,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Context properly saved!",msg:g.context.name?g.context.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteContext=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The context will be deleted.").ariaLabel("Delete Context").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceContext.delete({id:g.context.id}).$promise.then(function(){_.remove(g.contexts,{id:g.context.id}),o.success({title:"Context properly deleted!",msg:(g.context.name||"context")+" has been deleted!"}),v(g.context)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceContext.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceContext.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","contexts","context","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditContextDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_INBOUNDROUTE",g.inboundroute=angular.copy(l),g.inboundroutes=r,g.newInboundRoute=!1,g.inboundroute||(g.inboundroute={appdata:"Inbound Call",type:"inbound",context:"from-voip-provider"},g.title="VOICE.NEW_INBOUNDROUTE",g.newInboundRoute=!0),g.addNewInboundRoute=function(){g.errors=[],d.voiceExtension.save(g.inboundroute).$promise.then(function(e){g.inboundroutes.unshift(e.toJSON()),o.success({title:"InboundRoute properly created",msg:g.inboundroute.name?g.inboundroute.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInboundRoute=function(){g.errors=[],d.voiceExtension.update({id:g.inboundroute.id},g.inboundroute).$promise.then(function(e){var t=_.find(g.inboundroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"InboundRoute properly saved!",msg:g.inboundroute.name?g.inboundroute.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInboundRoute=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The inboundroute will be deleted.").ariaLabel("Delete InboundRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceExtension.delete({id:g.inboundroute.id}).$promise.then(function(){_.remove(g.inboundroutes,{id:g.inboundroute.id}),o.success({title:"InboundRoute properly deleted!",msg:(g.inboundroute.name||"inboundroute")+" has been deleted!"}),v(g.inboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.contexts,{id:e.resourceId})}),n=null;if(g.inboundroute&&(n=_.find(g.contexts,{name:g.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(g.contexts,{id:n.id});a.canSelect=!1,t.push(a)}g.contexts=t}):d.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){g.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","inboundroutes","inboundroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInboundRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,s,e){var u=this;function t(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundrouteApp:n,inboundroute:u.inboundroute,crudPermissions:u.crudPermissions}}).then(function(e){e&&(e.id?u.inboundrouteApps.rows[t]=e:u.inboundrouteApps.rows.splice(t,0,e),o())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function o(){var e=["queue","playback"],t=2,n=[];n.push({type:"inbound",app:"Set",appdata:"CDR(type)=inbound",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id}),n.push({type:"inbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:t++,VoiceExtensionId:u.inboundroute.id});for(var a=0,i=0;a<u.inboundrouteApps.rows.length;a++,i=0){var s=u.inboundrouteApps.rows[a],o=[],r=[];s.intervals="*,*,*,*"!==s.interval?[s.interval]:s.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:s.IntervalId}),"interval"):[],s.context=u.inboundroute.context,s.exten=u.inboundroute.exten,s.type&&(s.type=s.type.toLowerCase()),s.hasOwnProperty("answer")&&e.includes(s.app.toLowerCase())&&"custom"!==s.appType&&(s.answer?(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})):(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.inboundroute.context,exten:u.inboundroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.inboundroute.id})));for(var l=0;l<s.intervals.length;l++){var d=t+s.intervals.length,c=l===s.intervals.length-1?t+o.length+r.length+2:t+l+1;o.splice(l,0,{type:"inbound",app:"GotoIfTime",appdata:s.intervals[l]+"?"+u.inboundroute.context+",${EXTEN},"+d+":"+u.inboundroute.context+",${EXTEN},"+c,exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t+l,VoiceExtensionId:u.inboundroute.id})}s.priority=o.length?_.last(o).priority+1:t,t=(r.length?_.last(r).priority:s.priority)+1,n=_.concat(n,o,[s],r)}n.push({type:"inbound",app:"Hangup",exten:u.inboundroute.exten,context:u.inboundroute.context,priority:t,VoiceExtensionId:u.inboundroute.id}),m.voiceExtension.addApplications({id:u.inboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.inboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.inboundrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.inboundroute={},u.inboundrouteApps={count:0,rows:[]},u.selectedInboundRouteApps=[],u.crudPermissions,u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-voip-provider",type:"Inbound",appdata:",xX,,,300,,,,,",icon:"icon-apps",options:"xX",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}},{name:"queues",field:{name:"queue",key:"name"},route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:401}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"user",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",required:!0,type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"multipleUsers",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-voip-provider",type:"inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",field:{name:"project",key:"name",prefix:"agi://127.0.0.1/square,"},route:"squareProject",filters:{fields:"id,name",sort:"name"},permissions:{section:1103}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",field:{name:"context",key:"name"},route:"voiceContext",filters:{fields:"id,name",sort:"name"},permissions:{section:405}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-voip-provider",type:"Inbound",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-voip-provider",type:"Inbound",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",field:{name:"name",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name"},permissions:{section:1012}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-voip-provider",icon:"icon-apps",type:"Inbound",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",field:{name:"voiceMail",key:"mailbox",suffix:"@from-voicemail"},route:"voiceMail",filters:{fields:"id,mailbox",sort:"mailbox"},permissions:{section:406}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){o()}},u.init=function(e,t){u.inboundroute=e,u.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},u.applications.disabled=!u.crudPermissions.canEdit,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInboundRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.inboundrouteApps.rows.splice(t,1),o()},function(){console.log("CANCEL")})},u.getInboundRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInboundRouteApp=t,u.editInterval=function(e,t){if(u.inboundrouteApps.rows.length){var n=u.inboundrouteApps.rows[t]?u.inboundrouteApps.rows[t]:u.inboundrouteApps.rows[0];i.show({controller:"EditInboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:u.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,o())})}},u.deleteInboundRouteApp=function(e){_.remove(u.inboundrouteApps.rows,{id:e.id}),o(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInboundRouteApps.forEach(function(e){_.remove(u.inboundrouteApps.rows,{id:e.id})}),u.selectedInboundRouteApps=[],o()})},u.rewriteRouting=o,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.agi=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agi.appdata)switch(l.agi.appType?l.agi.appType.toLowerCase():l.agi.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agi.appdata.split(",");l.agi.key=d[0],l.agi.language=d[1],l.agi.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agi.appdata.split(",");l.agi.accesskeyid=d[0],l.agi.secretaccesskey=d[1],l.agi.lexregion=d[2],l.agi.botname=d[3],l.agi.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agi.appdata.split(",");l.agi.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agi.text=d.slice(1,d.length).join(",");break;case"message":l.agi.text=l.agi.appdata;break;case"set":l.agi.name=l.agi.appdata.split("=")[0],l.agi.value=l.agi.appdata.split("=")[1];break;case"agi":l.agi.project=l.agi.appdata;break;default:var c=l.agi.appdata.split(",");l.agi.project=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outbounddial"===l.agi.appType.toLowerCase()&&(l.agi.prefix=l.agi.phone?l.agi.phone.split("$")[0]:void 0,l.agi.callerId=l.agi.callerID?"CALLERID(all)="+l.agi.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outboundDial"===l.agi.appType&&(l.agi.phone=i.cutdigits?(l.agi.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agi.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agi.options+="U(xcally-mixmonitor-context)"):l.agi.options=l.agi.options.replace("U(xcally-mixmonitor-context)",""));if(l.agi.appType&&"custom"===l.agi.appType);else switch((l.agi.app||l.agi.appType).toLowerCase()){case"set":l.agi.appdata=l.agi.name+"="+l.agi.value;break;case"custom":break;default:e[0]=l.agi.project,l.agi.appdata=e.join(",")}m(l.agi)},l.closeDialog=m,o.hasRole("admin")?s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),n=null;if(l.agi&&(n=_.find(l.projects,{name:l.agi.project})),n&&!_.some(t,["id",n.id])){var a=_.find(l.projects,{id:n.id});a.canSelect=!1,t.push(a)}l.projects=t})}else{var n=[],a=null;l.agi&&(a=_.find(l.projects,{name:l.agi.project}));for(var i=0;i<l.projects.length;i++)a&&l.projects[i].id===a.id&&(l.projects[i].canSelect=!1,n.push(l.projects[i]));l.projects=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.dial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dial.appdata)switch(l.dial.appType?l.dial.appType.toLowerCase():l.dial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dial.appdata.split(",");l.dial.key=d[0],l.dial.language=d[1],l.dial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dial.appdata.split(",");l.dial.accesskeyid=d[0],l.dial.secretaccesskey=d[1],l.dial.lexregion=d[2],l.dial.botname=d[3],l.dial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dial.appdata.split(",");l.dial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dial.text=d.slice(1,d.length).join(",");break;case"message":l.dial.text=l.dial.appdata;break;case"set":l.dial.name=l.dial.appdata.split("=")[0],l.dial.value=l.dial.appdata.split("=")[1];break;case"agi":l.dial.project=l.dial.appdata;break;default:var c=l.dial.appdata.split(",");l.dial.tech=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outbounddial"===l.dial.appType.toLowerCase()&&(l.dial.prefix=l.dial.phone?l.dial.phone.split("$")[0]:void 0,l.dial.callerId=l.dial.callerID?"CALLERID(all)="+l.dial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outboundDial"===l.dial.appType&&(l.dial.phone=i.cutdigits?(l.dial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dial.options+="U(xcally-mixmonitor-context)"):l.dial.options=l.dial.options.replace("U(xcally-mixmonitor-context)",""));if(l.dial.appType&&"custom"===l.dial.appType);else switch((l.dial.app||l.dial.appType).toLowerCase()){case"set":l.dial.appdata=l.dial.name+"="+l.dial.value;break;case"custom":break;default:e[0]=l.dial.tech,e[1]=l.dial.timeout,e[2]=l.dial.options,e[3]=l.dial.url,l.dial.appdata=e.join(",")}m(l.dial)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppdialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.externaldial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.externaldial.appdata)switch(l.externaldial.appType?l.externaldial.appType.toLowerCase():l.externaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.externaldial.appdata.split(",");l.externaldial.key=d[0],l.externaldial.language=d[1],l.externaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.externaldial.appdata.split(",");l.externaldial.accesskeyid=d[0],l.externaldial.secretaccesskey=d[1],l.externaldial.lexregion=d[2],l.externaldial.botname=d[3],l.externaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.externaldial.appdata.split(",");l.externaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.externaldial.text=d.slice(1,d.length).join(",");break;case"message":l.externaldial.text=l.externaldial.appdata;break;case"set":l.externaldial.name=l.externaldial.appdata.split("=")[0],l.externaldial.value=l.externaldial.appdata.split("=")[1];break;case"agi":l.externaldial.project=l.externaldial.appdata;break;default:var c=l.externaldial.appdata.split(",");l.externaldial.trunk=c[0].split("/")[1],l.externaldial.phone=c[0].split("/")[2],l.externaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.externaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.externaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outbounddial"===l.externaldial.appType.toLowerCase()&&(l.externaldial.prefix=l.externaldial.phone?l.externaldial.phone.split("$")[0]:void 0,l.externaldial.callerId=l.externaldial.callerID?"CALLERID(all)="+l.externaldial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outboundDial"===l.externaldial.appType&&(l.externaldial.phone=i.cutdigits?(l.externaldial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.externaldial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.externaldial.options+="U(xcally-mixmonitor-context)"):l.externaldial.options=l.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.externaldial.appType&&"custom"===l.externaldial.appType);else switch((l.externaldial.app||l.externaldial.appType).toLowerCase()){case"set":l.externaldial.appdata=l.externaldial.name+"="+l.externaldial.value;break;case"custom":break;default:e[0]=["SIP",l.externaldial.trunk,l.externaldial.phone].join("/"),e[1]=l.externaldial.timeout,e[2]=l.externaldial.options,e[3]=l.externaldial.url,l.externaldial.appdata=e.join(",")}m(l.externaldial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.externaldial&&(n=_.find(l.trunks,{name:l.externaldial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.externaldial&&(a=_.find(l.trunks,{name:l.externaldial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.goto=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.goto.appdata)switch(l.goto.appType?l.goto.appType.toLowerCase():l.goto.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.goto.appdata.split(",");l.goto.key=d[0],l.goto.language=d[1],l.goto.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.goto.appdata.split(",");l.goto.accesskeyid=d[0],l.goto.secretaccesskey=d[1],l.goto.lexregion=d[2],l.goto.botname=d[3],l.goto.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.goto.appdata.split(",");l.goto.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.goto.text=d.slice(1,d.length).join(",");break;case"message":l.goto.text=l.goto.appdata;break;case"set":l.goto.name=l.goto.appdata.split("=")[0],l.goto.value=l.goto.appdata.split("=")[1];break;case"agi":l.goto.project=l.goto.appdata;break;default:var c=l.goto.appdata.split(",");l.goto.context=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.goto.extension=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.goto.priority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outbounddial"===l.goto.appType.toLowerCase()&&(l.goto.prefix=l.goto.phone?l.goto.phone.split("$")[0]:void 0,l.goto.callerId=l.goto.callerID?"CALLERID(all)="+l.goto.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outboundDial"===l.goto.appType&&(l.goto.phone=i.cutdigits?(l.goto.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.goto.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.goto.options+="U(xcally-mixmonitor-context)"):l.goto.options=l.goto.options.replace("U(xcally-mixmonitor-context)",""));if(l.goto.appType&&"custom"===l.goto.appType);else switch((l.goto.app||l.goto.appType).toLowerCase()){case"set":l.goto.appdata=l.goto.name+"="+l.goto.value;break;case"custom":break;default:e[0]=l.goto.context,e[1]=l.goto.extension,e[2]=l.goto.priority,l.goto.appdata=e.join(",")}m(l.goto)},l.closeDialog=m,o.hasRole("admin")?s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.contexts,{id:e.resourceId})}),n=null;if(l.goto&&(n=_.find(l.contexts,{name:l.goto.context})),n&&!_.some(t,["id",n.id])){var a=_.find(l.contexts,{id:n.id});a.canSelect=!1,t.push(a)}l.contexts=t}):s.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){l.contexts=e.rows||[]})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.hangup=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.hangup.appdata)switch(l.hangup.appType?l.hangup.appType.toLowerCase():l.hangup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.hangup.appdata.split(",");l.hangup.key=d[0],l.hangup.language=d[1],l.hangup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.hangup.appdata.split(",");l.hangup.accesskeyid=d[0],l.hangup.secretaccesskey=d[1],l.hangup.lexregion=d[2],l.hangup.botname=d[3],l.hangup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.hangup.appdata.split(",");l.hangup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.hangup.text=d.slice(1,d.length).join(",");break;case"message":l.hangup.text=l.hangup.appdata;break;case"set":l.hangup.name=l.hangup.appdata.split("=")[0],l.hangup.value=l.hangup.appdata.split("=")[1];break;case"agi":l.hangup.project=l.hangup.appdata;break;default:var c=l.hangup.appdata.split(",");l.hangup.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outbounddial"===l.hangup.appType.toLowerCase()&&(l.hangup.prefix=l.hangup.phone?l.hangup.phone.split("$")[0]:void 0,l.hangup.callerId=l.hangup.callerID?"CALLERID(all)="+l.hangup.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outboundDial"===l.hangup.appType&&(l.hangup.phone=i.cutdigits?(l.hangup.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.hangup.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.hangup.options+="U(xcally-mixmonitor-context)"):l.hangup.options=l.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(l.hangup.appType&&"custom"===l.hangup.appType);else switch((l.hangup.app||l.hangup.appType).toLowerCase()){case"set":l.hangup.appdata=l.hangup.name+"="+l.hangup.value;break;case"custom":break;default:e[0]=l.hangup.appdata,l.hangup.appdata=e.join(",")}m(l.hangup)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundApphangupDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.internaldial=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.internaldial.appdata)switch(l.internaldial.appType?l.internaldial.appType.toLowerCase():l.internaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.internaldial.appdata.split(",");l.internaldial.key=d[0],l.internaldial.language=d[1],l.internaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.internaldial.appdata.split(",");l.internaldial.accesskeyid=d[0],l.internaldial.secretaccesskey=d[1],l.internaldial.lexregion=d[2],l.internaldial.botname=d[3],l.internaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.internaldial.appdata.split(",");l.internaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.internaldial.text=d.slice(1,d.length).join(",");break;case"message":l.internaldial.text=l.internaldial.appdata;break;case"set":l.internaldial.name=l.internaldial.appdata.split("=")[0],l.internaldial.value=l.internaldial.appdata.split("=")[1];break;case"agi":l.internaldial.project=l.internaldial.appdata;break;default:var c=l.internaldial.appdata.split(",");l.internaldial.user=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.internaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.internaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.internaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outbounddial"===l.internaldial.appType.toLowerCase()&&(l.internaldial.prefix=l.internaldial.phone?l.internaldial.phone.split("$")[0]:void 0,l.internaldial.callerId=l.internaldial.callerID?"CALLERID(all)="+l.internaldial.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outboundDial"===l.internaldial.appType&&(l.internaldial.phone=a.cutdigits?(l.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.internaldial.options+="U(xcally-mixmonitor-context)"):l.internaldial.options=l.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.internaldial.appType&&"custom"===l.internaldial.appType);else switch((l.internaldial.app||l.internaldial.appType).toLowerCase()){case"set":l.internaldial.appdata=l.internaldial.name+"="+l.internaldial.value;break;case"custom":break;default:e[0]=l.internaldial.user,e[1]=l.internaldial.timeout,e[2]=l.internaldial.options,e[3]=l.internaldial.url,l.internaldial.appdata=e.join(",")}p(l.internaldial)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.internaldial&&(n=_.find(u,{name:l.internaldial.user}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.playback=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.playback.appdata)switch(l.playback.appType?l.playback.appType.toLowerCase():l.playback.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.playback.appdata.split(",");l.playback.key=d[0],l.playback.language=d[1],l.playback.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.playback.appdata.split(",");l.playback.accesskeyid=d[0],l.playback.secretaccesskey=d[1],l.playback.lexregion=d[2],l.playback.botname=d[3],l.playback.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.playback.appdata.split(",");l.playback.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.playback.text=d.slice(1,d.length).join(",");break;case"message":l.playback.text=l.playback.appdata;break;case"set":l.playback.name=l.playback.appdata.split("=")[0],l.playback.value=l.playback.appdata.split("=")[1];break;case"agi":l.playback.project=l.playback.appdata;break;default:var c=l.playback.appdata.split(",");l.playback.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.playback.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outbounddial"===l.playback.appType.toLowerCase()&&(l.playback.prefix=l.playback.phone?l.playback.phone.split("$")[0]:void 0,l.playback.callerId=l.playback.callerID?"CALLERID(all)="+l.playback.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outboundDial"===l.playback.appType&&(l.playback.phone=i.cutdigits?(l.playback.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.playback.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.playback.options+="U(xcally-mixmonitor-context)"):l.playback.options=l.playback.options.replace("U(xcally-mixmonitor-context)",""));if(l.playback.appType&&"custom"===l.playback.appType);else switch((l.playback.app||l.playback.appType).toLowerCase()){case"set":l.playback.appdata=l.playback.name+"="+l.playback.value;break;case"custom":break;default:e[0]=l.playback.appdata,e[1]=l.playback.options,l.playback.appdata=e.join(",")}m(l.playback)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.playback&&(n=_.find(l.sounds,{save_name:l.playback.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.playback&&(a=_.find(l.sounds,{save_name:l.playback.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppplaybackDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.queue.URL=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.queue.sound=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.queue.timeout=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.queue.agi=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.queue.macro=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.queue.gosub=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.queue.rule=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.queue.position=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10)}function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.options,e[2]=l.queue.URL,e[3]=l.queue.sound,e[4]=l.queue.timeout,e[5]=l.queue.agi,e[6]=l.queue.macro,e[7]=l.queue.gosub,e[8]=l.queue.rule,e[9]=l.queue.position,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.sounds,{save_name:l.queue.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.sounds,{save_name:l.queue.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:401}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppqueueDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.ringgroup=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.ringgroup.appdata)switch(l.ringgroup.appType?l.ringgroup.appType.toLowerCase():l.ringgroup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.ringgroup.appdata.split(",");l.ringgroup.key=d[0],l.ringgroup.language=d[1],l.ringgroup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.ringgroup.appdata.split(",");l.ringgroup.accesskeyid=d[0],l.ringgroup.secretaccesskey=d[1],l.ringgroup.lexregion=d[2],l.ringgroup.botname=d[3],l.ringgroup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.ringgroup.appdata.split(",");l.ringgroup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.ringgroup.text=d.slice(1,d.length).join(",");break;case"message":l.ringgroup.text=l.ringgroup.appdata;break;case"set":l.ringgroup.name=l.ringgroup.appdata.split("=")[0],l.ringgroup.value=l.ringgroup.appdata.split("=")[1];break;case"agi":l.ringgroup.project=l.ringgroup.appdata;break;default:var c=l.ringgroup.appdata.split(",");l.ringgroup.multipleUsers=c[0].split("&"),l.ringgroup.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.ringgroup.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.ringgroup.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outbounddial"===l.ringgroup.appType.toLowerCase()&&(l.ringgroup.prefix=l.ringgroup.phone?l.ringgroup.phone.split("$")[0]:void 0,l.ringgroup.callerId=l.ringgroup.callerID?"CALLERID(all)="+l.ringgroup.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outboundDial"===l.ringgroup.appType&&(l.ringgroup.phone=a.cutdigits?(l.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.ringgroup.options+="U(xcally-mixmonitor-context)"):l.ringgroup.options=l.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(l.ringgroup.appType&&"custom"===l.ringgroup.appType);else switch((l.ringgroup.app||l.ringgroup.appType).toLowerCase()){case"set":l.ringgroup.appdata=l.ringgroup.name+"="+l.ringgroup.value;break;case"custom":break;default:e[0]=l.ringgroup.multipleUsers.join("&"),e[1]=l.ringgroup.timeout,e[2]=l.ringgroup.options,e[3]=l.ringgroup.url,l.ringgroup.appdata=e.join(",")}p(l.ringgroup)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.ringgroup&&(n=_.find(u,{name:l.ringgroup.multipleUsers}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppringgroupDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.set=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.set.appdata)switch(l.set.appType?l.set.appType.toLowerCase():l.set.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.set.appdata.split(",");l.set.key=d[0],l.set.language=d[1],l.set.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.set.appdata.split(",");l.set.accesskeyid=d[0],l.set.secretaccesskey=d[1],l.set.lexregion=d[2],l.set.botname=d[3],l.set.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.set.appdata.split(",");l.set.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.set.text=d.slice(1,d.length).join(",");break;case"message":l.set.text=l.set.appdata;break;case"set":l.set.name=l.set.appdata.split("=")[0],l.set.value=l.set.appdata.split("=")[1];break;case"agi":l.set.project=l.set.appdata;break;default:var c=l.set.appdata.split("=");l.set.name=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.set.value=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outbounddial"===l.set.appType.toLowerCase()&&(l.set.prefix=l.set.phone?l.set.phone.split("$")[0]:void 0,l.set.callerId=l.set.callerID?"CALLERID(all)="+l.set.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outboundDial"===l.set.appType&&(l.set.phone=i.cutdigits?(l.set.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.set.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.set.options+="U(xcally-mixmonitor-context)"):l.set.options=l.set.options.replace("U(xcally-mixmonitor-context)",""));if(l.set.appType&&"custom"===l.set.appType);else switch((l.set.app||l.set.appType).toLowerCase()){case"set":l.set.appdata=l.set.name+"="+l.set.value;break;case"custom":break;default:e[0]=l.set.name,e[1]=l.set.value,l.set.appdata=e.join("=")}m(l.set)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.set&&(n=_.find(l.variables,{name:l.set.name})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.set&&(a=_.find(l.variables,{name:l.set.name}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppsetDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.voicemail=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.voicemail.appdata)switch(l.voicemail.appType?l.voicemail.appType.toLowerCase():l.voicemail.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.voicemail.appdata.split(",");l.voicemail.key=d[0],l.voicemail.language=d[1],l.voicemail.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.voicemail.appdata.split(",");l.voicemail.accesskeyid=d[0],l.voicemail.secretaccesskey=d[1],l.voicemail.lexregion=d[2],l.voicemail.botname=d[3],l.voicemail.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.voicemail.appdata.split(",");l.voicemail.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.voicemail.text=d.slice(1,d.length).join(",");break;case"message":l.voicemail.text=l.voicemail.appdata;break;case"set":l.voicemail.name=l.voicemail.appdata.split("=")[0],l.voicemail.value=l.voicemail.appdata.split("=")[1];break;case"agi":l.voicemail.project=l.voicemail.appdata;break;default:var c=l.voicemail.appdata.split(",");l.voicemail.voiceMail=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.voicemail.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outbounddial"===l.voicemail.appType.toLowerCase()&&(l.voicemail.prefix=l.voicemail.phone?l.voicemail.phone.split("$")[0]:void 0,l.voicemail.callerId=l.voicemail.callerID?"CALLERID(all)="+l.voicemail.callerID:void 0),l.saveInboundRouteApp=function(){l.errors=[];var e=[];l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outboundDial"===l.voicemail.appType&&(l.voicemail.phone=i.cutdigits?(l.voicemail.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.voicemail.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.voicemail.options+="U(xcally-mixmonitor-context)"):l.voicemail.options=l.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(l.voicemail.appType&&"custom"===l.voicemail.appType);else switch((l.voicemail.app||l.voicemail.appType).toLowerCase()){case"set":l.voicemail.appdata=l.voicemail.name+"="+l.voicemail.value;break;case"custom":break;default:e[0]=l.voicemail.voiceMail,e[1]=l.voicemail.options,l.voicemail.appdata=e.join(",")}m(l.voicemail)},l.closeDialog=m,o.hasRole("admin")?s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEMAILS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:406}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.voiceMails,{id:e.resourceId})}),n=null;if(l.voicemail&&(n=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail})),n&&!_.some(t,["id",n.id])){var a=_.find(l.voiceMails,{id:n.id});a.canSelect=!1,t.push(a)}l.voiceMails=t})}else{var n=[],a=null;l.voicemail&&(a=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail}));for(var i=0;i<l.voiceMails.length;i++)a&&l.voiceMails[i].id===a.id&&(l.voiceMails[i].canSelect=!1,n.push(l.voiceMails[i]));l.voiceMails=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","inboundrouteApp","inboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInboundAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.inboundroute=c||e.params.inboundroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoInboundRoutes=function(){e.go("app.voice.inboundroutes")},u.saveInboundRoute=function(){r.voiceExtension.update({id:u.inboundroute.id},u.inboundroute).$promise.then(function(){l.success({title:"InboundRoute updated!",msg:u.inboundroute.name?u.inboundroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.inboundroute&&(n=_.find(u.contexts,{name:u.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","inboundroute","userProfileSection"],angular.module("app.voice").controller("InboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.inboundroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="inboundroutes",b.listOrder="",b.listOrderAsc=null,b.selectedInboundRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"inbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.voice.inboundroutes.edit",{id:e.id,inboundroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("inboundroute")+"?").htmlContent("<b>"+(e.name||"inboundroute")+"</b> will be deleted.").ariaLabel("delete inboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getInboundRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="InboundRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInboundRoute=function(e,t){i.show({controller:"CreateOrEditInboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/inboundroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{inboundroute:t,inboundroutes:b.inboundroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInboundRoute=S,b.exportSelectedInboundRoutes=function(){var e=angular.copy(b.selectedInboundRoutes);return b.selectedInboundRoutes=[],e},b.deleteSelectedInboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected inboundroutes?").htmlContent("<b>"+b.selectedInboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedInboundRoutes.forEach(function(e){S(e)}),b.selectedInboundRoutes=[]})},b.deselectInboundRoutes=function(){b.selectedInboundRoutes=[]},b.selectAllInboundRoutes=function(){b.selectedInboundRoutes=b.inboundroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.inboundroute&&(n=_.find(b.contexts,{name:b.inboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.inboundroutes=e||{count:0,rows:[]}}function S(e){m.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(b.inboundroutes.rows,{id:e.id}),b.inboundroutes.count-=1,b.inboundroutes.rows.length||b.getInboundRoutes(),p.success({title:_.startCase("InboundRoute")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getInboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","inboundroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InboundRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_INTERNALROUTE",g.internalroute=angular.copy(l),g.internalroutes=r,g.newInternalRoute=!1,g.internalroute||(g.internalroute={appdata:"Internal Call",type:"internal",context:"from-sip"},g.title="VOICE.NEW_INTERNALROUTE",g.newInternalRoute=!0),g.addNewInternalRoute=function(){g.errors=[],d.voiceExtension.save(g.internalroute).$promise.then(function(e){g.internalroutes.unshift(e.toJSON()),o.success({title:"InternalRoute properly created",msg:g.internalroute.name?g.internalroute.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveInternalRoute=function(){g.errors=[],d.voiceExtension.update({id:g.internalroute.id},g.internalroute).$promise.then(function(e){var t=_.find(g.internalroutes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"InternalRoute properly saved!",msg:g.internalroute.name?g.internalroute.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteInternalRoute=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The internalroute will be deleted.").ariaLabel("Delete InternalRoute").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceExtension.delete({id:g.internalroute.id}).$promise.then(function(){_.remove(g.internalroutes,{id:g.internalroute.id}),o.success({title:"InternalRoute properly deleted!",msg:(g.internalroute.name||"internalroute")+" has been deleted!"}),v(g.internalroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.contexts=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.contexts,{id:e.resourceId})}),n=null;if(g.internalroute&&(n=_.find(g.contexts,{name:g.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(g.contexts,{id:n.id});a.canSelect=!1,t.push(a)}g.contexts=t}):d.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){g.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","internalroutes","internalroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditInternalRouteDialogController",e)}(),function(){"use strict";function e(m,i,a,s,e){var u=this;function t(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalrouteApp:n,internalroute:u.internalroute,crudPermissions:u.crudPermissions}}).then(function(e){e&&(e.id?u.internalrouteApps.rows[t]=e:u.internalrouteApps.rows.splice(t,0,e),o())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function o(){var e=["queue","playback"],t=2,n=[];n.push({type:"internal",app:"Set",appdata:"CDR(type)=internal",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id}),n.push({type:"internal",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:u.internalroute.context,exten:u.internalroute.exten,priority:t++,VoiceExtensionId:u.internalroute.id});for(var a=0,i=0;a<u.internalrouteApps.rows.length;a++,i=0){var s=u.internalrouteApps.rows[a],o=[],r=[];s.intervals="*,*,*,*"!==s.interval?[s.interval]:s.IntervalId?_.map(_.filter(u.intervals.rows,{IntervalId:s.IntervalId}),"interval"):[],s.context=u.internalroute.context,s.exten=u.internalroute.exten,s.type&&(s.type=s.type.toLowerCase()),s.hasOwnProperty("answer")&&e.includes(s.app.toLowerCase())&&"custom"!==s.appType&&(s.answer?(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-ANSWER}=0]?Answer",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-ANSWER=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})):(o.push({type:s.type.toLowerCase(),app:"ExecIf",appdata:"$[${XCALLY-MOTION-PROGRESS}=0]?Progress",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id}),o.push({type:s.type.toLowerCase(),app:"Set",appdata:"XCALLY-MOTION-PROGRESS=1",context:u.internalroute.context,exten:u.internalroute.exten,priority:s.intervals.length+t+i++,VoiceExtensionId:u.internalroute.id})));for(var l=0;l<s.intervals.length;l++){var d=t+s.intervals.length,c=l===s.intervals.length-1?t+o.length+r.length+2:t+l+1;o.splice(l,0,{type:"internal",app:"GotoIfTime",appdata:s.intervals[l]+"?"+u.internalroute.context+",${EXTEN},"+d+":"+u.internalroute.context+",${EXTEN},"+c,exten:u.internalroute.exten,context:u.internalroute.context,priority:t+l,VoiceExtensionId:u.internalroute.id})}s.priority=o.length?_.last(o).priority+1:t,t=(r.length?_.last(r).priority:s.priority)+1,n=_.concat(n,o,[s],r)}n.push({type:"internal",app:"Hangup",exten:u.internalroute.exten,context:u.internalroute.context,priority:t,VoiceExtensionId:u.internalroute.id}),m.voiceExtension.addApplications({id:u.internalroute.id},_.sortBy(n,"priority")).$promise.then(function(e){u.internalrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function n(e){u.internalrouteApps=e||{count:0,rows:[]}}u.currentUser=e.getCurrentUser(),u.internalroute={},u.internalrouteApps={count:0,rows:[]},u.selectedInternalRouteApps=[],u.crudPermissions,u.query={sort:"priority"},u.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Internal",types:["always","custom","list"],fields:[],isApp:!1},{app:"Queue",appType:"queue",context:"from-sip",type:"Internal",options:"xX",appdata:",xX,,,300,,,,,",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"sound",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}},{name:"queues",field:{name:"queue",key:"name"},route:"voiceQueue",filters:{type:"inbound",fields:"id,name,type",sort:"name",nolimit:!0},permissions:{section:401}}],fields:[{title:"Queue",name:"queue",type:"apiselect",values:"queues",value:"queue.name",option:"queue.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Url",name:"URL",type:"text",param:2},{title:"Announce_Overrides",name:"sound",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'",option:"sound.name",defaultValues:[{value:"''",option:"None"}],param:3},{title:"Timeout",name:"timeout",type:"number",min:0,param:4},{title:"Agi",name:"agi",type:"text",param:5},{title:"Macro",name:"macro",type:"text",param:6},{title:"GoSub",name:"gosub",type:"text",param:7},{title:"Rule",name:"rule",type:"text",param:8},{title:"Position",name:"position",type:"number",min:0,param:9},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Playback",appType:"playback",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",answer:!0,isApp:!0,extraApi:[{name:"sounds",field:{name:"appdata",key:"save_name",prefix:"/var/opt/motion2/server/files/sounds/converted/"},route:"sound",filters:{fields:"id,name,save_name",sort:"name"},permissions:{section:1007}}],fields:[{title:"Audio_Files",name:"appdata",type:"apiselect",values:"sounds",value:"'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}'",option:"appdata.name",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1},{title:"Answer",name:"answer",type:"switch",general:!0}]},{app:"Dial",appType:"dial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,fields:[{title:"Technology/Resource",name:"tech",type:"text",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"internalDial",context:"from-sip",type:"Internal",icon:"icon-apps",options:"xX",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"users",field:{name:"user",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"user",type:"apiselect",values:"users",value:"'SIP/{{user.name}}'",option:"user.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"externalDial",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Phone",name:"phone",type:"text"},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"Dial",appType:"ringGroup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"users",field:{name:"multipleUsers",key:"name",prefix:"SIP/"},route:"user",filters:{fields:"id,name,role",sort:"name"},permissions:{sections:[{id:202,role:"agent"},{id:203,role:"telephone"}]}}],fields:[{title:"User",name:"multipleUsers",type:"apiselect",multiple:!0,values:"users",value:"'SIP/{{multipleUsers.name}}'",option:"multipleUsers.name",required:!0,param:0},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:"AGI",alias:"CallySquare",appType:"agi",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"projects",field:{name:"project",key:"name",prefix:"agi://127.0.0.1/square,"},route:"squareProject",filters:{fields:"id,name",sort:"name"},permissions:{section:1103}}],fields:[{title:"Project",name:"project",type:"apiselect",values:"projects",value:"'agi://127.0.0.1/square,{{project.name}}'",option:"project.name",required:!0,param:0}]},{app:"goto",appType:"goTo",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"contexts",field:{name:"context",key:"name"},route:"voiceContext",filters:{fields:"id,name",sort:"name"},permissions:{section:405}}],fields:[{title:"Context",name:"context",type:"apiselect",values:"contexts",value:"context.name",option:"context.name",required:!0,param:0},{title:"Extension",name:"extension",type:"text",required:!0,param:1},{title:"Priority",name:"priority",type:"text",required:!0,param:2}]},{app:"hangup",appType:"hangup",context:"from-sip",type:"Internal",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Hangup_Cause",name:"appdata",type:"select",param:0,values:[{option:"HANGUPCAUSE_1",value:"'1'"},{option:"HANGUPCAUSE_16",value:"'16'"},{option:"HANGUPCAUSE_17",value:"'17'"},{option:"HANGUPCAUSE_18",value:"'18'"},{option:"HANGUPCAUSE_21",value:"'21'"},{option:"HANGUPCAUSE_22",value:"'22'"},{option:"HANGUPCAUSE_27",value:"'27'"},{option:"HANGUPCAUSE_38",value:"'38'"},{option:"HANGUPCAUSE_41",value:"'41'"}],translate:!0,required:!0,general:!0}]},{app:"Set",appType:"set",context:"from-sip",type:"Internal",separator:"=",icon:"icon-apps",interval:"*,*,*,*",extraApi:[{name:"variables",field:{name:"name",key:"name"},route:"variable",filters:{fields:"id,name",sort:"name"},permissions:{section:1012}}],isApp:!0,fields:[{title:"Variable",name:"name",type:"apiselect",values:"variables",value:"name.name",option:"name.name",required:!0,param:0},{title:"Value",name:"value",type:"text",required:!0,param:1}]},{app:null,appType:"custom",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]},{app:"Voicemail",appType:"voicemail",context:"from-sip",icon:"icon-apps",type:"Internal",interval:"*,*,*,*",isApp:!0,extraApi:[{name:"voiceMails",field:{name:"voiceMail",key:"mailbox",suffix:"@from-voicemail"},route:"voiceMail",filters:{fields:"id,mailbox",sort:"mailbox"},permissions:{section:406}}],fields:[{title:"Mailbox@Context",name:"voiceMail",type:"apiselect",values:"voiceMails",value:"'{{voiceMail.mailbox}}@from-voicemail'",option:"voiceMail.mailbox",required:!0,param:0},{title:"Options",name:"options",type:"text",param:1}]}],["app"]),{isApp:!1}),u.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},u.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){t(e,e.newIndex)},onSort:function(e){o()}},u.init=function(e,t){u.internalroute=e,u.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},u.applications.disabled=!u.crudPermissions.canEdit,u.query.VoiceExtensionId=e.id,u.query.isApp=!0,u.query.nolimit=!0,u.getInternalRouteApps(),u.getIntervals()},u.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){u.internalrouteApps.rows.splice(t,1),o()},function(){console.log("CANCEL")})},u.getInternalRouteApps=function(){u.promise=m.voiceExtension.get(u.query,n).$promise},u.editInternalRouteApp=t,u.editInterval=function(e,t){if(u.internalrouteApps.rows.length){var n=u.internalrouteApps.rows[t]?u.internalrouteApps.rows[t]:u.internalrouteApps.rows[0];i.show({controller:"EditInternalAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:u.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,o())})}},u.deleteInternalRouteApp=function(e){_.remove(u.internalrouteApps.rows,{id:e.id}),o(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},u.deleteSelectedInternalRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+u.selectedInternalRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){u.selectedInternalRouteApps.forEach(function(e){_.remove(u.internalrouteApps.rows,{id:e.id})}),u.selectedInternalRouteApps=[],o()})},u.rewriteRouting=o,u.getIntervals=function(){return m.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){u.intervals=e}).catch(function(e){console.error(e)})}}e.$inject=["api","$mdDialog","$document","toasty","Auth"],angular.module("app.voice").controller("InternalRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.agi=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.agi.appdata)switch(l.agi.appType?l.agi.appType.toLowerCase():l.agi.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.agi.appdata.split(",");l.agi.key=d[0],l.agi.language=d[1],l.agi.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.agi.appdata.split(",");l.agi.accesskeyid=d[0],l.agi.secretaccesskey=d[1],l.agi.lexregion=d[2],l.agi.botname=d[3],l.agi.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.agi.appdata.split(",");l.agi.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.agi.text=d.slice(1,d.length).join(",");break;case"message":l.agi.text=l.agi.appdata;break;case"set":l.agi.name=l.agi.appdata.split("=")[0],l.agi.value=l.agi.appdata.split("=")[1];break;case"agi":l.agi.project=l.agi.appdata;break;default:var c=l.agi.appdata.split(",");l.agi.project=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outbounddial"===l.agi.appType.toLowerCase()&&(l.agi.prefix=l.agi.phone?l.agi.phone.split("$")[0]:void 0,l.agi.callerId=l.agi.callerID?"CALLERID(all)="+l.agi.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.agi.type&&"outbound"===l.agi.type.toLowerCase()&&"outboundDial"===l.agi.appType&&(l.agi.phone=i.cutdigits?(l.agi.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.agi.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.agi.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.agi.options+="U(xcally-mixmonitor-context)"):l.agi.options=l.agi.options.replace("U(xcally-mixmonitor-context)",""));if(l.agi.appType&&"custom"===l.agi.appType);else switch((l.agi.app||l.agi.appType).toLowerCase()){case"set":l.agi.appdata=l.agi.name+"="+l.agi.value;break;case"custom":break;default:e[0]=l.agi.project,l.agi.appdata=e.join(",")}m(l.agi)},l.closeDialog=m,o.hasRole("admin")?s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PROJECTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.squareProject.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.projects=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1103}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.projects,{id:e.resourceId})}),n=null;if(l.agi&&(n=_.find(l.projects,{name:l.agi.project})),n&&!_.some(t,["id",n.id])){var a=_.find(l.projects,{id:n.id});a.canSelect=!1,t.push(a)}l.projects=t})}else{var n=[],a=null;l.agi&&(a=_.find(l.projects,{name:l.agi.project}));for(var i=0;i<l.projects.length;i++)a&&l.projects[i].id===a.id&&(l.projects[i].canSelect=!1,n.push(l.projects[i]));l.projects=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETprojects",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppagiDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppcustomDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.dial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.dial.appdata)switch(l.dial.appType?l.dial.appType.toLowerCase():l.dial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.dial.appdata.split(",");l.dial.key=d[0],l.dial.language=d[1],l.dial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.dial.appdata.split(",");l.dial.accesskeyid=d[0],l.dial.secretaccesskey=d[1],l.dial.lexregion=d[2],l.dial.botname=d[3],l.dial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.dial.appdata.split(",");l.dial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.dial.text=d.slice(1,d.length).join(",");break;case"message":l.dial.text=l.dial.appdata;break;case"set":l.dial.name=l.dial.appdata.split("=")[0],l.dial.value=l.dial.appdata.split("=")[1];break;case"agi":l.dial.project=l.dial.appdata;break;default:var c=l.dial.appdata.split(",");l.dial.tech=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.dial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.dial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.dial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outbounddial"===l.dial.appType.toLowerCase()&&(l.dial.prefix=l.dial.phone?l.dial.phone.split("$")[0]:void 0,l.dial.callerId=l.dial.callerID?"CALLERID(all)="+l.dial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.dial.type&&"outbound"===l.dial.type.toLowerCase()&&"outboundDial"===l.dial.appType&&(l.dial.phone=i.cutdigits?(l.dial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.dial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.dial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.dial.options+="U(xcally-mixmonitor-context)"):l.dial.options=l.dial.options.replace("U(xcally-mixmonitor-context)",""));if(l.dial.appType&&"custom"===l.dial.appType);else switch((l.dial.app||l.dial.appType).toLowerCase()){case"set":l.dial.appdata=l.dial.name+"="+l.dial.value;break;case"custom":break;default:e[0]=l.dial.tech,e[1]=l.dial.timeout,e[2]=l.dial.options,e[3]=l.dial.url,l.dial.appdata=e.join(",")}m(l.dial)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppdialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.externaldial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.externaldial.appdata)switch(l.externaldial.appType?l.externaldial.appType.toLowerCase():l.externaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.externaldial.appdata.split(",");l.externaldial.key=d[0],l.externaldial.language=d[1],l.externaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.externaldial.appdata.split(",");l.externaldial.accesskeyid=d[0],l.externaldial.secretaccesskey=d[1],l.externaldial.lexregion=d[2],l.externaldial.botname=d[3],l.externaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.externaldial.appdata.split(",");l.externaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.externaldial.text=d.slice(1,d.length).join(",");break;case"message":l.externaldial.text=l.externaldial.appdata;break;case"set":l.externaldial.name=l.externaldial.appdata.split("=")[0],l.externaldial.value=l.externaldial.appdata.split("=")[1];break;case"agi":l.externaldial.project=l.externaldial.appdata;break;default:var c=l.externaldial.appdata.split(",");l.externaldial.trunk=c[0].split("/")[1],l.externaldial.phone=c[0].split("/")[2],l.externaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.externaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.externaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outbounddial"===l.externaldial.appType.toLowerCase()&&(l.externaldial.prefix=l.externaldial.phone?l.externaldial.phone.split("$")[0]:void 0,l.externaldial.callerId=l.externaldial.callerID?"CALLERID(all)="+l.externaldial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.externaldial.type&&"outbound"===l.externaldial.type.toLowerCase()&&"outboundDial"===l.externaldial.appType&&(l.externaldial.phone=i.cutdigits?(l.externaldial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.externaldial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.externaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.externaldial.options+="U(xcally-mixmonitor-context)"):l.externaldial.options=l.externaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.externaldial.appType&&"custom"===l.externaldial.appType);else switch((l.externaldial.app||l.externaldial.appType).toLowerCase()){case"set":l.externaldial.appdata=l.externaldial.name+"="+l.externaldial.value;break;case"custom":break;default:e[0]=["SIP",l.externaldial.trunk,l.externaldial.phone].join("/"),e[1]=l.externaldial.timeout,e[2]=l.externaldial.options,e[3]=l.externaldial.url,l.externaldial.appdata=e.join(",")}m(l.externaldial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.externaldial&&(n=_.find(l.trunks,{name:l.externaldial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.externaldial&&(a=_.find(l.trunks,{name:l.externaldial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppexternaldialDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.goto=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.goto.appdata)switch(l.goto.appType?l.goto.appType.toLowerCase():l.goto.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.goto.appdata.split(",");l.goto.key=d[0],l.goto.language=d[1],l.goto.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.goto.appdata.split(",");l.goto.accesskeyid=d[0],l.goto.secretaccesskey=d[1],l.goto.lexregion=d[2],l.goto.botname=d[3],l.goto.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.goto.appdata.split(",");l.goto.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.goto.text=d.slice(1,d.length).join(",");break;case"message":l.goto.text=l.goto.appdata;break;case"set":l.goto.name=l.goto.appdata.split("=")[0],l.goto.value=l.goto.appdata.split("=")[1];break;case"agi":l.goto.project=l.goto.appdata;break;default:var c=l.goto.appdata.split(",");l.goto.context=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.goto.extension=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.goto.priority=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10)}function m(e){t.hide(e)}l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outbounddial"===l.goto.appType.toLowerCase()&&(l.goto.prefix=l.goto.phone?l.goto.phone.split("$")[0]:void 0,l.goto.callerId=l.goto.callerID?"CALLERID(all)="+l.goto.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.goto.type&&"outbound"===l.goto.type.toLowerCase()&&"outboundDial"===l.goto.appType&&(l.goto.phone=i.cutdigits?(l.goto.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.goto.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.goto.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.goto.options+="U(xcally-mixmonitor-context)"):l.goto.options=l.goto.options.replace("U(xcally-mixmonitor-context)",""));if(l.goto.appType&&"custom"===l.goto.appType);else switch((l.goto.app||l.goto.appType).toLowerCase()){case"set":l.goto.appdata=l.goto.name+"="+l.goto.value;break;case"custom":break;default:e[0]=l.goto.context,e[1]=l.goto.extension,e[2]=l.goto.priority,l.goto.appdata=e.join(",")}m(l.goto)},l.closeDialog=m,o.hasRole("admin")?s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.contexts=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.contexts,{id:e.resourceId})}),n=null;if(l.goto&&(n=_.find(l.contexts,{name:l.goto.context})),n&&!_.some(t,["id",n.id])){var a=_.find(l.contexts,{id:n.id});a.canSelect=!1,t.push(a)}l.contexts=t}):s.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){l.contexts=e.rows||[]})}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppgotoDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.hangup=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.hangup.appdata)switch(l.hangup.appType?l.hangup.appType.toLowerCase():l.hangup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.hangup.appdata.split(",");l.hangup.key=d[0],l.hangup.language=d[1],l.hangup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.hangup.appdata.split(",");l.hangup.accesskeyid=d[0],l.hangup.secretaccesskey=d[1],l.hangup.lexregion=d[2],l.hangup.botname=d[3],l.hangup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.hangup.appdata.split(",");l.hangup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.hangup.text=d.slice(1,d.length).join(",");break;case"message":l.hangup.text=l.hangup.appdata;break;case"set":l.hangup.name=l.hangup.appdata.split("=")[0],l.hangup.value=l.hangup.appdata.split("=")[1];break;case"agi":l.hangup.project=l.hangup.appdata;break;default:var c=l.hangup.appdata.split(",");l.hangup.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10)}function m(e){t.hide(e)}l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outbounddial"===l.hangup.appType.toLowerCase()&&(l.hangup.prefix=l.hangup.phone?l.hangup.phone.split("$")[0]:void 0,l.hangup.callerId=l.hangup.callerID?"CALLERID(all)="+l.hangup.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.hangup.type&&"outbound"===l.hangup.type.toLowerCase()&&"outboundDial"===l.hangup.appType&&(l.hangup.phone=i.cutdigits?(l.hangup.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.hangup.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.hangup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.hangup.options+="U(xcally-mixmonitor-context)"):l.hangup.options=l.hangup.options.replace("U(xcally-mixmonitor-context)",""));if(l.hangup.appType&&"custom"===l.hangup.appType);else switch((l.hangup.app||l.hangup.appType).toLowerCase()){case"set":l.hangup.appdata=l.hangup.name+"="+l.hangup.value;break;case"custom":break;default:e[0]=l.hangup.appdata,l.hangup.appdata=e.join(",")}m(l.hangup)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalApphangupDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.internaldial=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.internaldial.appdata)switch(l.internaldial.appType?l.internaldial.appType.toLowerCase():l.internaldial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.internaldial.appdata.split(",");l.internaldial.key=d[0],l.internaldial.language=d[1],l.internaldial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.internaldial.appdata.split(",");l.internaldial.accesskeyid=d[0],l.internaldial.secretaccesskey=d[1],l.internaldial.lexregion=d[2],l.internaldial.botname=d[3],l.internaldial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.internaldial.appdata.split(",");l.internaldial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.internaldial.text=d.slice(1,d.length).join(",");break;case"message":l.internaldial.text=l.internaldial.appdata;break;case"set":l.internaldial.name=l.internaldial.appdata.split("=")[0],l.internaldial.value=l.internaldial.appdata.split("=")[1];break;case"agi":l.internaldial.project=l.internaldial.appdata;break;default:var c=l.internaldial.appdata.split(",");l.internaldial.user=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.internaldial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.internaldial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.internaldial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outbounddial"===l.internaldial.appType.toLowerCase()&&(l.internaldial.prefix=l.internaldial.phone?l.internaldial.phone.split("$")[0]:void 0,l.internaldial.callerId=l.internaldial.callerID?"CALLERID(all)="+l.internaldial.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.internaldial.type&&"outbound"===l.internaldial.type.toLowerCase()&&"outboundDial"===l.internaldial.appType&&(l.internaldial.phone=a.cutdigits?(l.internaldial.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.internaldial.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.internaldial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.internaldial.options+="U(xcally-mixmonitor-context)"):l.internaldial.options=l.internaldial.options.replace("U(xcally-mixmonitor-context)",""));if(l.internaldial.appType&&"custom"===l.internaldial.appType);else switch((l.internaldial.app||l.internaldial.appType).toLowerCase()){case"set":l.internaldial.appdata=l.internaldial.name+"="+l.internaldial.value;break;case"custom":break;default:e[0]=l.internaldial.user,e[1]=l.internaldial.timeout,e[2]=l.internaldial.options,e[3]=l.internaldial.url,l.internaldial.appdata=e.join(",")}p(l.internaldial)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.internaldial&&(n=_.find(u,{name:l.internaldial.user}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppinternaldialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.playback=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.playback.appdata)switch(l.playback.appType?l.playback.appType.toLowerCase():l.playback.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.playback.appdata.split(",");l.playback.key=d[0],l.playback.language=d[1],l.playback.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.playback.appdata.split(",");l.playback.accesskeyid=d[0],l.playback.secretaccesskey=d[1],l.playback.lexregion=d[2],l.playback.botname=d[3],l.playback.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.playback.appdata.split(",");l.playback.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.playback.text=d.slice(1,d.length).join(",");break;case"message":l.playback.text=l.playback.appdata;break;case"set":l.playback.name=l.playback.appdata.split("=")[0],l.playback.value=l.playback.appdata.split("=")[1];break;case"agi":l.playback.project=l.playback.appdata;break;default:var c=l.playback.appdata.split(",");l.playback.appdata=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.playback.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outbounddial"===l.playback.appType.toLowerCase()&&(l.playback.prefix=l.playback.phone?l.playback.phone.split("$")[0]:void 0,l.playback.callerId=l.playback.callerID?"CALLERID(all)="+l.playback.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.playback.type&&"outbound"===l.playback.type.toLowerCase()&&"outboundDial"===l.playback.appType&&(l.playback.phone=i.cutdigits?(l.playback.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.playback.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.playback.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.playback.options+="U(xcally-mixmonitor-context)"):l.playback.options=l.playback.options.replace("U(xcally-mixmonitor-context)",""));if(l.playback.appType&&"custom"===l.playback.appType);else switch((l.playback.app||l.playback.appType).toLowerCase()){case"set":l.playback.appdata=l.playback.name+"="+l.playback.value;break;case"custom":break;default:e[0]=l.playback.appdata,e[1]=l.playback.options,l.playback.appdata=e.join(",")}m(l.playback)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.playback&&(n=_.find(l.sounds,{save_name:l.playback.appdata})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.playback&&(a=_.find(l.sounds,{save_name:l.playback.appdata}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppplaybackDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.queue=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.queue.appdata)switch(l.queue.appType?l.queue.appType.toLowerCase():l.queue.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.queue.appdata.split(",");l.queue.key=d[0],l.queue.language=d[1],l.queue.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.queue.appdata.split(",");l.queue.accesskeyid=d[0],l.queue.secretaccesskey=d[1],l.queue.lexregion=d[2],l.queue.botname=d[3],l.queue.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.queue.appdata.split(",");l.queue.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.queue.text=d.slice(1,d.length).join(",");break;case"message":l.queue.text=l.queue.appdata;break;case"set":l.queue.name=l.queue.appdata.split("=")[0],l.queue.value=l.queue.appdata.split("=")[1];break;case"agi":l.queue.project=l.queue.appdata;break;default:var c=l.queue.appdata.split(",");l.queue.queue=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.queue.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.queue.URL=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.queue.sound=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10),l.queue.timeout=_.isEmpty(c[4])?c[4]:isNaN(c[4])?c[4]:parseInt(c[4],10),l.queue.agi=_.isEmpty(c[5])?c[5]:isNaN(c[5])?c[5]:parseInt(c[5],10),l.queue.macro=_.isEmpty(c[6])?c[6]:isNaN(c[6])?c[6]:parseInt(c[6],10),l.queue.gosub=_.isEmpty(c[7])?c[7]:isNaN(c[7])?c[7]:parseInt(c[7],10),l.queue.rule=_.isEmpty(c[8])?c[8]:isNaN(c[8])?c[8]:parseInt(c[8],10),l.queue.position=_.isEmpty(c[9])?c[9]:isNaN(c[9])?c[9]:parseInt(c[9],10)}function m(e){t.hide(e)}l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outbounddial"===l.queue.appType.toLowerCase()&&(l.queue.prefix=l.queue.phone?l.queue.phone.split("$")[0]:void 0,l.queue.callerId=l.queue.callerID?"CALLERID(all)="+l.queue.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.queue.type&&"outbound"===l.queue.type.toLowerCase()&&"outboundDial"===l.queue.appType&&(l.queue.phone=i.cutdigits?(l.queue.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.queue.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.queue.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.queue.options+="U(xcally-mixmonitor-context)"):l.queue.options=l.queue.options.replace("U(xcally-mixmonitor-context)",""));if(l.queue.appType&&"custom"===l.queue.appType);else switch((l.queue.app||l.queue.appType).toLowerCase()){case"set":l.queue.appdata=l.queue.name+"="+l.queue.value;break;case"custom":break;default:e[0]=l.queue.queue,e[1]=l.queue.options,e[2]=l.queue.URL,e[3]=l.queue.sound,e[4]=l.queue.timeout,e[5]=l.queue.agi,e[6]=l.queue.macro,e[7]=l.queue.gosub,e[8]=l.queue.rule,e[9]=l.queue.position,l.queue.appdata=e.join(",")}m(l.queue)},l.closeDialog=m,o.hasRole("admin")?s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.sound.get({fields:"id,name,save_name",sort:"name"}).$promise.then(function(e){l.sounds=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.sounds,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.sounds,{save_name:l.queue.sound})),n&&!_.some(t,["id",n.id])){var a=_.find(l.sounds,{id:n.id});a.canSelect=!1,t.push(a)}l.sounds=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.sounds,{save_name:l.queue.sound}));for(var i=0;i<l.sounds.length;i++)a&&l.sounds[i].id===a.id&&(l.sounds[i].canSelect=!1,n.push(l.sounds[i]));l.sounds=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_QUEUES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceQueue.get({type:"inbound",fields:"id,name,type",sort:"name",nolimit:"true"}).$promise.then(function(e){l.queues=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:401}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.queues,{id:e.resourceId})}),n=null;if(l.queue&&(n=_.find(l.queues,{name:l.queue.queue})),n&&!_.some(t,["id",n.id])){var a=_.find(l.queues,{id:n.id});a.canSelect=!1,t.push(a)}l.queues=t})}else{var n=[],a=null;l.queue&&(a=_.find(l.queues,{name:l.queue.queue}));for(var i=0;i<l.queues.length;i++)a&&l.queues[i].id===a.id&&(l.queues[i].canSelect=!1,n.push(l.queues[i]));l.queues=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETqueues",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppqueueDialogController",e)}(),function(){"use strict";function e(t,o,n,e,a,r,i,s){var l=this;if(l.currentUser=i.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(e.appType||e.app).toUpperCase(),l.ringgroup=angular.copy(e),l.crudPermissions=s,l.hasModulePermissions={},l.ringgroup.appdata)switch(l.ringgroup.appType?l.ringgroup.appType.toLowerCase():l.ringgroup.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.ringgroup.appdata.split(",");l.ringgroup.key=d[0],l.ringgroup.language=d[1],l.ringgroup.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.ringgroup.appdata.split(",");l.ringgroup.accesskeyid=d[0],l.ringgroup.secretaccesskey=d[1],l.ringgroup.lexregion=d[2],l.ringgroup.botname=d[3],l.ringgroup.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.ringgroup.appdata.split(",");l.ringgroup.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.ringgroup.text=d.slice(1,d.length).join(",");break;case"message":l.ringgroup.text=l.ringgroup.appdata;break;case"set":l.ringgroup.name=l.ringgroup.appdata.split("=")[0],l.ringgroup.value=l.ringgroup.appdata.split("=")[1];break;case"agi":l.ringgroup.project=l.ringgroup.appdata;break;default:var c=l.ringgroup.appdata.split(",");l.ringgroup.multipleUsers=c[0].split("&"),l.ringgroup.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.ringgroup.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.ringgroup.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outbounddial"===l.ringgroup.appType.toLowerCase()&&(l.ringgroup.prefix=l.ringgroup.phone?l.ringgroup.phone.split("$")[0]:void 0,l.ringgroup.callerId=l.ringgroup.callerID?"CALLERID(all)="+l.ringgroup.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.ringgroup.type&&"outbound"===l.ringgroup.type.toLowerCase()&&"outboundDial"===l.ringgroup.appType&&(l.ringgroup.phone=a.cutdigits?(l.ringgroup.prefix||"")+"${EXTEN:"+a.cutdigits+"}":(l.ringgroup.prefix||"")+"${EXTEN}","none"!==a.recordingFormat?l.ringgroup.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.ringgroup.options+="U(xcally-mixmonitor-context)"):l.ringgroup.options=l.ringgroup.options.replace("U(xcally-mixmonitor-context)",""));if(l.ringgroup.appType&&"custom"===l.ringgroup.appType);else switch((l.ringgroup.app||l.ringgroup.appType).toLowerCase()){case"set":l.ringgroup.appdata=l.ringgroup.name+"="+l.ringgroup.value;break;case"custom":break;default:e[0]=l.ringgroup.multipleUsers.join("&"),e[1]=l.ringgroup.timeout,e[2]=l.ringgroup.options,e[3]=l.ringgroup.url,l.ringgroup.appdata=e.join(",")}p(l.ringgroup)},l.closeDialog=p;var m=[{id:202,role:"agent"},{id:203,role:"telephone"}],u=null;function p(e){t.hide(e)}i.hasRole("admin")?r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){l.users=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_USERS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.user.get({fields:"id,name,role",sort:"name"}).$promise.then(function(e){u=e.rows||[]}).then(function(){for(var e=[],t=0;t<m.length;t++)e.push(r.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:m[t].id}).$promise);return o.all(e)}).then(function(e){for(var t=_.map(e,function(e){return e&&e.rows?e.rows[0]:null}),n=[],a=0;a<m.length;a++){var i=_.find(t,["sectionId",m[a].id]);if(i)if(i.autoAssociation){var s=[];u.forEach(function(e){e.role===m[a].role&&s.push(e)}),n.push({rows:s,count:s.length})}else n.push(r.userProfileResource.get({sectionId:i.id}).$promise)}return o.all(n)}).then(function(e){var t=[],n=null;l.ringgroup&&(n=_.find(u,{name:l.ringgroup.multipleUsers}));for(var a=0;a<e.length;a++){(e[a].rows||[]).forEach(function(e){t.push(e)})}n&&!_.some(t,["resourceId",n.id])&&u.forEach(function(e){e.id===n.id&&(e.canSelect=!1,t.push(e))}),l.users=t}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETusers",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppringgroupDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.set=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.set.appdata)switch(l.set.appType?l.set.appType.toLowerCase():l.set.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.set.appdata.split(",");l.set.key=d[0],l.set.language=d[1],l.set.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.set.appdata.split(",");l.set.accesskeyid=d[0],l.set.secretaccesskey=d[1],l.set.lexregion=d[2],l.set.botname=d[3],l.set.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.set.appdata.split(",");l.set.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.set.text=d.slice(1,d.length).join(",");break;case"message":l.set.text=l.set.appdata;break;case"set":l.set.name=l.set.appdata.split("=")[0],l.set.value=l.set.appdata.split("=")[1];break;case"agi":l.set.project=l.set.appdata;break;default:var c=l.set.appdata.split("=");l.set.name=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.set.value=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outbounddial"===l.set.appType.toLowerCase()&&(l.set.prefix=l.set.phone?l.set.phone.split("$")[0]:void 0,l.set.callerId=l.set.callerID?"CALLERID(all)="+l.set.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.set.type&&"outbound"===l.set.type.toLowerCase()&&"outboundDial"===l.set.appType&&(l.set.phone=i.cutdigits?(l.set.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.set.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.set.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.set.options+="U(xcally-mixmonitor-context)"):l.set.options=l.set.options.replace("U(xcally-mixmonitor-context)",""));if(l.set.appType&&"custom"===l.set.appType);else switch((l.set.app||l.set.appType).toLowerCase()){case"set":l.set.appdata=l.set.name+"="+l.set.value;break;case"custom":break;default:e[0]=l.set.name,e[1]=l.set.value,l.set.appdata=e.join("=")}m(l.set)},l.closeDialog=m,o.hasRole("admin")?s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VARIABLES",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.variable.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.variables=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1012}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.variables,{id:e.resourceId})}),n=null;if(l.set&&(n=_.find(l.variables,{name:l.set.name})),n&&!_.some(t,["id",n.id])){var a=_.find(l.variables,{id:n.id});a.canSelect=!1,t.push(a)}l.variables=t})}else{var n=[],a=null;l.set&&(a=_.find(l.variables,{name:l.set.name}));for(var i=0;i<l.variables.length;i++)a&&l.variables[i].id===a.id&&(l.variables[i].canSelect=!1,n.push(l.variables[i]));l.variables=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvariables",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppsetDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.voicemail=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.voicemail.appdata)switch(l.voicemail.appType?l.voicemail.appType.toLowerCase():l.voicemail.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.voicemail.appdata.split(",");l.voicemail.key=d[0],l.voicemail.language=d[1],l.voicemail.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.voicemail.appdata.split(",");l.voicemail.accesskeyid=d[0],l.voicemail.secretaccesskey=d[1],l.voicemail.lexregion=d[2],l.voicemail.botname=d[3],l.voicemail.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.voicemail.appdata.split(",");l.voicemail.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.voicemail.text=d.slice(1,d.length).join(",");break;case"message":l.voicemail.text=l.voicemail.appdata;break;case"set":l.voicemail.name=l.voicemail.appdata.split("=")[0],l.voicemail.value=l.voicemail.appdata.split("=")[1];break;case"agi":l.voicemail.project=l.voicemail.appdata;break;default:var c=l.voicemail.appdata.split(",");l.voicemail.voiceMail=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.voicemail.options=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outbounddial"===l.voicemail.appType.toLowerCase()&&(l.voicemail.prefix=l.voicemail.phone?l.voicemail.phone.split("$")[0]:void 0,l.voicemail.callerId=l.voicemail.callerID?"CALLERID(all)="+l.voicemail.callerID:void 0),l.saveInternalRouteApp=function(){l.errors=[];var e=[];l.voicemail.type&&"outbound"===l.voicemail.type.toLowerCase()&&"outboundDial"===l.voicemail.appType&&(l.voicemail.phone=i.cutdigits?(l.voicemail.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.voicemail.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.voicemail.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.voicemail.options+="U(xcally-mixmonitor-context)"):l.voicemail.options=l.voicemail.options.replace("U(xcally-mixmonitor-context)",""));if(l.voicemail.appType&&"custom"===l.voicemail.appType);else switch((l.voicemail.app||l.voicemail.appType).toLowerCase()){case"set":l.voicemail.appdata=l.voicemail.name+"="+l.voicemail.value;break;case"custom":break;default:e[0]=l.voicemail.voiceMail,e[1]=l.voicemail.options,l.voicemail.appdata=e.join(",")}m(l.voicemail)},l.closeDialog=m,o.hasRole("admin")?s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_VOICEMAILS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.voiceMail.get({fields:"id,mailbox",sort:"mailbox"}).$promise.then(function(e){l.voiceMails=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:406}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.voiceMails,{id:e.resourceId})}),n=null;if(l.voicemail&&(n=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail})),n&&!_.some(t,["id",n.id])){var a=_.find(l.voiceMails,{id:n.id});a.canSelect=!1,t.push(a)}l.voiceMails=t})}else{var n=[],a=null;l.voicemail&&(a=_.find(l.voiceMails,{mailbox:l.voicemail.voiceMail}));for(var i=0;i<l.voiceMails.length;i++)a&&l.voiceMails[i].id===a.id&&(l.voiceMails[i].canSelect=!1,n.push(l.voiceMails[i]));l.voiceMails=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMails",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","internalrouteApp","internalroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditInternalAppvoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.internalroute=c||e.params.internalroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoInternalRoutes=function(){e.go("app.voice.internalroutes")},u.saveInternalRoute=function(){r.voiceExtension.update({id:u.internalroute.id},u.internalroute).$promise.then(function(){l.success({title:"InternalRoute updated!",msg:u.internalroute.name?u.internalroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.internalroute&&(n=_.find(u.contexts,{name:u.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","internalroute","userProfileSection"],angular.module("app.voice").controller("InternalRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.internalroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="internalroutes",b.listOrder="",b.listOrderAsc=null,b.selectedInternalRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,description",type:"internal",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.editstate=function(e,t){n.go("app.voice.internalroutes.edit",{id:e.id,internalroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("internalroute")+"?").htmlContent("<b>"+(e.name||"internalroute")+"</b> will be deleted.").ariaLabel("delete internalroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getInternalRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="InternalRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditInternalRoute=function(e,t){i.show({controller:"CreateOrEditInternalRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/internalroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{internalroute:t,internalroutes:b.internalroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteInternalRoute=S,b.exportSelectedInternalRoutes=function(){var e=angular.copy(b.selectedInternalRoutes);return b.selectedInternalRoutes=[],e},b.deleteSelectedInternalRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected internalroutes?").htmlContent("<b>"+b.selectedInternalRoutes.length+" selected</b> will be deleted.").ariaLabel("delete InternalRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedInternalRoutes.forEach(function(e){S(e)}),b.selectedInternalRoutes=[]})},b.deselectInternalRoutes=function(){b.selectedInternalRoutes=[]},b.selectAllInternalRoutes=function(){b.selectedInternalRoutes=b.internalroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.internalroute&&(n=_.find(b.contexts,{name:b.internalroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.internalroutes=e||{count:0,rows:[]}}function S(e){m.voiceExtension.delete({id:e.id}).$promise.then(function(){_.remove(b.internalroutes.rows,{id:e.id}),b.internalroutes.count-=1,b.internalroutes.rows.length||b.getInternalRoutes(),p.success({title:_.startCase("InternalRoute")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getInternalRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","internalroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("InternalRoutesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MUSICONHOLD",g.musiconhold=angular.copy(l),g.musiconholds=r,g.newMusicOnHold=!1,g.musiconhold||(g.musiconhold={mode:"files"},g.title="VOICE.NEW_MUSICONHOLD",g.newMusicOnHold=!0),g.addNewMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.save(g.musiconhold).$promise.then(function(e){g.musiconholds.unshift(e.toJSON()),o.success({title:"MusicOnHold properly created",msg:g.musiconhold.name?g.musiconhold.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMusicOnHold=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.musiconhold.id},g.musiconhold).$promise.then(function(e){var t=_.find(g.musiconholds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MusicOnHold properly saved!",msg:g.musiconhold.name?g.musiconhold.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMusicOnHold=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The musiconhold will be deleted.").ariaLabel("Delete MusicOnHold").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMusicOnHold.delete({id:g.musiconhold.id}).$promise.then(function(){_.remove(g.musiconholds,{id:g.musiconhold.id}),o.success({title:"MusicOnHold properly deleted!",msg:(g.musiconhold.name||"musiconhold")+" has been deleted!"}),v(g.musiconhold)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","musiconholds","musiconhold","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMusicOnHoldDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.musiconhold={},c.musiconholdMohSounds={count:0,rows:[]},c.selectedMusicOnHoldMohSounds=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,save_name,converted_format,audio",limit:10,page:1},c.init=function(e,t){c.musiconhold=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.musiconhold.id,c.query.VoiceMusicOnHoldId=c.musiconhold.id,c.getMusicOnHoldMohSounds()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the mohSound?").htmlContent("<b>"+(e.name||"mohSound")+"</b> will be deleted.").ariaLabel("delete mohSound").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMusicOnHoldDownload=function(s,e,t){return l.sound.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="mohSound"+s.id,a=new Blob(t,{type:e.type});n=s.converted_format?s.save_name+"."+s.converted_format:s.save_name;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getMusicOnHoldMohSounds=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMusicOnHold.getSounds(c.query,p).$promise},c.createOrEditMusicOnHoldMohSound=function(e,t){s.show({controller:"CreateOrEditMohSoundDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:c.musiconhold,mohSound:t,mohSounds:c.musiconholdMohSounds.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedMusicOnHoldMohSounds=function(){var e=angular.copy(c.selectedMusicOnHoldMohSounds);return c.selectedMusicOnHoldMohSounds=[],e},c.deleteMusicOnHoldMohSound=g,c.deleteSelectedMusicOnHoldMohSounds=function(e){var t=s.confirm().title("Are you sure want to delete the selected mohSounds?").htmlContent("<b>"+c.selectedMusicOnHoldMohSounds.length+" selected</b> will be deleted.").ariaLabel("delete mohSounds").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedMusicOnHoldMohSounds.forEach(function(e){g(e)}),c.selectedMusicOnHoldMohSounds=[]})},d.hasRole("admin")?l.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.sounds=e.rows||[]}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):l.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){c.sounds=e.rows||[]}).then(function(){return l.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return l.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(c.sounds,{id:e.resourceId})}),n=null;if(c.musiconhold&&(n=_.find(c.sounds,{id:Number(c.musiconhold.id)})),n&&!_.some(t,["id",n.id])){var a=_.find(c.sounds,{id:n.id});a.canSelect=!1,t.push(a)}c.sounds=t})}else{var n=[],a=null;c.musiconhold&&(a=_.find(c.sounds,{id:Number(c.musiconhold.id)}));for(var i=0;i<c.sounds.length;i++)a&&c.sounds[i].id===a.id&&(c.sounds[i].canSelect=!1,n.push(c.sounds[i]));c.sounds=n}}).catch(function(e){r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})});var m=!0,u=1;function p(e){c.musiconholdMohSounds=e||{count:0,rows:[]}}function g(e){l.voiceMusicOnHold.removeSound({id:n.params.id,id2:e.id}).$promise.then(function(){_.remove(c.musiconholdMohSounds.rows,{id:e.id}),c.musiconholdMohSounds.count-=1,c.musiconholdMohSounds.rows.length||c.getMusicOnHoldMohSounds(),r.success({title:"MohSound deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getMusicOnHoldMohSounds())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("MusicOnHoldMohSoundsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_MOHSOUND",g.mohSound=angular.copy(l),g.mohSounds=r,g.newMohSound=!1,g.mohSound||(g.mohSound={},g.title="VOICE.NEW_MOHSOUND",g.newMohSound=!0),t.params.id&&(g.mohSound.VoiceMusicOnHoldId=t.params.id),g.addNewMohSound=function(){g.errors=[],d.voiceMusicOnHold.addSound({id:t.params.id},g.mohSound).$promise.then(function(e){g.mohSounds.unshift(e.toJSON()),o.success({title:"MohSound properly created",msg:g.mohSound.name?g.mohSound.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveMohSound=function(){g.errors=[],d.voiceMusicOnHold.update({id:g.mohSound.id},g.mohSound).$promise.then(function(e){var t=_.find(g.mohSounds,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"MohSound properly saved!",msg:g.mohSound.name?g.mohSound.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteMohSound=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The mohSound will be deleted.").ariaLabel("Delete MohSound").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMusicOnHold.delete({id:g.mohSound.id}).$promise.then(function(){_.remove(g.mohSounds,{id:g.mohSound.id}),o.success({title:"MohSound properly deleted!",msg:(g.mohSound.name||"mohSound")+" has been deleted!"}),v(g.mohSound)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMusicOnHold.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMusicOnHold.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.sounds=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.sound.get({fields:"id,name",sort:"name"}).$promise.then(function(e){g.sounds=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.sounds,{id:e.resourceId})}),n=null;if(g.mohSound&&(n=_.find(g.sounds,{id:Number(g.mohSound.id)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.sounds,{id:n.id});a.canSelect=!1,t.push(a)}g.sounds=t})}else{var n=[],a=null;g.mohSound&&(a=_.find(g.sounds,{id:Number(g.mohSound.id)}));for(var i=0;i<g.sounds.length;i++)a&&g.sounds[i].id===a.id&&(g.sounds[i].canSelect=!1,n.push(g.sounds[i]));g.sounds=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","mohSounds","mohSound","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditMohSoundDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.musiconhold=c||e.params.musiconhold||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoMusicOnHolds=function(){e.go("app.voice.musiconholds")},u.saveMusicOnHold=function(){r.voiceMusicOnHold.update({id:u.musiconhold.id},u.musiconhold).$promise.then(function(){l.success({title:"MusicOnHold updated!",msg:u.musiconhold.name?u.musiconhold.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data):e.toString()})})}}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","musiconhold","userProfileSection"],angular.module("app.voice").controller("MusicOnHoldController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.musiconholds=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="musiconholds",b.listOrder="",b.listOrderAsc=null,b.selectedMusicOnHolds=[],b.query={fields:"createdAt,updatedAt,id,name,mode,directory,application,format,sort",defaultEntry:"false",limit:10,page:1},b.arraymode=_.keyBy([{option:"Files",value:"'files'"},{option:"Custom",value:"'custom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysort=_.keyBy([{option:"Random",value:"'random'"},{option:"Alphabetical",value:"'alpha'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.musiconholds.edit",{id:e.id,musiconhold:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("musiconhold")+"?").htmlContent("<b>"+(e.name||"musiconhold")+"</b> will be deleted.").ariaLabel("delete musiconhold").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getMusicOnHolds=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceMusicOnHold.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="MusicOnHolds",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditMusicOnHold=function(e,t){i.show({controller:"CreateOrEditMusicOnHoldDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/musiconholds/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{musiconhold:t,musiconholds:b.musiconholds.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteMusicOnHold=S,b.exportSelectedMusicOnHolds=function(){var e=angular.copy(b.selectedMusicOnHolds);return b.selectedMusicOnHolds=[],e},b.deleteSelectedMusicOnHolds=function(e){var t=i.confirm().title("Are you sure want to delete the selected musiconholds?").htmlContent("<b>"+b.selectedMusicOnHolds.length+" selected</b> will be deleted.").ariaLabel("delete MusicOnHolds").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedMusicOnHolds.forEach(function(e){S(e)}),b.selectedMusicOnHolds=[]})},b.deselectMusicOnHolds=function(){b.selectedMusicOnHolds=[]},b.selectAllMusicOnHolds=function(){b.selectedMusicOnHolds=b.musiconholds.rows};var E=!0,A=1;function y(e){b.musiconholds=e||{count:0,rows:[]}}function S(e){m.voiceMusicOnHold.delete({id:e.id}).$promise.then(function(){_.remove(b.musiconholds.rows,{id:e.id}),b.musiconholds.count-=1,b.musiconholds.rows.length||b.getMusicOnHolds(),p.success({title:_.startCase("MusicOnHold")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMusicOnHold"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMusicOnHold",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getMusicOnHolds())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","musiconholds","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("MusicOnHoldsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,h,d,c,m,u){var f=this;function p(){var e=2,t=[];t.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"CDR(destination)="+(f.outboundroute.cutdigits?"${EXTEN:"+f.outboundroute.cutdigits+"}":"${EXTEN}"),context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+f.outboundroute.id,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),f.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==f.outboundroute.recordingFormat&&(t.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}),t.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+f.outboundroute.recordingFormat||"wav",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:e++,VoiceExtensionId:f.outboundroute.id}));for(var n=0,a=0;n<f.outboundrouteApps.rows.length;n++,a=0){var i=f.outboundrouteApps.rows[n],s=[],o=[];i.intervals="*,*,*,*"!==i.interval?[i.interval]:i.IntervalId?_.map(_.filter(f.intervals.rows,{IntervalId:i.IntervalId}),"interval"):[],i.context=f.outboundroute.context,i.exten=f.outboundroute.exten,i.type&&(i.type=i.type.toLowerCase()),i.hasOwnProperty("tag")&&i.tag&&"--"!==i.tag&&s.push({type:i.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+i.tag,context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id}),i.callerID?s.push({type:i.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)="+i.callerID+")",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id}):s.push({type:i.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No number available)",context:f.outboundroute.context,exten:f.outboundroute.exten,priority:i.intervals.length+e+a++,VoiceExtensionId:f.outboundroute.id});for(var r=0;r<i.intervals.length;r++){var l=e+i.intervals.length,d=r===i.intervals.length-1?e+s.length+o.length+2:e+r+1;s.splice(r,0,{type:"outbound",app:"GotoIfTime",appdata:i.intervals[r]+"?"+f.outboundroute.context+",${EXTEN},"+l+":"+f.outboundroute.context+",${EXTEN},"+d,exten:f.outboundroute.exten,context:f.outboundroute.context,priority:e+r,VoiceExtensionId:f.outboundroute.id})}if("outboundDial"===i.appType){var c=_.find(f.apps,{appType:"outboundDial"});if(c&&c.fields){for(var m={},u=i.appdata.split(","),p=[],g=0,v=c.fields.length;g<v;g++)if(c.fields[g].hasOwnProperty("param"))switch(c.fields[g].name){case"trunk":m.trunk=u[c.fields[g].param].split("/")[1],m.phone=u[c.fields[g].param].split("/")[2],m.prefix=m.phone?m.phone.split("$")[0]:void 0,m.phone=f.outboundroute.cutdigits?(m.prefix||"")+"${EXTEN:"+f.outboundroute.cutdigits+"}":(m.prefix||"")+"${EXTEN}",p[c.fields[g].param]=["SIP",m.trunk,m.phone].join("/");break;case"options":m.options=u[c.fields[g].param],"none"!==f.outboundroute.recordingFormat?m.options.indexOf("U(xcally-mixmonitor-context)")<0&&(m.options+="U(xcally-mixmonitor-context)"):m.options=m.options.replace("U(xcally-mixmonitor-context)",""),p[c.fields[g].param]=m.options;break;default:p[c.fields[g].param]=u[c.fields[g].param]}i.appdata=p.join(",")}}i.priority=s.length?_.last(s).priority+1:e,e=(o.length?_.last(o).priority:i.priority)+1,t=_.concat(t,s,[i],o)}t.push({type:"outbound",app:"Hangup",exten:f.outboundroute.exten,context:f.outboundroute.context,priority:e,VoiceExtensionId:f.outboundroute.id}),h.voiceExtension.addApplications({id:f.outboundroute.id},_.sortBy(t,"priority")).$promise.then(function(e){f.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function g(e){a.hide(e)}f.currentUser=d.getCurrentUser(),f.errors=[],f.setting=m,f.license=c,f.crudPermissions=u,f.hasModulePermissions={},f.passwordPattern=f.setting&&f.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",f.title="VOICE.EDIT_OUTBOUNDROUTE",f.outboundroute=angular.copy(l),f.outboundroutes=r,f.newOutboundRoute=!1,f.outboundrouteApps={count:0,rows:[]},f.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",route:"trunk",filters:{fields:"name",sort:"name"}},{name:"tags",route:"tag",filters:{fields:"name",sort:"name",nolimit:!0}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text",ngPattern:"/"(.*)"\\s<(.*?)>$/",help:!0},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),f.outboundroute||(f.outboundroute={appdata:"Outbound Call",type:"outbound",context:"from-sip",recordingFormat:"none"},f.title="VOICE.NEW_OUTBOUNDROUTE",f.newOutboundRoute=!0),f.addNewOutboundRoute=function(){f.errors=[],h.voiceExtension.save(f.outboundroute).$promise.then(function(e){f.outboundroutes.unshift(e.toJSON()),o.success({title:"OutboundRoute properly created",msg:f.outboundroute.name?f.outboundroute.name+" has been created!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.saveOutboundRoute=function(){f.errors=[],h.voiceExtension.update({id:f.outboundroute.id},f.outboundroute).$promise.then(function(e){var t=_.find(f.outboundroutes,{id:e.id});t&&(_.merge(t,_.pick(e.toJSON(),_.keys(t))),h.voiceExtension.get({sort:"priority",VoiceExtensionId:t.id,isApp:!0,nolimit:!0}).$promise.then(function(e){f.outboundrouteApps=e,p()})),o.success({title:"OutboundRoute properly saved!",msg:f.outboundroute.name?f.outboundroute.name+" has been saved!":""}),g(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},f.deleteOutboundRoute=function(n){h.voicePrefix.get({VoiceExtensionId:l.id}).$promise.then(function(e){if(e&&e.rows&&0<e.rows.length)return o.error({title:"Outbound route not deleted!",msg:"You can't remove an outbound route associated to an out prefix"});f.errors=[];var t=a.confirm().title("Are you sure?").content("The outboundroute will be deleted.").ariaLabel("Delete OutboundRoute").ok("Delete").cancel("Cancel").targetEvent(n);a.show(t).then(function(){h.voiceExtension.delete({id:f.outboundroute.id}).$promise.then(function(){_.remove(f.outboundroutes,{id:f.outboundroute.id}),o.success({title:"OutboundRoute properly deleted!",msg:(f.outboundroute.name||"outboundroute")+" has been deleted!"}),g(f.outboundroute)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){f.errors=e.data.errors||[{message:e.toString(),type:"api.voiceExtension.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceExtension.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})})},f.getDateFromString=function(e){return null===e?void 0:new Date(e)},f.rewriteRouting=p,f.closeDialog=g,d.hasRole("admin")?h.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.contexts=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):h.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){f.contexts=e.rows||[]}).then(function(){return h.userProfileSection.get({userProfileId:f.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:h.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(f.contexts,{id:e.resourceId})}),n=null;if(f.outboundroute&&(n=_.find(f.contexts,{name:f.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(f.contexts,{id:n.id});a.canSelect=!1,t.push(a)}f.contexts=t}):h.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){f.contexts=e.rows||[]})}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","outboundroutes","outboundroute","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditOutboundRouteDialogController",e)}(),function(){"use strict";function e(b,i,a,s,n,e,t){var E=this;function o(e,t){if(E.outboundrouteApps.rows.length){var n=E.outboundrouteApps.rows[t]?E.outboundrouteApps.rows[t]:E.outboundrouteApps.rows[0];i.show({controller:"EditoutboundApp"+(n.appType||n.app).toLowerCase()+"DialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/"+(n.appType||n.app).toLowerCase()+"/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundrouteApp:n,outboundroute:E.outboundroute,crudPermissions:E.crudPermissions}}).then(function(e){e&&(e.id?E.outboundrouteApps.rows[t]=e:E.outboundrouteApps.rows.splice(t,0,e),r())}).catch(function(e){e&&s.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:EDITMODALSHOW",msg:e.data?JSON.stringify(e.data):e.toString()})})}}function r(e){var t=2,n=[];n.push({type:"outbound",app:"Set",appdata:"CDR(type)=outbound",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"CDR(destination)="+(E.outboundroute.cutdigits?"${EXTEN:"+E.outboundroute.cutdigits+"}":"${EXTEN}"),context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"CDR(routeid)="+E.outboundroute.id,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id});var a=t++;n.push({type:"outbound",app:"ExecIf",appdata:"$[${LEN(${CDR(prefix)})} > 0]?Goto("+(a+2)+"):Goto("+(a+1)+")",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:a,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:E.outboundroute.cutdigits?"CDR(prefix)=${EXTEN:0:"+E.outboundroute.cutdigits+"}":"CDR(prefix)=noprefix",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-ANSWER=0",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"XCALLY-MOTION-PROGRESS=0",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"MONITOR_OPTIONS=ab",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"outboundrouteid="+E.outboundroute.id,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),E.outboundroute.hasOwnProperty("recordingFormat")&&"none"!==E.outboundroute.recordingFormat&&(n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}),n.push({type:"outbound",app:"Set",appdata:"_XCALLY_MIXMONITOR_FORMAT="+E.outboundroute.recordingFormat||"wav",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:t++,VoiceExtensionId:E.outboundroute.id}));for(var i=0,s=0;i<E.outboundrouteApps.rows.length;i++,s=0){var o=E.outboundrouteApps.rows[i],r=[],l=[];o.intervals="*,*,*,*"!==o.interval?[o.interval]:o.IntervalId?_.map(_.filter(E.intervals.rows,{IntervalId:o.IntervalId}),"interval"):[],o.context=E.outboundroute.context,o.exten=E.outboundroute.exten,o.type&&(o.type=o.type.toLowerCase()),o.hasOwnProperty("tag")&&o.tag&&"--"!==o.tag&&r.push({type:o.type.toLowerCase(),app:"Set",appdata:"CDR(tag)="+o.tag,context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id}),o.callerID?r.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)="+o.callerID+")",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id}):r.push({type:o.type.toLowerCase(),app:"ExecIf",appdata:"$[${LEN(${PREFIX-CALLERIDALL})} > 0]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No number available)",context:E.outboundroute.context,exten:E.outboundroute.exten,priority:o.intervals.length+t+s++,VoiceExtensionId:E.outboundroute.id});for(var d=0;d<o.intervals.length;d++){var c=t+o.intervals.length,m=d===o.intervals.length-1?t+r.length+l.length+2:t+d+1;r.splice(d,0,{type:"outbound",app:"GotoIfTime",appdata:o.intervals[d]+"?"+E.outboundroute.context+",${EXTEN},"+c+":"+E.outboundroute.context+",${EXTEN},"+m,exten:E.outboundroute.exten,context:E.outboundroute.context,priority:t+d,VoiceExtensionId:E.outboundroute.id})}if(e&&"outboundDial"===o.appType){var u=_.find(E.apps,{appType:"outboundDial"});if(u&&u.fields){for(var p={},g=o.appdata.split(","),v=[],h=0,f=u.fields.length;h<f;h++)if(u.fields[h].hasOwnProperty("param"))switch(u.fields[h].name){case"trunk":p.trunk=g[u.fields[h].param].split("/")[1],p.phone=g[u.fields[h].param].split("/")[2],p.prefix=p.phone?p.phone.split("$")[0]:void 0,p.phone=E.outboundroute.cutdigits?(p.prefix||"")+"${EXTEN:"+E.outboundroute.cutdigits+"}":(p.prefix||"")+"${EXTEN}",v[u.fields[h].param]=["SIP",p.trunk,p.phone].join("/");break;case"options":p.options=g[u.fields[h].param],"none"!==E.outboundroute.recordingFormat?p.options.indexOf("U(xcally-mixmonitor-context)")<0&&(p.options+="U(xcally-mixmonitor-context)"):p.options=p.options.replace("U(xcally-mixmonitor-context)",""),v[u.fields[h].param]=p.options;break;default:v[u.fields[h].param]=g[u.fields[h].param]}o.appdata=v.join(",")}}o.priority=r.length?_.last(r).priority+1:t,t=(l.length?_.last(l).priority:o.priority)+1,n=_.concat(n,r,[o],l)}n.push({type:"outbound",app:"Hangup",exten:E.outboundroute.exten,context:E.outboundroute.context,priority:t,VoiceExtensionId:E.outboundroute.id}),b.voiceExtension.addApplications({id:E.outboundroute.id},_.sortBy(n,"priority")).$promise.then(function(e){E.outboundrouteApps.rows=e.rows}).catch(function(e){console.error(e)})}function l(e){E.outboundrouteApps=e||{count:0,rows:[]}}E.currentUser=t.getCurrentUser(),E.outboundroute={},E.outboundrouteApps={count:0,rows:[]},E.selectedOutboundRouteApps=[],E.crudPermissions,E.query={sort:"priority"},E.apps=_.reject(_.sortBy([{app:"Interval",appType:"interval",type:"Outbound",types:["always","custom","list"],fields:[],isApp:!1},{app:"Dial",appType:"outboundDial",context:"from-sip",type:"Outbound",icon:"icon-apps",interval:"*,*,*,*",options:"xX",isApp:!0,extraApi:[{name:"trunks",field:{name:"trunk",key:"name"},route:"trunk",filters:{fields:"id,name",sort:"name"},permissions:{section:1011}},{name:"tags",field:{name:"tag",key:"name"},route:"tag",filters:{fields:"id,name",sort:"name",nolimit:!0},permissions:{section:1008}}],fields:[{title:"Trunk",name:"trunk",type:"apiselect",values:"trunks",value:"trunk.name",option:"trunk.name",required:!0,param:0},{title:"Caller_ID",name:"callerID",type:"text",help:!0},{title:"Prefix",name:"prefix",type:"text"},{title:"Tags",name:"tag",type:"apiselect",values:"tags",value:"tag.name",option:"tag.name",defaultValues:[{value:"'--'",option:"None"}]},{title:"Timeout",name:"timeout",type:"number",min:0,param:1},{title:"Options",name:"options",type:"text",param:2},{title:"Url",name:"url",type:"text",param:3}]},{app:null,type:"Outbound",appType:"custom",icon:"icon-apps",interval:"*,*,*,*",isApp:!0,fields:[{title:"Application_Name",name:"app",type:"text",required:!0,param:0},{title:"Arguments",name:"appdata",type:"text",param:1}]}],["app"]),{isApp:!1}),E.list={group:{name:"opt1",pull:"clone"},animation:100,sort:!1},E.applications={group:{name:"opt2",put:"opt1"},animation:100,onAdd:function(e){o(e,e.newIndex)},onSort:function(e){r()}},E.init=function(e,t){E.outboundroute=e,E.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},E.applications.disabled=!E.crudPermissions.canEdit,n.on("voiceExtension:update",E.onVoiceExtensionUpdate),E.query.VoiceExtensionId=e.id,E.query.isApp=!0,E.query.nolimit=!0,E.getOutboundRouteApps(),E.getIntervals()},E.deleteConfirm=function(e,t,n){var a=i.confirm().title("Are you sure want to delete the application?").htmlContent("<b>"+e.app+"</b> will be deleted.").ariaLabel("delete application").targetEvent(n).ok("OK").cancel("CANCEL");i.show(a).then(function(){E.outboundrouteApps.rows.splice(t,1),r()},function(){console.log("CANCEL")})},E.getOutboundRouteApps=function(){E.promise=b.voiceExtension.get(E.query,l).$promise},E.editOutboundRouteApp=o,E.editInterval=function(e,t){if(E.outboundrouteApps.rows.length){var n=E.outboundrouteApps.rows[t]?E.outboundrouteApps.rows[t]:E.outboundrouteApps.rows[0];i.show({controller:"EditoutboundAppintervalDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",parent:angular.element(a.body),targetEvent:e,clickOutsideToClose:!0,locals:{interval:{interval:n.interval,IntervalId:n.IntervalId,application:!0},intervals:[],crudPermissions:E.crudPermissions}}).then(function(e){e&&(n.interval=e.interval||"*,*,*,*",n.IntervalId=e.IntervalId||null,r())})}},E.deleteOutboundRouteApp=function(e){_.remove(E.outboundrouteApps.rows,{id:e.id}),r(),s.success({title:"App deleted!",msg:e.app?e.app+" has been deleted!":""})},E.deleteSelectedOutboundRouteApps=function(e){var t=i.confirm().title("Are you sure want to delete the selected applications?").htmlContent("<b>"+E.selectedOutboundRouteApps.length+" selected</b> will be deleted.").ariaLabel("delete applications").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){E.selectedOutboundRouteApps.forEach(function(e){_.remove(E.outboundrouteApps.rows,{id:e.id})}),E.selectedOutboundRouteApps=[],r()})},E.rewriteRouting=r,E.getIntervals=function(){return b.interval.get({fields:"id,interval,IntervalId"}).$promise.then(function(e){E.intervals=e}).catch(function(e){console.error(e)})},E.onVoiceExtensionUpdate=function(e){e.VoiceExtensionId===E.outboundroute.id&&r(!0)},e.$on("$destroy",function(){n.removeAllListeners("voiceExtension:update")})}e.$inject=["api","$mdDialog","$document","toasty","socket","$scope","Auth"],angular.module("app.voice").controller("OutboundRouteActionsController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.custom=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.custom.appdata)switch(l.custom.appType?l.custom.appType.toLowerCase():l.custom.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.custom.appdata.split(",");l.custom.key=d[0],l.custom.language=d[1],l.custom.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.custom.appdata.split(",");l.custom.accesskeyid=d[0],l.custom.secretaccesskey=d[1],l.custom.lexregion=d[2],l.custom.botname=d[3],l.custom.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.custom.appdata.split(",");l.custom.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.custom.text=d.slice(1,d.length).join(",");break;case"message":l.custom.text=l.custom.appdata;break;case"set":l.custom.name=l.custom.appdata.split("=")[0],l.custom.value=l.custom.appdata.split("=")[1];break;case"agi":l.custom.project=l.custom.appdata;break;default:var c=l.custom.appdata.split(",");l.custom.app=_.isEmpty(c[0])?c[0]:isNaN(c[0])?c[0]:parseInt(c[0],10),l.custom.appdata=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10)}function m(e){t.hide(e)}l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outbounddial"===l.custom.appType.toLowerCase()&&(l.custom.prefix=l.custom.phone?l.custom.phone.split("$")[0]:void 0,l.custom.callerId=l.custom.callerID?"CALLERID(all)="+l.custom.callerID:void 0),l.saveOutboundRouteApp=function(){l.errors=[];var e=[];l.custom.type&&"outbound"===l.custom.type.toLowerCase()&&"outboundDial"===l.custom.appType&&(l.custom.phone=i.cutdigits?(l.custom.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.custom.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.custom.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.custom.options+="U(xcally-mixmonitor-context)"):l.custom.options=l.custom.options.replace("U(xcally-mixmonitor-context)",""));if(l.custom.appType&&"custom"===l.custom.appType);else switch((l.custom.app||l.custom.appType).toLowerCase()){case"set":l.custom.appdata=l.custom.name+"="+l.custom.value;break;case"custom":break;default:e[0]=l.custom.app,e[1]=l.custom.appdata,l.custom.appdata=e.join(",")}m(l.custom)},l.closeDialog=m}e.$inject=["$mdDialog","$q","toasty","outboundrouteApp","outboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppcustomDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;if(c.currentUser=l.getCurrentUser(),c.errors=[],c.title="TOOLS.EDIT_INTERVAL",c.interval=angular.copy(i),c.intervals=s,c.newInterval=!1,c.types=["always","custom","list"],c.crudPermissions=d,c.daysOfWeek=a.getDaysOfWeek(),c.monthNumber=a.getMonthNumber(),c.monthName=a.getMonthName(),c.daysOfMonth=a.getDaysOfMonth(),c.interval)if("*,*,*,*"!==c.interval.interval){c.type="custom";var m=c.interval.interval.split(","),u=m[0],p=m[1],g=m[2],v=m[3];if("*"!==u){var h,f=u.split("-")[0],b=u.split("-")[1];(h=new Date).setHours(Number(f.split(":")[0])),h.setMinutes(Number(f.split(":")[1])),c.timeRangeFrom=h,(h=new Date).setHours(Number(b.split(":")[0])),h.setMinutes(Number(b.split(":")[1])),c.timeRangeTo=h}"*"!==p&&(c.dayOfWeekFrom=p.split("-")[0],c.dayOfWeekTo=p.split("-")[1]),"*"!==g&&(c.monthDayFrom=g.split("-")[0],c.monthDayTo=g.split("-")[1]),"*"!==v&&(c.monthFrom=v.split("-")[0],c.monthTo=v.split("-")[1])}else c.type="always";else c.interval={interval:"*,*,*,*"},c.type="always",c.title="TOOLS.NEW_INTERVAL",c.newInterval=!0;function E(){switch(c.type){case"always":case"list":return"*,*,*,*";case"custom":var e=[];if("*"!==c.timeRangeFrom&&c.timeRangeFrom&&c.timeRangeTo){var t=(c.timeRangeFrom.getHours()<10?"0":"")+c.timeRangeFrom.getHours()+":"+(c.timeRangeFrom.getMinutes()<10?"0":"")+c.timeRangeFrom.getMinutes(),n=(c.timeRangeTo.getHours()<10?"0":"")+c.timeRangeTo.getHours()+":"+(c.timeRangeTo.getMinutes()<10?"0":"")+c.timeRangeTo.getMinutes();e.push(t+"-"+n)}else e.push("*");return c.dayOfWeekFrom?c.dayOfWeekTo?e.push(c.dayOfWeekFrom+"-"+c.dayOfWeekTo):e.push(c.dayOfWeekFrom):e.push("*"),c.monthDayFrom?c.monthDayTo?e.push(c.monthDayFrom+"-"+c.monthDayTo):e.push(c.monthDayFrom):e.push("*"),c.monthFrom?c.monthTo?e.push(c.monthFrom+"-"+c.monthTo):e.push(c.monthFrom):e.push("*"),e.join()}}function A(e){t.hide(e)}e.params.id&&!c.interval.application&&(c.interval.IntervalId=e.params.id),c.interval.IntervalId&&c.interval.application&&(c.type="list"),c.addNewInterval=function(){c.errors=[],c.interval.interval=E(),r.interval.save(c.interval).$promise.then(function(e){c.intervals.push(e),o.success({title:"Interval properly created",msg:c.interval.name?c.interval.name+" has been created!":""}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.save"}]})},c.saveInterval=function(){c.errors=[],c.interval.interval=E(),c.interval.application?("list"!==c.type&&(c.interval.IntervalId=null),A(c.interval)):r.interval.update({id:c.interval.id},c.interval).$promise.then(function(e){var t=_.find(c.intervals,{id:e.id});t&&_.merge(t,e),o.success({title:"Interval properly saved!",msg:"Interval has been saved!"}),A()}).catch(function(e){console.error(e),c.errors=e.data.errors||[{message:e.toString(),type:"api.interval.update"}]})},c.closeDialog=A,c.interval.application&&(l.hasRole("admin")?r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.interval.get({fields:"id,name,interval,IntervalId",IntervalId:"null",nolimit:!0}).$promise.then(function(e){c.intervals=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:c.currentUser.userProfileId,sectionId:1004}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=e&&e.rows?e.rows:[],n=[],a=null;c.interval&&(a=_.find(c.intervals,{name:c.interval.IntervalId})),a&&!_.some(t,["resourceId",a.id])&&c.intervals.forEach(function(e){e.id===a.id&&(e.canSelect=!1,n.push(e))}),c.intervals=n})}else c.intervals=[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_INTERVALS",msg:e.data?JSON.stringify(e.data):e.toString()})}))}e.$inject=["$state","$mdDialog","$mdToast","IndexFactory","interval","intervals","toasty","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppintervalDialogController",e)}(),function(){"use strict";function e(t,e,n,a,i,s,o,r){var l=this;if(l.currentUser=o.getCurrentUser(),l.errors=[],l.title="VOICE.EDIT_"+(a.appType||a.app).toUpperCase(),l.outbounddial=angular.copy(a),l.crudPermissions=r,l.hasModulePermissions={},l.outbounddial.appdata)switch(l.outbounddial.appType?l.outbounddial.appType.toLowerCase():l.outbounddial.app.toLowerCase()){case"custom":break;case"dialogflow":var d=l.outbounddial.appdata.split(",");l.outbounddial.key=d[0],l.outbounddial.language=d[1],l.outbounddial.welcomemessage=d.slice(2,d.length).join(",");break;case"amazonlex":d=l.outbounddial.appdata.split(",");l.outbounddial.accesskeyid=d[0],l.outbounddial.secretaccesskey=d[1],l.outbounddial.lexregion=d[2],l.outbounddial.botname=d[3],l.outbounddial.welcomemessage=d.slice(4,d.length).join(",");break;case"autoreply":d=l.outbounddial.appdata.split(",");l.outbounddial.times=isNaN(d[0])?d[0]:parseInt(d[0],10),l.outbounddial.text=d.slice(1,d.length).join(",");break;case"message":l.outbounddial.text=l.outbounddial.appdata;break;case"set":l.outbounddial.name=l.outbounddial.appdata.split("=")[0],l.outbounddial.value=l.outbounddial.appdata.split("=")[1];break;case"agi":l.outbounddial.project=l.outbounddial.appdata;break;default:var c=l.outbounddial.appdata.split(",");l.outbounddial.trunk=c[0].split("/")[1],l.outbounddial.phone=c[0].split("/")[2],l.outbounddial.timeout=_.isEmpty(c[1])?c[1]:isNaN(c[1])?c[1]:parseInt(c[1],10),l.outbounddial.options=_.isEmpty(c[2])?c[2]:isNaN(c[2])?c[2]:parseInt(c[2],10),l.outbounddial.url=_.isEmpty(c[3])?c[3]:isNaN(c[3])?c[3]:parseInt(c[3],10)}function m(e){t.hide(e)}l.outbounddial.type&&"outbound"===l.outbounddial.type.toLowerCase()&&"outbounddial"===l.outbounddial.appType.toLowerCase()&&(l.outbounddial.prefix=l.outbounddial.phone?l.outbounddial.phone.split("$")[0]:void 0,l.outbounddial.callerId=l.outbounddial.callerID?"CALLERID(all)="+l.outbounddial.callerID:void 0),l.saveOutboundRouteApp=function(){l.errors=[];var e=[];l.outbounddial.type&&"outbound"===l.outbounddial.type.toLowerCase()&&"outboundDial"===l.outbounddial.appType&&(l.outbounddial.phone=i.cutdigits?(l.outbounddial.prefix||"")+"${EXTEN:"+i.cutdigits+"}":(l.outbounddial.prefix||"")+"${EXTEN}","none"!==i.recordingFormat?l.outbounddial.options.indexOf("U(xcally-mixmonitor-context)")<0&&(l.outbounddial.options+="U(xcally-mixmonitor-context)"):l.outbounddial.options=l.outbounddial.options.replace("U(xcally-mixmonitor-context)",""));if(l.outbounddial.appType&&"custom"===l.outbounddial.appType);else switch((l.outbounddial.app||l.outbounddial.appType).toLowerCase()){case"set":l.outbounddial.appdata=l.outbounddial.name+"="+l.outbounddial.value;break;case"custom":break;default:e[0]=["SIP",l.outbounddial.trunk,l.outbounddial.phone].join("/"),e[1]=l.outbounddial.timeout,e[2]=l.outbounddial.options,e[3]=l.outbounddial.url,l.outbounddial.appdata=e.join(",")}m(l.outbounddial)},l.closeDialog=m,o.hasRole("admin")?s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TRUNKS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.trunk.get({fields:"id,name",sort:"name"}).$promise.then(function(e){l.trunks=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1011}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.trunks,{id:e.resourceId})}),n=null;if(l.outbounddial&&(n=_.find(l.trunks,{name:l.outbounddial.trunk})),n&&!_.some(t,["id",n.id])){var a=_.find(l.trunks,{id:n.id});a.canSelect=!1,t.push(a)}l.trunks=t})}else{var n=[],a=null;l.outbounddial&&(a=_.find(l.trunks,{name:l.outbounddial.trunk}));for(var i=0;i<l.trunks.length;i++)a&&l.trunks[i].id===a.id&&(l.trunks[i].canSelect=!1,n.push(l.trunks[i]));l.trunks=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtrunks",msg:e.data?JSON.stringify(e.data):e.toString()})}),o.hasRole("admin")?s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TAGS",msg:e.data?JSON.stringify(e.data):e.toString()})}):s.tag.get({fields:"id,name",sort:"name",nolimit:"true"}).$promise.then(function(e){l.tags=e.rows||[]}).then(function(){return s.userProfileSection.get({userProfileId:l.currentUser.userProfileId,sectionId:1008}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return s.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(l.tags,{id:e.resourceId})}),n=null;if(l.outbounddial&&(n=_.find(l.tags,{name:l.outbounddial.tag})),n&&!_.some(t,["id",n.id])){var a=_.find(l.tags,{id:n.id});a.canSelect=!1,t.push(a)}l.tags=t})}else{var n=[],a=null;l.outbounddial&&(a=_.find(l.tags,{name:l.outbounddial.tag}));for(var i=0;i<l.tags.length;i++)a&&l.tags[i].id===a.id&&(l.tags[i].canSelect=!1,n.push(l.tags[i]));l.tags=n}}).catch(function(e){n.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETtags",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$mdDialog","$q","toasty","outboundrouteApp","outboundroute","api","Auth","crudPermissions"],angular.module("app.voice").controller("EditoutboundAppoutbounddialDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.outboundroute=c||e.params.outboundroute||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoOutboundRoutes=function(){e.go("app.voice.outboundroutes")},u.saveOutboundRoute=function(){r.voiceExtension.update({id:u.outboundroute.id},u.outboundroute).$promise.then(function(){l.success({title:"OutboundRoute updated!",msg:u.outboundroute.name?u.outboundroute.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceExtension",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.outboundroute&&(n=_.find(u.contexts,{name:u.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","outboundroute","userProfileSection"],angular.module("app.voice").controller("OutboundRouteController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.outboundroutes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="outboundroutes",b.listOrder="",b.listOrderAsc=null,b.selectedOutboundRoutes=[],b.query={fields:"createdAt,updatedAt,id,appdata,type,exten,context,recordingFormat,cutdigits,description",type:"outbound",sort:"-updatedAt",VoiceExtensionId:"null",limit:10,page:1},b.arrayrecordingFormat=_.keyBy([{option:"none",value:"'none'"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'WAV'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.outboundroutes.edit",{id:e.id,outboundroute:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("outboundroute")+"?").htmlContent("<b>"+(e.name||"outboundroute")+"</b> will be deleted.").ariaLabel("delete outboundroute").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getOutboundRoutes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceExtension.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="OutboundRoutes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditOutboundRoute=function(e,t){i.show({controller:"CreateOrEditOutboundRouteDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/outboundroutes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{outboundroute:t,outboundroutes:b.outboundroutes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteOutboundRoute=S,b.exportSelectedOutboundRoutes=function(){var e=angular.copy(b.selectedOutboundRoutes);return b.selectedOutboundRoutes=[],e},b.deleteSelectedOutboundRoutes=function(e){var t=i.confirm().title("Are you sure want to delete the selected outboundroutes?").htmlContent("<b>"+b.selectedOutboundRoutes.length+" selected</b> will be deleted.").ariaLabel("delete OutboundRoutes").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedOutboundRoutes.forEach(function(e){S(e)}),b.selectedOutboundRoutes=[]})},b.deselectOutboundRoutes=function(){b.selectedOutboundRoutes=[]},b.selectAllOutboundRoutes=function(){b.selectedOutboundRoutes=b.outboundroutes.rows},g.hasRole("admin")?m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){b.contexts=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.contexts,{id:e.resourceId})}),n=null;if(b.outboundroute&&(n=_.find(b.contexts,{name:b.outboundroute.context})),n&&!_.some(t,["id",n.id])){var a=_.find(b.contexts,{id:n.id});a.canSelect=!1,t.push(a)}b.contexts=t}):m.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){b.contexts=e.rows||[]})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.outboundroutes=e||{count:0,rows:[]}}function S(t){m.voicePrefix.get({VoiceExtensionId:t.id}).$promise.then(function(e){if(e&&e.rows&&0<e.rows.length)return p.error({title:"Outbound route not deleted!",msg:"You can't remove an outbound route associated to an out prefix"});m.voiceExtension.delete({id:t.id}).$promise.then(function(){_.remove(b.outboundroutes.rows,{id:t.id}),b.outboundroutes.count-=1,b.outboundroutes.rows.length||b.getOutboundRoutes(),p.success({title:_.startCase("OutboundRoute")+" deleted!",msg:t.name?t.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceExtension"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceExtension",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getOutboundRoutes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","outboundroutes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("OutboundRoutesController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m,u,p,g){var v=this,h=!0;function f(){var e=i.localStorage.getItem("motion2.realtime.abandoned.voice.contacts:"+v.currentUser.id);e&&(e=JSON.parse(e))&&e.query&&(v.query=_.merge(e.query,_.omit(v.query,["sort","limit","page"])),v.query=_.omit(v.query,"filter")),d.hasRole("admin")?o.user.getQueues({id:d.getCurrentUser().id,fields:"id,name",channel:"voice",type:"inbound",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()}):o.userProfile.getResources({id:v.currentUser.userProfileId,section:"QueueCampaigns",channel:"voice",type:"inbound",sort:"-updatedAt",nolimit:!0}).$promise.then(function(e){v.queues=e||{count:0,rows:[]},v.queuesMap=_.mapValues(_.keyBy(v.queues.rows,"name"),"name")}).catch(function(e){console.error(e)}).finally(function(){v.getContacts()})}function b(e){v.contacts=e||{count:0,rows:[]},h=!1,v.refresh=!0}v.showTooltip=!1,v.refresh=!0,v.disable=[],v.agents=p||[],v.currentUser=d.getCurrentUser(),v.localizationMap=u,v.pickerModel={dateStart:null,dateEnd:null},v.queues={},v.contacts={count:0,rows:[]},v.dispositions=g,v.userProfile=r,v.userProfileSection=l&&1==l.count?l.rows[0]:null,v.crudPermissions=d.parseCrudPermissions(v.userProfileSection?v.userProfileSection.crudPermissions:null),v.query={fields:"id,type,calleridnum,calleridname,queue,queuecallerabandonAt,queuecallerexitAt,queuecallerexitreason,assigned,lastAssignedTo,updatedAt,disposition",type:"inbound",queuecallerexitreason:"TIMEOUT,ABANDONED",sort:"-updatedAt",limit:10,page:1},v.clearAll=function(){v.query.createdAt=void 0,v.pickerModel={dateStart:null,dateEnd:null},v.getContacts()},v.getContacts=function(){if(v.refresh=!1,v.pickerModel.dateStart&&!h){var e=moment(v.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();v.query.createdAt={$gte:v.pickerModel.dateStart,$lte:e}}else v.query.createdAt=void 0;v.query.queue=v.query.queue,v.query.offset=(v.query.page-1)*v.query.limit,i.localStorage.setItem("motion2.realtime.abandoned.voice.contacts:"+v.currentUser.id,JSON.stringify({query:_.omit(v.query,"queue")})),v.promise=o.voiceQueueReport.getVoiceQueuesReport(v.query,b).$promise},v.refreshContacts=function(){v.showTooltip=!1,v.getContacts()},v.onInit=f,v.assignedA=function(e,t){e&&(v.disable[e.id]=!0,o.voiceQueueReport.update({id:e.id,lastAssignedTo:t?t.name:null,assigned:!!t}).$promise.catch(function(e){console.log(e)}).finally(function(){v.disable[e.id]=!1}))},v.disposed=function(e,t){e&&o.voiceQueueReport.update({id:e.id,disposition:t||null}).$promise.catch(function(e){console.log(e)})},v.onSavevoiceQueueReport=function(e){e&&v.queuesMap&&"inbound"===e.type&&v.queuesMap[e.queue]&&(v.showTooltip=!0)},v.onUpdatevoiceQueueReport=function(e){if(e){var t=_.findIndex(v.contacts.rows,["id",e.id]);0<=t&&_.merge(v.contacts.rows[t],e)}},c.onWithoutApply("voiceQueueReport:save",v.onSavevoiceQueueReport),c.on("voiceQueueReport:update",v.onUpdatevoiceQueueReport),f();var E=!0,A=1;e.$watch("vm.query.filter",function(e,t){E?n(function(){E=!1}):(t||(A=v.query.page),e!==t&&(v.query.page=1),e||(v.query.page=A),v.getContacts())}),e.$on("$destroy",function(){c.removeAllListeners("voiceQueueReport:save"),c.removeAllListeners("voiceQueueReport:update")})}e.$inject=["$scope","$timeout","$mdDialog","$document","$window","$translate","api","userProfile","userProfileSection","Auth","socket","toasty","dateFilterLocalizationFactory","agents","dispositions"],angular.module("app.voice").controller("AbandonedCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,o,t,n,a,i,s,r,l,d,c,m,u,p,g,v,h,f){var b=this,E=["userpic","online","lastLoginAt","lastPauseAt","pauseType","lastPauseAt","internal","address","chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","chatCapacity","openchannelCapacity","mailCapacity","smsCapacity","faxCapacity","chatCurrentCapacity","openchannelCurrentCapacity","mailCurrentCapacity","smsCurrentCapacity","faxCurrentCapacity","chatStatus","openchannelStatus","mailStatus","smsStatus","faxStatus","voiceStatus","chatStatusTime","openchannelStatusTime","mailStatusTime","smsStatusTime","faxStatusTime","voiceStatusTime","queue","destconnectedlinenum","onhold"],A=["chatPause","openchannelPause","mailPause","smsPause","faxPause","voicePause","online"];for(var y in b.currentUser=v.getCurrentUser(),b.availableStates=["ringing","inuse","busy","onhold","not_inuse"],b.pauses=s||{count:0,rows:[]},b.license=h,b.userProfile=p,b.userProfileSection=g&&1==g.count?g.rows[0]:null,b.crudPermissions=v.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.agents=r?_.keyBy(r.rows?r.rows:[],"id"):{},b.rpcAgents=l?_.keyBy(l.rows?l.rows:[],"id"):{},b.paginatedAgents={},b.load=!1,b.order=[],b.agentInternal={},b.agents)b.agents.hasOwnProperty(y)&&(b.agents[y].init=!0);b.query={limit:10,page:1,order:"fullname",globalStatusFilter:"",pauseTypeFilter:""},b.logout=function(e,t){return d.user.logout({id:e.id,device:"realtime",agent_id:e.id,agent_name:e.name}).$promise.then(function(){m.success({title:"Agent logout",msg:e.fullname+" properly logout"}),b.agents[e.id]&&(b.agents[e.id].online=!1),b.rpcAgents[e.id]&&(b.rpcAgents[e.id].online=!1),T()}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.queueAdd=function(e,t){n.show({controller:"AgentqueueaddController",controllerAs:"vm",templateUrl:"app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",parent:angular.element(a.body),targetEvent:t,clickOutsideToClose:!0,locals:{agent:e,agents:[],channel:"voice",direction:"inbound",crudPermissions:b.crudPermissions}})},b.pause=function(t,e){return d.user.pause({id:t.id,type:e}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.unPause=function(t){return d.user.unpause({id:t.id}).$promise.then(function(e){b.agents[t.id]&&_.merge(b.agents[t.id],_.pick(e,E)),b.rpcAgents[t.id]&&_.merge(b.rpcAgents[t.id],_.pick(e,E)),O(b.agents[t.id])}).catch(function(e){m.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.staff.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.showInfo=function(e){n.show(n.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},b.getAgentStatus=w,b.getAgentGlobalStatus=O,b.isPause=I,b.checkPause=function(e){return"pause"===e},b.isPartialPause=function(e){return"*pause"===e},b.onSave=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(_.omit(e,A),E)),_.merge(b.rpcAgents[e.id],_.pick(_.omit(e,A),E)),O(b.agents[e.id]))},b.onUpdate=function(e){b.agents[e.id]&&(_.merge(b.agents[e.id],_.pick(e,E)),_.merge(b.rpcAgents[e.id],_.pick(e,E)),e.lastPauseAt&&(b.agents[e.id].globalStatusTime=e.lastPauseAt,b.rpcAgents[e.id].globalStatusTime=e.lastPauseAt),O(b.agents[e.id]))},b.onInit=T,b.onConnect=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(_.merge(b.agents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])),_.merge(b.rpcAgents[b.agentInternal[e.destaccountcode]],_.pick(e,["queue","destconnectedlinenum"])))},b.onComplete=function(e){b.agents[b.agentInternal[e.destaccountcode]]&&(b.agents[b.agentInternal[e.destaccountcode]]=_.omit(b.agents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]),b.rpcAgents[b.agentInternal[e.destaccountcode]]=_.omit(b.rpcAgents[b.agentInternal[e.destaccountcode]],["queue","destconnectedlinenum"]))},c.on("user:save",b.onSave),c.on("user:update",b.onUpdate),c.on("user:agentconnect",b.onConnect),c.on("user:agentcomplete",b.onComplete),T();var S=f(function(){b.load&&(b.load=!1,T())},999);function T(e){b.load=!1;var t,n,a=o.defer();b.promise=a.promise,b.filteredAgents=[],b.order=[],_.forIn(b.agents,function(e,t){b.rpcAgents[t]&&_.merge(e,_.pick(_.omit(b.rpcAgents[t],A),E)),O(e),e.online?(b.filteredAgents.push(e),b.agentInternal[e.internal]=t):e.globalStatusTime=_.toNumber(moment().format("x"))}),b.query.globalStatusFilter&&_.remove(b.filteredAgents,function(e){return e.globalStatus!==b.query.globalStatusFilter}),b.query.pauseTypeFilter&&_.remove(b.filteredAgents,function(e){return e.pauseType!==b.query.pauseTypeFilter}),b.query.filter&&_.remove(b.filteredAgents,function(e){return e.fullname.toLowerCase().indexOf(b.query.filter.toLowerCase())<0}),b.filteredAgents=(t=b.filteredAgents,n=_.startsWith(b.query.order,"-")?"desc":"asc",_.orderBy(t,[b.query.order.replace("-","")],[n]));var i=(b.query.page-1)*b.query.limit;b.paginatedAgents=_.drop(b.filteredAgents,i).slice(0,b.query.limit);for(var s=0;s<b.paginatedAgents.length;s+=1)b.order.push(b.paginatedAgents[s].id);a.resolve(),b.load=!0}function I(e){return"pause"===e||"*pause"===e}function C(e){return"idle"===e||"unknown"===e||"unavailable"===e||"ringing"===e||_.isNil(e)}function w(e,t){return"voice"===t?"idle"!==e[t+"Status"]?e[t+"Status"]:e[t+"Pause"]?e[t+"Status"]="pause":"idle":e[t+"Pause"]?e[t+"Status"]="pause":e[t+"Status"]}function O(e){var t="unknown";t=_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"pause":_.some([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],I)?"*pause":_.every([w(e,"voice"),w(e,"chat"),w(e,"mail"),w(e,"openchannel"),w(e,"sms"),w(e,"fax")],C)?"idle":"busy",e.globalStatus!==t&&(e.globalStatus=t,e.init?(e.init=!1,e.globalStatusTime=I(t)?_.toNumber(moment(e.lastPauseAt).format("x")):_.max([e.voiceStatusTime,e.chatStatusTime,e.mailStatusTime,e.smsStatusTime,e.openchannelStatusTime,e.faxStatusTime])):e.globalStatusTime=_.toNumber(moment().format("x")))}e.$on("$destroy",function(){c.removeAllListeners("user:save"),c.removeAllListeners("user:update"),c.removeAllListeners("user:agentconnect"),c.removeAllListeners("user:agentcomplete"),S&&(f.cancel(S),S=null)})}e.$inject=["$scope","$q","$timeout","$mdDialog","$document","$filter","pauses","agents","rpcAgents","api","socket","toasty","helperClasses","userProfile","userProfileSection","Auth","license","$interval"],angular.module("app.voice").controller("AgentsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s){var o=this;o.calls=i||{rows:[],count:0},o.query={limit:10,page:1},o.channelStatus=s.channelStatusOut,o.onSave=function(e){var t=_.find(o.calls.rows,{channel:e.channel});e.channelstatedesc=e.dialstatus?"up":"ring",t?_.merge(t,e):e.channel&&o.calls.rows.push(e)},o.onRemove=function(e){var t=_.findIndex(o.calls.rows,{channel:e.channel});0<=t&&(o.calls.rows[t].status="hangup");n(function(){o.calls.rows.splice(t,1)},5e3)},a.on("voice_outbound_channel:save",o.onSave),a.on("voice_outbound_channel:remove",o.onRemove),e.$on("$destroy",function(){a.removeAllListeners("voice_outbound_channel:save"),a.removeAllListeners("voice_outbound_channel:remove")})}e.$inject=["$scope","$timeout","api","socket","rpcCalls","helperClasses"],angular.module("app.voice").controller("OutboundCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,a,n,i,s,o,r,l,d,c,m,u){var p=this;p.currentUser=u.getCurrentUser(),p.agents=n||{count:0,rows:[]},p.queues=i?_.keyBy(i.rows?i.rows:[],"name"):{},p.rpcVoiceQueuesChannelsTmp=s?_.keyBy(s.rows?_.filter(s.rows,{type:"inbound"}):[],"uniqueid"):{},p.rpcVoiceQueuesChannels={},p.userProfile=c,p.userProfileSection=m&&1==m.count?m.rows[0]:null,p.crudPermissions=u.parseCrudPermissions(p.userProfileSection?p.userProfileSection.crudPermissions:null),p.queryChannels={limit:10,page:1},p.getSize=function(e){return _.size(e)},p.$onInit=function(){_.forIn(p.rpcVoiceQueuesChannelsTmp,function(e,t){_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[t]=e)})},p.onSave=function(e){"inbound"===e.type&&_.find(p.queues,{name:e.name})&&(p.rpcVoiceQueuesChannels[e.uniqueid]=e)},p.onRemove=function(e){p.rpcVoiceQueuesChannels[e.uniqueid]&&delete p.rpcVoiceQueuesChannels[e.uniqueid]},p.hangup=function(t){return o.rpc.getVoiceQueuesChannelHangup({uniqueid:t}).$promise.then(function(e){d.success({title:"Channel "+t+" properly hangup!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToAgent=function(t,e,n){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e,context:n}).$promise.then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},p.redirectToNumber=function(e,t){var n=a.prompt().title("Which number do you want transfer the call to?").placeholder("Number").targetEvent(e).ok("Ok").cancel("Cancel");return a.show(n).then(function(e){return o.rpc.getVoiceQueuesChannelRedirect({uniqueid:t,exten:e}).$promise}).then(function(e){d.success({title:"Channel "+t+" properly redirect!",msg:e.message||""})}).catch(function(e){d.error({title:e.status+" - "+e.statusText,msg:JSON.stringify(e.data)||e.message.join(" ")})})},r.on("voice_queue_channel:save",p.onSave),r.on("voice_queue_channel:remove",p.onRemove),e.$on("$destroy",function(){r.removeAllListeners("voice_queue_channel:save"),r.removeAllListeners("voice_queue_channel:remove")})}e.$inject=["$scope","$timeout","$mdDialog","agents","queues","rpcVoiceQueuesChannels","api","socket","helperClasses","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueCallsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d){var c=this,m=["total","answered","unmanaged","abandoned","sumHoldTime","sumDuration","sumBillable"];function u(){_.forIn(c.queues,function(e,t){c.rpcQueues[t]&&_.merge(e,_.pick(c.rpcQueues[t],m))})}c.count=a.count,c.queues=a?_.keyBy(a.rows?a.rows:[],"id"):{},c.rpcQueues=i?_.keyBy(i.rows?i.rows:[],"id"):{},c.userProfile=r,c.userProfileSection=l&&1==l.count?l.rows[0]:null,c.crudPermissions=d.parseCrudPermissions(c.userProfileSection?c.userProfileSection.crudPermissions:null),d.hasRole("admin")?c.query={type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1}:c.query={id:d.getCurrentUser().id,channel:"voice",type:"inbound",fields:"id,name",sort:"-updatedAt",limit:10,page:1},c.success=v,c.getQueues=function(){c.query.offset=(c.query.page-1)*c.query.limit,d.hasRole("admin")?c.promise=s.voiceQueue.get(c.query,v).$promise:(c.query.id=c.userProfile.id,c.query.section="VoiceQueues",c.promise=s.userProfile.getResources(c.query,v).$promise)},c.onSave=function(e){c.queues[e.id]&&_.merge(c.queues[e.id],_.pick(e,m))},c.$onInit=u,o.onWithoutApply("voice_queue:save",c.onSave),c.interval=t(function(){},999);var p=!0,g=1;function v(e){c.count=e.count,c.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},u()}e.$watch("vm.query.filter",function(e,t){p?n(function(){p=!1}):(t||(g=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=g),c.getQueues())}),e.$on("$destroy",function(){o.removeAllListeners("voice_queue:save"),c.interval&&t.cancel(c.interval)})}e.$inject=["$scope","$timeout","$interval","queues","rpcQueues","api","socket","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueueParamsVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,a,t,i,s,o,r,l,d,c,m,u,p){var g=this,v=["loggedIn","available","waiting","talking","pTalking","originated","message","dialActive","dialMethod","Trunk","paused"];function h(){var n=[];return _.forIn(g.queues,function(e,t){e.paused=0,e.loggedInDb=0,g.queues[t].agents={},n.push(l.voiceQueue.getMembers({id:t}).$promise),g.rpcQueues[t]&&_.merge(e,_.pick(g.rpcQueues[t],v))}),t.all(n).then(function(e){for(var t=0;t<e.length;t+=1)for(var n=0;n<e[t].rows.length;n++)e[t].rows[n].paused&&g.queues[e[t].rows[n].VoiceQueueId].paused++,g.queues[e[t].rows[n].VoiceQueueId].loggedInDb++,g.queues[e[t].rows[n].VoiceQueueId].agents[e[t].rows[n].UserId]=e[t].rows[n].VoiceQueueId}).catch(function(e){console.error(e)})}g.currentUser=p.getCurrentUser(),g.count=o.count?o.count:0,g.queues=o?_.keyBy(o.rows?o.rows:[],"id"):{},g.rpcQueues=r?_.keyBy(r.rows?r.rows:[],"id"):{},g.userProfile=m,g.userProfileSection=u&&1==u.count?u.rows[0]:null,g.crudPermissions=p.parseCrudPermissions(g.userProfileSection?g.userProfileSection.crudPermissions:null),p.hasRole("admin")?g.query={type:"inbound",sort:"-updatedAt",limit:10,page:1}:g.query={id:g.currentUser.id,channel:"voice",type:"inbound",sort:"-updatedAt",limit:10,page:1},g.success=E,g.getQueues=function(){g.query.offset=(g.query.page-1)*g.query.limit,p.hasRole("admin")?g.promise=l.voiceQueue.get(g.query,E).$promise:(g.query.id=g.userProfile.id,g.query.section="VoiceQueues",g.promise=l.userProfile.getResources(g.query,E).$promise)},g.createOrEditVoiceQueue=function(e,t){a.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:_.values(g.queues),license:null,setting:null,crudPermissions:g.crudPermissions}})},g.agentAdd=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:g.queues?g.queues.rows:[],realtime:!0,crudPermissions:g.crudPermissions}})},g.updateQueue=function(e){return l.voiceQueue.update(e).$promise.then(function(){c.success({title:"Queue properly updated!",msg:e.name?e.name+" has been updated!":""})}).catch(function(e){c.error({title:"Error creating queue!",msg:e.message})})},g.onSave=function(e){g.queues[e.id]&&_.merge(g.queues[e.id],_.pick(e,v))},g.onPause=function(n){console.log("onPause",n),n.voicePause?_.forIn(g.queues,function(e,t){e.agents[n.id]&&(e.paused+=1,console.log("pause"))}):n.voicePause||_.forIn(g.queues,function(e,t){e.agents[n.id]&&0<e.paused&&(e.paused-=1,console.log("unpause"))})},g.onLogin=function(e){console.log("onLogged",e),g.queues[e.VoiceQueueId]&&(g.queues[e.VoiceQueueId].loggedInDb+=1,g.queues[e.VoiceQueueId].agents[e.UserId]=e.VoiceQueueId)},g.onLogout=function(e){console.log("onLogout",e),g.queues[e.VoiceQueueId]&&0<g.queues[e.VoiceQueueId].loggedInDb&&(g.queues[e.VoiceQueueId].loggedInDb-=1,delete g.queues[e.VoiceQueueId].agents[e.UserId])},g.$onInit=h,g.order=[],_.forIn(g.queues,function(e,t){g.order.push(e.id)}),d.onWithoutApply("voice_queue:save",g.onSave),g.interval=s(function(){},999),d.on("user:update",g.onPause),d.on("userVoiceQueue:remove",g.onLogout),d.on("userVoiceQueue:save",g.onLogin);var f=!0,b=1;function E(e){if(g.count=e.count,g.queues=e?_.keyBy(e.rows?e.rows:[],"id"):{},e.rows){g.order=[];for(var t=0;t<e.rows.length;t++)g.order.push(e.rows[t].id)}h()}e.$watch("vm.query.filter",function(e,t){f?n(function(){f=!1}):(t||(b=g.query.page),e!==t&&(g.query.page=1),e||(g.query.page=b),g.getQueues())}),e.$on("$destroy",function(){d.removeAllListeners("voice_queue:save"),g.interval&&s.cancel(g.interval),d.removeAllListeners("user:update"),d.removeAllListeners("userVoiceQueue:remove"),d.removeAllListeners("userVoiceQueue:save")})}e.$inject=["$scope","$timeout","$mdDialog","$q","$document","$interval","queues","rpcQueues","api","socket","toasty","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("QueuesVoiceRealtimeController",e)}(),function(){"use strict";angular.module("app.auth").factory("helperClasses",function(){return{status:{registered:"green-300-fg icon-checkbox-marked-circle",unregistered:"red-300-fg icon-close-circle",lagged:"red-300-fg icon-close-circle",reachable:"green-300-fg icon-checkbox-marked-circle",unreachable:"red-300-fg icon-close-circle",unknown:"grey-fg icon-minus-circle"},state:{unknown:"grey-fg icon-phone-hangup",not_inuse:"green-300-fg icon-phone-hangup",inuse:"red-300-fg icon-phone-in-talk",busy:"red-300-fg icon-phone-locked",invalid:"grey-fg icon-phone-hangup",unavailable:"grey-fg icon-phone-hangup",ringing:"blue-300-fg icon-phone-incoming",ringinuse:"blue-300-fg icon-phone-incoming",onhold:"blue-300-fg icon-phone-paused"},channelStatus:{ring:"blue-300-fg icon-phone-incoming",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"},channelStatusOut:{ring:"blue-300-fg icon-phone-outgoing",up:"green-300-fg icon-phone-in-talk",hangup:"red-300-fg icon-phone-hangup"}}})}(),function(){"use strict";function e(e,n,t){var a=this;switch(t.disconnect(),t.connect(),a.selectedTab=0,n.current.name){case"app.voice.realtime.agents":a.selectedTab=0;break;case"app.voice.realtime.telephones":a.selectedTab=1;break;case"app.voice.realtime.trunks":a.selectedTab=2;break;case"app.voice.realtime.queues":a.selectedTab=3;break;case"app.voice.realtime.queue_calls":a.selectedTab=4;break;case"app.voice.realtime.abandonedcalls":a.selectedTab=5;break;case"app.voice.realtime.queue_params":a.selectedTab=6;break;case"app.voice.realtime.outbound_calls":a.selectedTab=7;break;default:a.selectedTab=0,n.go("app.voice.realtime.agents")}e.$watch("vm.selectedTab",function(e,t){if(e!==t)switch(e){case 0:n.go("app.voice.realtime.agents");break;case 1:n.go("app.voice.realtime.telephones");break;case 2:n.go("app.voice.realtime.trunks");break;case 3:n.go("app.voice.realtime.queues");break;case 4:n.go("app.voice.realtime.queue_calls");break;case 5:n.go("app.voice.realtime.abandonedcalls");break;case 6:n.go("app.voice.realtime.queue_params");break;case 7:n.go("app.voice.realtime.outbound_calls");break;default:n.go("app.voice.realtime.agents")}})}e.$inject=["$scope","$state","socket"],angular.module("app.voice").controller("VoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c){var m=this,u=["fullname","internal","state","status"];function p(){_.forIn(m.telephones,function(e,t){m.rpcTelephones[t]&&_.merge(e,_.pick(m.rpcTelephones[t],u))})}m.count=a.count,m.attributes=["fullname","internal","state","status","address"],m.telephones=a?_.keyBy(a.rows?a.rows:[],"id"):{},m.rpcTelephones=i?_.keyBy(i.rows?i.rows:[],"id"):{},m.userProfile=l,m.userProfileSection=d&&1==d.count?d.rows[0]:null,m.crudPermissions=c.parseCrudPermissions(m.userProfileSection?m.userProfileSection.crudPermissions:null),m.query={fields:"id,fullname,internal",role:"telephone",sort:"-updatedAt",limit:10,page:1},m.statusClass=r.status,m.stateClass=r.state,m.success=h,m.$onInit=p,m.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},m.getTelephones=function(){m.query.offset=(m.query.page-1)*m.query.limit,c.hasRole("admin")?m.promise=s.user.get(m.query,h).$promise:(m.query.id=m.userProfile.id,m.query.section="Telephones",m.promise=s.userProfile.getResources(m.query,h).$promise)},m.onSave=function(e){m.telephones[e.id]&&_.merge(m.telephones[e.id],_.pick(e,u))},o.on("telephone:save",m.onSave);var g=!0,v=1;function h(e){m.telephones=e?_.keyBy(e.rows?e.rows:[],"id"):{},p()}e.$watch("vm.query.filter",function(e,t){g?n(function(){g=!1}):(t||(v=m.query.page),e!==t&&(m.query.page=1),e||(m.query.page=v),m.getTelephones())}),e.$on("$destroy",function(){o.removeAllListeners("telephone:save")})}e.$inject=["$scope","$timeout","$mdDialog","telephones","rpcTelephones","api","socket","helperClasses","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TelephonesVoiceRealtimeController",e)}(),function(){"use strict";function e(e,n,t,a,i,s,o,r,l,d,c,m){var u=this,p=["status","stateRegistry","registry","host","port","internal","state","status"];function g(){for(var e,t=0;t<u.trunks.length;t+=1)0<=(e=_.findIndex(u.rpcTrunks,["id",u.trunks[t].id]))&&_.merge(u.trunks[t],_.pick(u.rpcTrunks[e],p))}function v(e,t,n){0<=t&&_.merge(e[t],_.pick(n,p))}u.currentUser=m.getCurrentUser(),u.count=a.count,u.trunks=a?a.rows:[],u.rpcTrunks=i&&i.rows?i.rows:[],u.query={fields:"id,name",active:!0,sort:"-updatedAt",limit:10,page:1},u.statusClass=r.status,u.stateClass=r.state,u.userProfile=d,u.userProfileSection=c&&1==c.count?c.rows[0]:null,u.crudPermissions=m.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.success=b,u.$onInit=g,u.showInfo=function(e){t.show(t.alert().clickOutsideToClose(!0).title("Legend").htmlContent("<div>TODO legend status + state</div>").ok("Ok").targetEvent(e))},u.getTrunks=function(){u.query.offset=(u.query.page-1)*u.query.limit,m.hasRole("admin")?u.promise=s.trunk.get(u.query,b).$promise:(u.query.id=u.userProfile.id,u.query.section="Trunks",u.promise=s.userProfile.getResources(u.query,b).$promise)},u.goToTrunk=function(e,t){l.go("app.tools.trunks.edit",{id:t.id})},u.onSave=function(e){var t=_.findIndex(u.trunks,["id",e.id]),n=_.findIndex(u.rpcTrunks,["id",e.id]);v(u.trunks,t,e),v(u.rpcTrunks,n,e)},o.on("trunk:save",u.onSave);var h=!0,f=1;function b(e){u.count=e.count,u.trunks=e&&e.rows?e.rows:[],g()}e.$watch("vm.query.filter",function(e,t){h?n(function(){h=!1}):(t||(f=u.query.page),e!==t&&(u.query.page=1),e||(u.query.page=f),u.getTrunks())}),e.$on("$destroy",function(){o.removeAllListeners("trunk:save")})}e.$inject=["$scope","$timeout","$mdDialog","trunks","rpcTrunks","api","socket","helperClasses","$state","userProfile","userProfileSection","Auth"],angular.module("app.voice").controller("TrunksVoiceRealtimeController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEMAIL",g.voicemail=angular.copy(l),g.voicemails=r,g.newVoicemail=!1,g.voicemail||(g.voicemail={attach:"no"},g.title="VOICE.NEW_VOICEMAIL",g.newVoicemail=!0),g.addNewVoicemail=function(){g.errors=[],d.voiceMail.save(g.voicemail).$promise.then(function(e){g.voicemails.unshift(e.toJSON()),o.success({title:"Voicemail properly created",msg:g.voicemail.name?g.voicemail.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoicemail=function(){g.errors=[],d.voiceMail.update({id:g.voicemail.id},g.voicemail).$promise.then(function(e){var t=_.find(g.voicemails,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"Voicemail properly saved!",msg:g.voicemail.name?g.voicemail.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoicemail=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voicemail will be deleted.").ariaLabel("Delete Voicemail").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceMail.delete({id:g.voicemail.id}).$promise.then(function(){_.remove(g.voicemails,{id:g.voicemail.id}),o.success({title:"Voicemail properly deleted!",msg:(g.voicemail.name||"voicemail")+" has been deleted!"}),v(g.voicemail)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceMail.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicemails","voicemail","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoicemailDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d){var c=this;c.currentUser=d.getCurrentUser(),c.voicemail={},c.voicemailMessages={count:0,rows:[]},c.selectedVoicemailMessages=[],c.crudPermissions,c.query={fields:"createdAt,updatedAt,id,callerid,duration,audio,stamp,msg_id",sort:"-stamp",limit:10,page:1},c.init=function(e,t){c.voicemail=e,c.crudPermissions=void 0!==t?t:{readOnly:!0,canEdit:!1,canDelete:!1},c.query.id=c.voicemail.id,c.getVoicemailMessages()},c.deleteConfirm=function(e,t){var n=s.confirm().title("Are you sure want to delete the message?").htmlContent("<b>"+(e.name||"message")+"</b> will be deleted.").ariaLabel("delete message").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){g(e)},function(){console.log("CANCEL")})},c.voiceMailMessageDownload=function(s,e,t){return l.voiceMailMessage.download({id:s.id,exists:!0,attachments:t}).$promise.then(function(e){var t=[e.buffer],n="message"+s.id,a=new Blob(t,{type:e.type});n=s.msg_id+".wav";var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceMail.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.success=p,c.getVoicemailMessages=function(){c.query.offset=(c.query.page-1)*c.query.limit,c.promise=l.voiceMail.getMessages(c.query,p).$promise},c.createOrEditVoicemailMessage=function(e,t){s.show({controller:"CreateOrEditMessageDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/edit/messages/dialog.html",parent:angular.element(o.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:c.voicemail,message:t,messages:c.voicemailMessages.rows,license:null,setting:null,crudPermissions:c.crudPermissions}})},c.exportSelectedVoicemailMessages=function(){var e=angular.copy(c.selectedVoicemailMessages);return c.selectedVoicemailMessages=[],e},c.deleteVoicemailMessage=g,c.deleteSelectedVoicemailMessages=function(e){var t=s.confirm().title("Are you sure want to delete the selected messages?").htmlContent("<b>"+c.selectedVoicemailMessages.length+" selected</b> will be deleted.").ariaLabel("delete messages").targetEvent(e).ok("OK").cancel("CANCEL");s.show(t).then(function(){c.selectedVoicemailMessages.forEach(function(e){g(e)}),c.selectedVoicemailMessages=[]})};var m=!0,u=1;function p(e){c.voicemailMessages=e||{count:0,rows:[]}}function g(e){l.voiceMailMessage.delete({id:e.id}).$promise.then(function(){_.remove(c.voicemailMessages.rows,{id:e.id}),c.voicemailMessages.count-=1,c.voicemailMessages.rows.length||c.getVoicemailMessages(),r.success({title:"Message deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){vm.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:GETvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)r.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else r.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}t.$watch("vm_dc.query.filter",function(e,t){m?i(function(){m=!1}):(t||(u=c.query.page),e!==t&&(c.query.page=1),e||(c.query.page=u),c.getVoicemailMessages())})}e.$inject=["$cookies","$scope","$state","$q","$timeout","$mdDialog","$document","toasty","api","Auth"],angular.module("app.voice").controller("VoicemailMessagesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=s,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=t.protocol()+"://"+t.host(),u.voicemail=c||e.params.voicemail||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=e.params.tab||0,u.alert=l.info,u.gotoVoicemails=function(){e.go("app.voice.voicemails")},u.saveVoicemail=function(){r.voiceMail.update({id:u.voicemail.id},u.voicemail).$promise.then(function(){l.success({title:"Voicemail updated!",msg:u.voicemail.name?u.voicemail.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceMail",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_CONTEXTS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceContext.get({fields:"id,name",sort:"name"}).$promise.then(function(e){u.contexts=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:405}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.contexts,{id:e.resourceId})}),n=null;if(u.voicemail&&(n=_.find(u.contexts,{name:u.voicemail.context})),n&&!_.some(t,["id",n.id])){var a=_.find(u.contexts,{id:n.id});a.canSelect=!1,t.push(a)}u.contexts=t}):r.voiceContext.get({fields:"id,name",sort:"name",defaultEntry:1}).$promise.then(function(e){u.contexts=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETcontexts",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voicemail","userProfileSection"],angular.module("app.voice").controller("VoicemailController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voicemails=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voicemails",b.listOrder="",b.listOrderAsc=null,b.selectedVoicemails=[],b.query={fields:"createdAt,updatedAt,id,customer_id,fullname,email,password,mailbox,context,tz,attach,envelope,delete,emailbody,emailsubject,maxsecs,maxmsg",sort:"-updatedAt",limit:10,page:1},b.arrayattach=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayenvelope=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraydelete=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.voicemails.edit",{id:e.id,voicemail:e,crudPermissions:b.crudPermissions})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voicemail")+"?").htmlContent("<b>"+(e.name||"voicemail")+"</b> will be deleted.").ariaLabel("delete voicemail").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoicemails=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceMail.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="Voicemails",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoicemail=function(e,t){i.show({controller:"CreateOrEditVoicemailDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicemails/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicemail:t,voicemails:b.voicemails.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoicemail=S,b.exportSelectedVoicemails=function(){var e=angular.copy(b.selectedVoicemails);return b.selectedVoicemails=[],e},b.deleteSelectedVoicemails=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicemails?").htmlContent("<b>"+b.selectedVoicemails.length+" selected</b> will be deleted.").ariaLabel("delete Voicemails").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoicemails.forEach(function(e){S(e)}),b.selectedVoicemails=[]})},b.deselectVoicemails=function(){b.selectedVoicemails=[]},b.selectAllVoicemails=function(){b.selectedVoicemails=b.voicemails.rows};var E=!0,A=1;function y(e){b.voicemails=e||{count:0,rows:[]}}function S(e){m.voiceMail.delete({id:e.id}).$promise.then(function(){_.remove(b.voicemails.rows,{id:e.id}),b.voicemails.count-=1,b.voicemails.rows.length||b.getVoicemails(),p.success({title:_.startCase("Voicemail")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceMail"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceMail",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoicemails())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicemails","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicemailsController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEPREFIX",g.voicePrefix=angular.copy(l),g.voicePrefixes=r,g.newvoicePrefix=!1,g.voicePrefix||(g.voicePrefix={},g.title="VOICE.NEW_VOICEPREFIX",g.newvoicePrefix=!0),g.addNewvoicePrefix=function(){g.errors=[],d.voicePrefix.save(g.voicePrefix).$promise.then(function(e){g.voicePrefixes.unshift(e.toJSON()),o.success({title:"voicePrefix properly created",msg:g.voicePrefix.name?g.voicePrefix.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.savevoicePrefix=function(){g.errors=[],d.voicePrefix.update({id:g.voicePrefix.id},g.voicePrefix).$promise.then(function(e){var t=_.find(g.voicePrefixes,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"voicePrefix properly saved!",msg:g.voicePrefix.name?g.voicePrefix.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deletevoicePrefix=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voicePrefix will be deleted.").ariaLabel("Delete voicePrefix").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voicePrefix.delete({id:g.voicePrefix.id}).$promise.then(function(){_.remove(g.voicePrefixes,{id:g.voicePrefix.id}),o.success({title:"voicePrefix properly deleted!",msg:(g.voicePrefix.name||"voicePrefix")+" has been deleted!"}),v(g.voicePrefix)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voicePrefix.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voicePrefix.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v,c.hasRole("admin")?d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):d.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){g.outboundRoutes=e.rows||[]}).then(function(){return d.userProfileSection.get({userProfileId:g.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return d.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(g.outboundRoutes,{id:e.resourceId})}),n=null;if(g.voicePrefix&&(n=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)})),n&&!_.some(t,["id",n.id])){var a=_.find(g.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}g.outboundRoutes=t})}else{var n=[],a=null;g.voicePrefix&&(a=_.find(g.outboundRoutes,{id:Number(g.voicePrefix.VoiceExtensionId)}));for(var i=0;i<g.outboundRoutes.length;i++)a&&g.outboundRoutes[i].id===a.id&&(g.outboundRoutes[i].canSelect=!1,n.push(g.outboundRoutes[i]));g.outboundRoutes=n}}).catch(function(e){o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voicePrefixes","voicePrefix","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditvoicePrefixDialogController",e)}(),function(){"use strict";function e(e,a,i,s,t,n,o,r,l,d){var c=this;function m(){return a(function(n,t){return a(function(t,n){return s.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],l.hasRole("admin")?e:c.section?c.section.autoAssociation?e:a(function(t,n){return s.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:l.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});l.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),a(function(t,n){return s.voicePrefix.getAgents({id:c.voicePrefix.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UservoicePrefix?"penalty "+e.UservoicePrefix.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=l.getCurrentUser(),c.voicePrefix=t,c.crudPermissions=d,c.realtime=o,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return l.hasRole("admin")?m().catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):a(function(n,t){s.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceBy(c.selectedItems,c.startingSelectedItems,"id");return(n=e,a(function(e,t){_.isEmpty(n)?e():s.voicePrefix.removeAgents({id:c.voicePrefix.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return n=t,a(function(e,t){_.isEmpty(n)?e():s.voicePrefix.addAgents({id:c.voicePrefix.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})});var n}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),i.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!o,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"",labelAll:r.instant("VOICE.ALL_AGENTS"),labelSelected:r.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){var n=_.xorBy(c.startingSelectedItems,c.selectedItems,"id");c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","voicePrefix","voicePrefixes","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("voicePrefixagentaddController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voicePrefixes=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voicePrefixes",b.listOrder="",b.listOrderAsc=null,b.selectedVoicePrefixes=[],b.query={fields:"createdAt,updatedAt,id,name,VoiceExtensionId,callerIdAll,description",limit:10,page:1},b.editdialog=function(e,t){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:b.voicePrefixes.rows,license:b.license,setting:null,crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"voicePrefixagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voicePrefix:e,voicePrefixes:b.voicePrefixes?b.voicePrefixes.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voicePrefix")+"?").htmlContent("<b>"+(e.name||"voicePrefix")+"</b> will be deleted.").ariaLabel("delete voicePrefix").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoicePrefixes=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voicePrefix.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoicePrefixes",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditvoicePrefix=function(e,t){i.show({controller:"CreateOrEditvoicePrefixDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voicePrefixes/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voicePrefix:t,voicePrefixes:b.voicePrefixes.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deletevoicePrefix=S,b.exportSelectedVoicePrefixes=function(){var e=angular.copy(b.selectedVoicePrefixes);return b.selectedVoicePrefixes=[],e},b.deleteSelectedVoicePrefixes=function(e){var t=i.confirm().title("Are you sure want to delete the selected voicePrefixes?").htmlContent("<b>"+b.selectedVoicePrefixes.length+" selected</b> will be deleted.").ariaLabel("delete voicePrefixs").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoicePrefixes.forEach(function(e){S(e)}),b.selectedVoicePrefixes=[]})},b.deselectVoicePrefixes=function(){b.selectedVoicePrefixes=[]},b.selectAllVoicePrefixes=function(){b.selectedVoicePrefixes=b.voicePrefixes.rows},g.hasRole("admin")?m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){b.outboundRoutes=e.rows||[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_OUTBOUNDROUTES",msg:e.data?JSON.stringify(e.data):e.toString()})}):m.voiceExtension.get({fields:"id,exten",type:"outbound",VoiceExtensionId:"null",nolimit:"true"}).$promise.then(function(e){b.outboundRoutes=e.rows||[]}).then(function(){return m.userProfileSection.get({userProfileId:b.currentUser.userProfileId,sectionId:403}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return m.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(b.outboundRoutes,{id:e.resourceId})}),n=null;if(b.voicePrefix&&(n=_.find(b.outboundRoutes,{id:Number(b.voicePrefix.VoiceExtensionId)})),n&&!_.some(t,["id",n.id])){var a=_.find(b.outboundRoutes,{id:n.id});a.canSelect=!1,t.push(a)}b.outboundRoutes=t})}else{var n=[],a=null;b.voicePrefix&&(a=_.find(b.outboundRoutes,{id:Number(b.voicePrefix.VoiceExtensionId)}));for(var i=0;i<b.outboundRoutes.length;i++)a&&b.outboundRoutes[i].id===a.id&&(b.outboundRoutes[i].canSelect=!1,n.push(b.outboundRoutes[i]));b.outboundRoutes=n}}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GEToutboundRoutes",msg:e.data?JSON.stringify(e.data):e.toString()})});var E=!0,A=1;function y(e){b.voicePrefixes=e||{count:0,rows:[]}}function S(e){m.voicePrefix.delete({id:e.id}).$promise.then(function(){_.remove(b.voicePrefixes.rows,{id:e.id}),b.voicePrefixes.count-=1,b.voicePrefixes.rows.length||b.getVoicePrefixes(),p.success({title:_.startCase("voicePrefix")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoicePrefix"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoicePrefix",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoicePrefixes())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voicePrefixes","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoicePrefixesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICEQUEUE",g.voiceQueue=angular.copy(l),g.voiceQueues=r,g.newVoiceQueue=!1,g.voiceQueue||(g.voiceQueue={type:"inbound",strategy:"ringall",timeout:15,retry:2,random_periodic_announce:"no",announce_holdtime:"no",announce_position:"no",reportholdtime:"no",autopause:"no",ringinuse:"no",timeoutrestart:"no",setinterfacevar:"no",setqueuevar:"no",setqueueentryvar:"no"},g.title="VOICE.NEW_VOICEQUEUE",g.newVoiceQueue=!0),g.addNewVoiceQueue=function(){g.errors=[],d.voiceQueue.save(g.voiceQueue).$promise.then(function(e){g.voiceQueues.unshift(e.toJSON()),o.success({title:"VoiceQueue properly created",msg:g.voiceQueue.name?g.voiceQueue.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceQueue=function(){g.errors=[],d.voiceQueue.update({id:g.voiceQueue.id},g.voiceQueue).$promise.then(function(e){var t=_.find(g.voiceQueues,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceQueue properly saved!",msg:g.voiceQueue.name?g.voiceQueue.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceQueue=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceQueue will be deleted.").ariaLabel("Delete VoiceQueue").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceQueue.delete({id:g.voiceQueue.id}).$promise.then(function(){_.remove(g.voiceQueues,{id:g.voiceQueue.id}),o.success({title:"VoiceQueue properly deleted!",msg:(g.voiceQueue.name||"voiceQueue")+" has been deleted!"}),v(g.voiceQueue)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceQueue.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceQueue.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceQueues","voiceQueue","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceQueueDialogController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s,o,r){var c=this;function m(){return l(function(n,t){return l(function(t,n){return d.user.get({fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],o.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:o.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.startingAllowedItems=angular.copy(c.allowedItems),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});o.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getAgents({id:c.voiceQueue.id,fields:"id,name,internal,fullname",nolimit:!0,role:"agent"}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){var t=_.find(c.items,{id:e.id});return t.penalty=e.UserVoiceQueue?"penalty "+e.UserVoiceQueue.penalty:"",t.internal=e.hasOwnProperty("internal")?"<"+e.internal+">":"",t}),c.startingSelectedItems=angular.copy(c.selectedItems),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=o.getCurrentUser(),c.voiceQueue=t,c.crudPermissions=r,c.penalty=0,c.realtime=i,c.items=[],c.allowedItems=[],c.selectedItems=[],c.startingAllowedItems=[],c.startingSelectedItems=[],c.pendingChanges=!1,c.onInit=function(){return o.hasRole("admin")?m().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Agents"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,m()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_AGENTS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveAgents=function(){var e=_.differenceBy(c.startingSelectedItems,c.selectedItems,"id"),t=_.differenceWith(c.selectedItems,c.startingSelectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeAgents({id:c.voiceQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addAgents({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty "),realtime:c.realtime||!1}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.startingAllowedItems=angular.copy(c.allowedItems),c.startingSelectedItems=angular.copy(c.selectedItems),a.success({title:"SUCCESS",msg:"Agents association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()},c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,items:[],selectedItems:[],showSelectAndDeselectAll:!i,orderBy:"name",line1:"fullname",line2:["name","internal"],line3:"penalty",labelAll:s.instant("VOICE.ALL_AGENTS"),labelSelected:s.instant("VOICE.SELECTED_AGENTS"),transferCallback:function(e,t){t?e.forEach(function(e){e.penalty=void 0}):e.forEach(function(e){e.penalty="penalty "+c.penalty});var n=_.xorWith(c.startingSelectedItems,c.selectedItems,function(e,t){return e.id===t.id&&e.penalty===t.penalty});c.pendingChanges=!_.isEmpty(n)}}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","voiceQueues","realtime","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueagentaddController",e)}(),function(){"use strict";function e(e,l,a,d,t,n,i,s){var c=this;function o(){return l(function(n,t){return l(function(t,n){return d.team.get({fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}).then(function(e){return c.items=e.rows?e.rows:[],i.hasRole("admin")?e:c.section?c.section.autoAssociation?e:l(function(t,n){return d.userProfileResource.get({sectionId:c.section.id}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})}):null}).then(function(e){var t=e&&e.rows?e.rows:[];return c.allowedItems=_.map(t,function(e){return _.find(c.items,{id:i.hasRole("admin")||c.section.autoAssociation?e.id:e.resourceId})}),c.items.forEach(function(e){var t=_.find(c.allowedItems,{id:e.id});i.hasRole("admin")?e.isValid=!0:e.isValid=void 0!==t}),l(function(t,n){return d.voiceQueue.getTeams({id:c.voiceQueue.id,fields:"id,name",nolimit:!0}).$promise.then(function(e){t(e)}).catch(function(e){n(e)})})}).then(function(e){var t=e&&e.rows?e.rows:[];c.selectedItems=_.map(t,function(e){return _.find(c.items,{id:e.id})}),c.dualMultiselectOptions.selectedItems=c.selectedItems,c.dualMultiselectOptions.items=_.differenceBy(c.allowedItems,c.dualMultiselectOptions.selectedItems,"id"),n()}).catch(function(e){t(e)})})}c.currentUser=i.getCurrentUser(),c.voiceQueue=t,c.crudPermissions=s,c.penalty=0,c.items=[],c.allowedItems=[],c.selectedItems=[],c.addedItems=[],c.removedItems=[],c.pendingChanges=!1,c.dualMultiselectOptions={readOnly:!c.crudPermissions.canEdit,allowedItems:[],selectedItems:[],showSelectAndDeselectAll:!0,orderBy:"name",line1:"name",line2:"",line3:"",labelAll:n.instant("VOICE.ALL_TEAMS"),labelSelected:n.instant("VOICE.SELECTED_TEAMS"),transferCallback:function(e,t){t?c.removedItems=_.unionBy(e,c.removedItems,"id"):(e.forEach(function(e){e.penalty="penalty "+c.penalty}),c.addedItems=_.unionBy(e,c.addedItems,"id")),c.pendingChanges=!0}},c.onInit=function(){return i.hasRole("admin")?o().catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})}):l(function(n,t){d.userProfileSection.get({userProfileId:c.currentUser.userProfileId,name:"Teams"}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;n(t)}).catch(function(e){t(e)})}).then(function(e){return c.section=e,o()}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_TEAMS",msg:e.status?JSON.stringify(e.data):e.toString()})})},c.saveTeams=function(){var e=c.removedItems,t=c.addedItems;return(n=e,l(function(e,t){_.isEmpty(n)?e():d.voiceQueue.removeTeams({id:c.voiceQueue.id,ids:_.map(n,"id")}).$promise.then(function(){e()}).catch(function(e){t(e)})})).then(function(){return r=t,l(function(e,t){if(_.isEmpty(r))e();else{for(var n=[],a=_.groupBy(r,"penalty"),i=0;i<Object.keys(a).length;i++){var s=Object.keys(a)[i],o=_.filter(r,["penalty",s]);n.push(d.voiceQueue.addTeams({id:c.voiceQueue.id,ids:_.map(o,"id"),penalty:_.trim(s,"penalty ")}).$promise)}l.all(n).then(function(){e()}).catch(function(e){t(e)})}});var r}).then(function(){c.pendingChanges=!1,c.addedItems=[],c.removedItems=[],a.success({title:"SUCCESS",msg:"Teams association has been updated!"})}).catch(function(e){a.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:LISTS_ASSOCIATION",msg:e.status?JSON.stringify(e.data):e.toString()})});var n},c.closeDialog=function(){e.hide()}}e.$inject=["$mdDialog","$q","toasty","api","voiceQueue","$translate","Auth","crudPermissions"],angular.module("app.voice").controller("VoiceQueueteamaddController",e)}(),function(){"use strict";function e(n,e,a,i,s,t,o,r,l,d,c,m){var u=this;u.currentUser=d.getCurrentUser(),u.license=t,u.setting=o,u.passwordPattern=u.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",u.location=e.protocol()+"://"+e.host(),u.voiceQueue=c||n.params.voiceQueue||{},u.userProfileSection=m&&1==m.count?m.rows[0]:null,u.crudPermissions=d.parseCrudPermissions(u.userProfileSection?u.userProfileSection.crudPermissions:null),u.hasModulePermissions={},u.selectedTab=n.params.tab||0,u.teamadddialog=function(e,t){a.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions}})},u.agentadddialog=function(e,t){a.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(i.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:u.voiceQueues?u.voiceQueues.rows:[],crudPermissions:u.crudPermissions,realtime:!1}})},u.gotogoto=function(e,t){{if(!d.hasRole("admin"))return r.userProfileSection.get({userProfileId:d.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.queues",{}):l.info({title:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:s.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.queues",{})}},u.alert=l.info,u.gotoVoiceQueues=function(){n.go("app.voice.voiceQueues")},u.saveVoiceQueue=function(){r.voiceQueue.update({id:u.voiceQueue.id},u.voiceQueue).$promise.then(function(){l.success({title:"VoiceQueue updated!",msg:u.voiceQueue.name?u.voiceQueue.name+" has been updated!":""})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETvoiceQueue",msg:e.data?JSON.stringify(e.data):e.toString()})})},d.hasRole("admin")?r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_MUSICONHOLDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true"}).$promise.then(function(e){u.musiconholds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:407}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;return t?t.autoAssociation?void 0:r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.musiconholds,{id:e.resourceId})}),n=null;if(u.voiceQueue&&(n=_.find(u.musiconholds,{name:u.voiceQueue.musiconhold})),n&&!_.some(t,["id",n.id])){var a=_.find(u.musiconholds,{id:n.id});a.canSelect=!1,t.push(a)}u.musiconholds=t}):r.voiceMusicOnHold.get({fields:"id,name",nolimit:"true",defaultEntry:1}).$promise.then(function(e){u.musiconholds=e.rows||[]})}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETmusiconholds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_SOUNDS",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.sound.get({fields:"id,name,save_name",sort:"name",nolimit:"true"}).$promise.then(function(e){u.sounds=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1007}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.sounds,{id:e.resourceId})});u.sounds.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.sounds=t})}else u.sounds=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETsounds",msg:e.data?JSON.stringify(e.data):e.toString()})}),d.hasRole("admin")?r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GET_PAUSES",msg:e.data?JSON.stringify(e.data):e.toString()})}):r.pause.get({fields:"name,id",sort:"name",nolimit:"true"}).$promise.then(function(e){u.pauses=e.rows||[]}).then(function(){return r.userProfileSection.get({userProfileId:u.currentUser.userProfileId,sectionId:1005}).$promise}).then(function(e){var t=e&&e.rows?e.rows[0]:null;if(t){if(!t.autoAssociation)return r.userProfileResource.get({sectionId:t.id}).$promise.then(function(e){var t=_.map(e.rows,function(e){return _.find(u.pauses,{id:e.resourceId})});u.pauses.forEach(function(e){_.some(t,["id",e.id])||(e.canSelect=!1),t.push(e)}),u.pauses=t})}else u.pauses=[]}).catch(function(e){l.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETpauses",msg:e.data?JSON.stringify(e.data):e.toString()})})}e.$inject=["$state","$location","$mdDialog","$document","$translate","license","setting","api","toasty","Auth","voiceQueue","userProfileSection"],angular.module("app.voice").controller("VoiceQueueController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceQueues=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceQueues",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceQueues=[],b.query={fields:"createdAt,updatedAt,id,name,type,strategy,timeout,maxlen,retry,wrapuptime,weight,joinempty,leavewhenempty,musiconhold,announce,description,periodic_announce,queue_reporthold,queue_youarenext,queue_thereare,queue_callswaiting,queue_holdtime,queue_minutes,queue_minute,queue_seconds,queue_thankyou,announce_frequency,min_announce_frequency,periodic_announce_frequency,random_periodic_announce,announce_holdtime,announce_position,announce_position_limit,reportholdtime,acw,acwTimeout,autopause,ringinuse,memberdelay,timeoutrestart,monitor_format,context,setinterfacevar,setqueuevar,setqueueentryvar,mandatoryDisposition,mandatoryDispositionPauseId",type:"inbound",sort:"-updatedAt",channel:"voice",limit:10,page:1},b.arraystrategy=_.keyBy([{option:"Ringall",value:"'ringall'"},{option:"Round Robin Memory",value:"'rrmemory'"},{option:"Least Recent",value:"'leastrecent'"},{option:"Fewest Calls",value:"'fewestcalls'"},{option:"Random",value:"'random'"},{option:"Linear",value:"'linear'"},{option:"Weight Random",value:"'wrandom'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayjoinempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknown",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayleavewhenempty=_.keyBy([{option:"no",value:"'no'"},{option:"yes",value:"'yes'"},{option:"strict",value:"'strict'"},{option:"loose",value:"'loose'"},{option:"paused",value:"'paused'"},{option:"penalty",value:"'penalty'"},{option:"inuse",value:"'inuse'"},{option:"ringing",value:"'ringing'"},{option:"unavailable",value:"'unavailable'"},{option:"invalid",value:"'invalid'"},{option:"unknown",value:"'unknown'"},{option:"wrapup",value:"'wrapup'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayrandom_periodic_announce=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayannounce_holdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Once",value:"'once'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayannounce_position=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"},{option:"Limit",value:"'limit'"},{option:"More",value:"'more'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayreportholdtime=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayautopause=_.keyBy([{option:"Yes",value:"'all'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arrayringinuse=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraytimeoutrestart=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraymonitor_format=_.keyBy([{option:"Inactive",value:"''"},{option:"wav",value:"'wav'"},{option:"wav49",value:"'wav49'"},{option:"gsm",value:"'gsm'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetinterfacevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueuevar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.arraysetqueueentryvar=_.keyBy([{option:"Yes",value:"'yes'"},{option:"No",value:"'no'"}],function(e){return _.replace(e.value,new RegExp("'","g"),"")}),b.editstate=function(e,t){n.go("app.voice.voiceQueues.edit",{id:e.id,voiceQueue:e,crudPermissions:b.crudPermissions})},b.teamadddialog=function(e,t){i.show({controller:"VoiceQueueteamaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:b.voiceQueues?b.voiceQueues.rows:[],crudPermissions:b.crudPermissions}})},b.agentadddialog=function(e,t){i.show({controller:"VoiceQueueagentaddController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",parent:angular.element(s.body),targetEvent:t,clickOutsideToClose:!0,locals:{voiceQueue:e,voiceQueues:b.voiceQueues?b.voiceQueues.rows:[],crudPermissions:b.crudPermissions,realtime:!1}})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceQueue")+"?").htmlContent("<b>"+(e.name||"voiceQueue")+"</b> will be deleted.").ariaLabel("delete voiceQueue").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.gotorealtimegoto=function(e,t){{if(!g.hasRole("admin"))return m.userProfileSection.get({userProfileId:g.getCurrentUser().userProfileId,sectionId:411}).$promise.then(function(e){var t=e&&e.rows?e.rows[0]:null;t&&t.enabled?n.go("app.voice.realtime.queues",{}):p.info({title:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE"),msg:r.instant("STAFF.PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE")})}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"USERPROFILE:GET_SECTION",msg:e.status?JSON.stringify(e.data):e.toString()})});n.go("app.voice.realtime.queues",{})}},b.success=y,b.getVoiceQueues=function(){b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceQueue.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceQueues",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoiceQueue=function(e,t){i.show({controller:"CreateOrEditVoiceQueueDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceQueues/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceQueue:t,voiceQueues:b.voiceQueues.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceQueue=S,b.exportSelectedVoiceQueues=function(){var e=angular.copy(b.selectedVoiceQueues);return b.selectedVoiceQueues=[],e},b.deleteSelectedVoiceQueues=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceQueues?").htmlContent("<b>"+b.selectedVoiceQueues.length+" selected</b> will be deleted.").ariaLabel("delete VoiceQueues").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoiceQueues.forEach(function(e){S(e)}),b.selectedVoiceQueues=[]})},b.deselectVoiceQueues=function(){b.selectedVoiceQueues=[]},b.selectAllVoiceQueues=function(){b.selectedVoiceQueues=b.voiceQueues.rows};var E=!0,A=1;function y(e){b.voiceQueues=e||{count:0,rows:[]}}function S(e){m.voiceQueue.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceQueues.rows,{id:e.id}),b.voiceQueues.count-=1,b.voiceQueues.rows.length||b.getVoiceQueues(),p.success({title:_.startCase("VoiceQueue")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceQueue"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceQueue",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoiceQueues())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceQueues","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceQueuesController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p){var g=this;function v(e){a.hide(e)}g.currentUser=c.getCurrentUser(),g.errors=[],g.setting=u,g.license=m,g.crudPermissions=p,g.hasModulePermissions={},g.passwordPattern=g.setting&&g.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",g.title="VOICE.EDIT_VOICERECORDING",g.voiceRecording=angular.copy(l),g.voiceRecordings=r,g.newVoiceRecording=!1,g.voiceRecording||(g.voiceRecording={},g.title="VOICE.NEW_VOICERECORDING",g.newVoiceRecording=!0),g.addNewVoiceRecording=function(){g.errors=[],d.voiceRecording.save(g.voiceRecording).$promise.then(function(e){g.voiceRecordings.unshift(e.toJSON()),o.success({title:"VoiceRecording properly created",msg:g.voiceRecording.name?g.voiceRecording.name+" has been created!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.save"}];for(var t=0;t<e.data.errors.length;t+=1)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.saveVoiceRecording=function(){g.errors=[],d.voiceRecording.update({id:g.voiceRecording.id},g.voiceRecording).$promise.then(function(e){var t=_.find(g.voiceRecordings,{id:e.id});t&&_.merge(t,_.pick(e.toJSON(),_.keys(t))),o.success({title:"VoiceRecording properly saved!",msg:g.voiceRecording.name?g.voiceRecording.name+" has been saved!":""}),v(e)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.update"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},g.deleteVoiceRecording=function(e){g.errors=[];var t=a.confirm().title("Are you sure?").content("The voiceRecording will be deleted.").ariaLabel("Delete VoiceRecording").ok("Delete").cancel("Cancel").targetEvent(e);a.show(t).then(function(){d.voiceRecording.delete({id:g.voiceRecording.id}).$promise.then(function(){_.remove(g.voiceRecordings,{id:g.voiceRecording.id}),o.success({title:"VoiceRecording properly deleted!",msg:(g.voiceRecording.name||"voiceRecording")+" has been deleted!"}),v(g.voiceRecording)}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){g.errors=e.data.errors||[{message:e.toString(),type:"api.voiceRecording.delete"}];for(var t=0;t<e.data.errors.length;t++)o.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else o.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.delete",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})},function(){})},g.getDateFromString=function(e){return null===e?void 0:new Date(e)},g.closeDialog=v}e.$inject=["$scope","$state","$location","$mdDialog","$q","$translate","toasty","voiceRecordings","voiceRecording","api","Auth","license","setting","crudPermissions"],angular.module("app.voice").controller("CreateOrEditVoiceRecordingDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f){var b=this;b.license=v,b.setting=h,b.currentUser=g.getCurrentUser(),b.voiceRecordings=l||{count:0,rows:[]},b.userProfile=d,b.userProfileSection=c&&1==c.count?c.rows[0]:null,b.crudPermissions=g.parseCrudPermissions(b.userProfileSection?b.userProfileSection.crudPermissions:null),b.table="voiceRecordings",b.listOrder="",b.listOrderAsc=null,b.selectedVoiceRecordings=[],b.query={fields:"createdAt,updatedAt,id,format,value,type,uniqueid,calleridnum,exten,connectedlinenum,queue,membername,rating,audio,userDisposition",sort:"-updatedAt",limit:10,page:1},b.localizationMap=f,b.pickerModel={dateStart:null},b.downloadfile2=function(s,e){return m.voiceRecording.download({id:s.id}).$promise.then(function(e){var t=[e.buffer],n="download",a=new Blob(t,{type:e.type});n=s.uniqueid+s.format;var i=window.document.createElement("a");i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download",n),document.body.appendChild(i),i.click()}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.voiceRecording.save",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},b.deleteconfirm=function(e,t){var n=i.confirm().title("Are you sure want to delete the "+_.startCase("voiceRecording")+"?").htmlContent("<b>"+(e.name||"voiceRecording")+"</b> will be deleted.").ariaLabel("delete voiceRecording").targetEvent(t).ok("OK").cancel("CANCEL");i.show(n).then(function(){S(e)},function(){console.log("CANCEL")})},b.success=y,b.getVoiceRecordings=function(){if(b.pickerModel.dateStart){var e=moment(b.pickerModel.dateEnd).add(23,"hours").add(59,"minutes").add(59,"seconds").format();b.query.createdAt={$gte:b.pickerModel.dateStart,$lte:e}}else b.query.createdAt=void 0;b.query.offset=(b.query.page-1)*b.query.limit,g.hasRole("admin")?b.promise=m.voiceRecording.get(b.query,y).$promise:(b.query.id=b.userProfile.id,b.query.section="VoiceRecordings",b.promise=m.userProfile.getResources(b.query,y).$promise)},b.createOrEditVoiceRecording=function(e,t){i.show({controller:"CreateOrEditVoiceRecordingDialogController",controllerAs:"vm",templateUrl:"app/main/apps/voice/views/voiceRecordings/create/dialog.html",parent:angular.element(s.body),targetEvent:e,clickOutsideToClose:!0,locals:{voiceRecording:t,voiceRecordings:b.voiceRecordings.rows,license:b.license,setting:b.setting,crudPermissions:b.crudPermissions}})},b.deleteVoiceRecording=S,b.exportSelectedVoiceRecordings=function(){var e=angular.copy(b.selectedVoiceRecordings);return b.selectedVoiceRecordings=[],e},b.deleteSelectedVoiceRecordings=function(e){var t=i.confirm().title("Are you sure want to delete the selected voiceRecordings?").htmlContent("<b>"+b.selectedVoiceRecordings.length+" selected</b> will be deleted.").ariaLabel("delete VoiceRecordings").targetEvent(e).ok("OK").cancel("CANCEL");i.show(t).then(function(){b.selectedVoiceRecordings.forEach(function(e){S(e)}),b.selectedVoiceRecordings=[]})},b.deselectVoiceRecordings=function(){b.selectedVoiceRecordings=[]},b.selectAllVoiceRecordings=function(){b.selectedVoiceRecordings=b.voiceRecordings.rows},b.clearDateFilter=function(){b.pickerModel={dateStart:null},b.getVoiceRecordings()};var E=!0,A=1;function y(e){b.voiceRecordings=e||{count:0,rows:[]}}function S(e){m.voiceRecording.delete({id:e.id}).$promise.then(function(){_.remove(b.voiceRecordings.rows,{id:e.id}),b.voiceRecordings.count-=1,b.voiceRecordings.rows.length||b.getVoiceRecordings(),p.success({title:_.startCase("VoiceRecording")+" deleted!",msg:e.name?e.name+" has been deleted!":""})}).catch(function(e){if(e.data&&e.data.errors&&e.data.errors.length){b.errors=e.data.errors||[{message:e.toString(),type:"SYSTEM:DELETEvoiceRecording"}];for(var t=0;t<e.data.errors.length;t++)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:DELETEvoiceRecording",msg:e.data?JSON.stringify(e.data.message):e.message||e.toString()})})}e.$watch("vm.query.filter",function(e,t){E?o(function(){E=!1}):(t||(A=b.query.page),e!==t&&(b.query.page=1),e||(b.query.page=A),b.getVoiceRecordings())})}e.$inject=["$scope","$window","$state","$mdSidenav","$mdDialog","$document","$timeout","$translate","voiceRecordings","userProfile","userProfileSection","api","msUtils","toasty","Auth","license","setting","dateFilterLocalizationFactory"],angular.module("app.voice").controller("VoiceRecordingsController",e)}(),function(){"use strict";function e(t,n,s,a,o,e,i,r){var l=this;function d(e,t){return{id:e,title:t.name||"NONAME",state:"app.dashboards.custom",stateParams:t,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(e)&&!o.hasRole("admin")}}}function c(e,t){return{id:e,title:t.name||"NONAME",state:"app.plugins.plugin",stateParams:t,weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(e)&&!o.hasRole("admin")}}}function m(e,t){a.saveItem("apps.home.plugin_"+e,{id:e,title:t.name,translate:t.name,state:"plugin_"+t.id,stateParams:t,view:"plugin",icon:t.icon,weight:12,hidden:function(){return!o.hasPermission(e)}})}function u(e){return _.map(e.children,function(e){return e.id})}l.isAgent=function(){return o.getCurrentUser()&&o.hasRole("agent")},s.saveItem("apps",{title:"APPS",group:!0,weight:1,hidden:function(){return o.hasRole("agent")}}),i.version.get().$promise.then(function(e){l.version=e&&e.current?e.current:"UNKNOWN"}).catch(function(e){l.version="UNKNOWN"}).finally(function(){s.saveItem("version",{title:"VERSION "+l.version,group:!0,weight:2,hidden:function(){return o.hasRole("agent")}})}),o.isLoggedIn()&&(i.dashboard.get().$promise.then(function(e){for(var t=0,n=0;n<e.rows.length;n+=1)t=99999+e.rows[n].id,s.saveItem("apps.dashboards.custom_"+t,d(t,e.rows[n]))}),i.plugin.get({active:!0}).$promise.then(function(e){var t=0;if(e.count){var n=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"agentOnly"!=e.sidebar});if(0<n.length){s.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",permissions:{hidden:!0},weight:17,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}});for(var a=0;a<n.length;a+=1)t=88888+n[a].id,s.saveItem("apps.plugins.plugin_"+t,c(t,n[a]));s.sort()}var i=_.filter(e.rows,function(e){return"never"!=e.sidebar&&"adminOnly"!=e.sidebar});if(0<i.length)for(a=0;a<i.length;a+=1)m(t=88888+i[a].id,i[a])}})),e.custom&&!r.defaultPageTitle&&r.pageTitle&&angular.element("#pageTitle").html(r.pageTitle),s.saveItem("apps.dashboards",{id:100,title:"Dashboards",translate:"DASHBOARDS.DASHBOARDS",icon:"icon-tile-four",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.dashboards.general",{id:101,title:"General",route:"",translate:"DASHBOARDS.GENERAL",state:"app.dashboards.general",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(101)&&!o.hasRole("admin")}}),s.saveItem("apps.staff",{id:200,title:"Staff",translate:"STAFF.STAFF",icon:"icon-account-multiple",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.staff.users",{id:201,title:"Users",route:"user",translate:"STAFF.USERS",state:"app.staff.users",permissions:{hidden:!0},weight:1,hidden:function(){return o.hasRole("agent")||o.hasRole("user")||!o.hasPermission(201)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.agents",{id:202,title:"Agents",route:"user",translate:"STAFF.AGENTS",state:"app.staff.agents",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(202)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.telephones",{id:203,title:"Telephones",route:"user",translate:"STAFF.TELEPHONES",state:"app.staff.telephones",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(203)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.teams",{id:204,title:"Teams",route:"team",translate:"STAFF.TEAMS",state:"app.staff.teams",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(204)&&!o.hasRole("admin")}}),s.saveItem("apps.staff.userProfiles",{id:205,title:"UserProfiles",route:"userProfile",translate:"STAFF.USERPROFILES",state:"app.staff.userProfiles",permissions:{hidden:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(205)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager",{id:300,title:"ContactManager",translate:"CONTACTMANAGER.CONTACTMANAGER",icon:"icon-account-circle",license:"cm",weight:4,hidden:function(){return!e.cm||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.lists",{id:301,title:"Lists",route:"cmList",translate:"CONTACTMANAGER.LISTS",state:"app.contactmanager.lists",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(301)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.companies",{id:302,title:"Companies",route:"cmCompany",translate:"CONTACTMANAGER.COMPANIES",state:"app.contactmanager.companies",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(302)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.globalCustomFields",{id:304,title:"GlobalCustomFields",route:"cmCustomField",translate:"CONTACTMANAGER.GLOBALCUSTOMFIELDS",state:"app.contactmanager.globalCustomFields",permissions:{association:!1},weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(304)&&!o.hasRole("admin")}}),s.saveItem("apps.contactmanager.contacts",{id:303,title:"Contacts",route:"",translate:"CONTACTMANAGER.CONTACTS",state:"app.contactmanager.contacts",permissions:{association:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(303)&&!o.hasRole("admin")}}),s.saveItem("apps.voice",{id:400,title:"Voice",translate:"VOICE.VOICE",icon:"icon-phone",license:"voice",weight:5,hidden:function(){return!e.voice||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voiceQueues",{id:401,title:"VoiceQueues",route:"voiceQueue",channel:"voice",translate:"VOICE.VOICEQUEUES",state:"app.voice.voiceQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(401)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.inboundroutes",{id:402,title:"InboundRoutes",route:"voiceExtension",translate:"VOICE.INBOUNDROUTES",state:"app.voice.inboundroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(402)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.outboundroutes",{id:403,title:"OutboundRoutes",route:"voiceExtension",translate:"VOICE.OUTBOUNDROUTES",state:"app.voice.outboundroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(403)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.internalroutes",{id:404,title:"InternalRoutes",route:"voiceExtension",translate:"VOICE.INTERNALROUTES",state:"app.voice.internalroutes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(404)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.contexts",{id:405,title:"Contexts",route:"voiceContext",translate:"VOICE.CONTEXTS",state:"app.voice.contexts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(405)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voicemails",{id:406,title:"Voicemails",route:"voiceMail",translate:"VOICE.VOICEMAILS",state:"app.voice.voicemails",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(406)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.musiconholds",{id:407,title:"MusicOnHolds",route:"voiceMusicOnHold",translate:"VOICE.MUSICONHOLDS",state:"app.voice.musiconholds",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(407)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voiceRecordings",{id:408,title:"VoiceRecordings",route:"voiceRecording",translate:"VOICE.VOICERECORDINGS",state:"app.voice.voiceRecordings",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(408)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.chanSpies",{id:409,title:"ChanSpies",route:"voiceChanSpy",translate:"VOICE.CHANSPIES",state:"app.voice.chanSpies",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(409)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.voicePrefixes",{id:410,title:"VoicePrefixes",route:"voicePrefix",translate:"VOICE.VOICEPREFIXES",state:"app.voice.voicePrefixes",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(410)&&!o.hasRole("admin")}}),s.saveItem("apps.voice.realtime",{id:411,title:"Realtime",route:"",translate:"VOICE.REALTIME",state:"app.voice.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(411)&&!o.hasRole("admin")}}),s.saveItem("apps.chat",{id:500,title:"Chat",translate:"CHAT.CHAT",icon:"icon-hangouts",license:"chat",weight:6,hidden:function(){return!e.chat||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.chat.chatQueues",{id:501,title:"ChatQueues",route:"chatQueue",channel:"chat",translate:"CHAT.CHATQUEUES",state:"app.chat.chatQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(501)&&!o.hasRole("admin")}}),s.saveItem("apps.chat.chatWebsites",{id:502,title:"ChatWebsites",route:"chatWebsite",channel:"chat",translate:"CHAT.CHATWEBSITES",state:"app.chat.chatWebsites",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(502)&&!o.hasRole("admin")}}),s.saveItem("apps.chat.realtime",{id:510,title:"Realtime",route:"",translate:"CHAT.REALTIME",state:"app.chat.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(510)&&!o.hasRole("admin")}}),s.saveItem("apps.mail",{id:600,title:"Mail",translate:"MAIL.MAIL",icon:"icon-email",license:"mail",weight:7,hidden:function(){return!e.mail||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailQueues",{id:601,title:"MailQueues",route:"mailQueue",channel:"mail",translate:"MAIL.MAILQUEUES",state:"app.mail.mailQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(601)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailAccounts",{id:602,title:"MailAccounts",route:"mailAccount",channel:"mail",translate:"MAIL.MAILACCOUNTS",state:"app.mail.mailAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(602)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.mailSubtatuses",{id:603,title:"MailSubstatuses",route:"mailSubstatus",channel:"mail",translate:"MAIL.MAILSUBSTATUSES",state:"app.mail.mailSubtatuses",permissions:{association:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(603)&&!o.hasRole("admin")}}),s.saveItem("apps.mail.realtime",{id:610,title:"Realtime",route:"",translate:"MAIL.REALTIME",state:"app.mail.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(610)&&!o.hasRole("admin")}}),s.saveItem("apps.sms",{id:700,title:"Sms",translate:"SMS.SMS",icon:"icon-message-text",license:"messaging",weight:8,hidden:function(){return!e.messaging||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.sms.smsQueues",{id:701,title:"SmsQueues",route:"smsQueue",channel:"sms",translate:"SMS.SMSQUEUES",state:"app.sms.smsQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(701)&&!o.hasRole("admin")}}),s.saveItem("apps.sms.smsAccounts",{id:702,title:"SmsAccounts",route:"smsAccount",channel:"sms",translate:"SMS.SMSACCOUNTS",state:"app.sms.smsAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(702)&&!o.hasRole("admin")}}),s.saveItem("apps.sms.realtime",{id:710,title:"Realtime",route:"",translate:"SMS.REALTIME",state:"app.sms.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(710)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel",{id:800,title:"Openchannel",translate:"OPENCHANNEL.OPENCHANNEL",icon:"icon-google-earth",license:"openchannel",weight:9,hidden:function(){return!e.openchannel||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.openchannelQueues",{id:801,title:"OpenchannelQueues",route:"openchannelQueue",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELQUEUES",state:"app.openchannel.openchannelQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(801)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.openchannelAccounts",{id:802,title:"OpenchannelAccounts",route:"openchannelAccount",channel:"openChannel",translate:"OPENCHANNEL.OPENCHANNELACCOUNTS",state:"app.openchannel.openchannelAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(802)&&!o.hasRole("admin")}}),s.saveItem("apps.openchannel.realtime",{id:810,title:"Realtime",route:"",translate:"OPENCHANNEL.REALTIME",state:"app.openchannel.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(810)&&!o.hasRole("admin")}}),s.saveItem("apps.fax",{id:900,title:"Fax",translate:"FAX.FAX",icon:"icon-deskphone",license:"fax",weight:10,hidden:function(){return!e.fax||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.fax.faxQueues",{id:901,title:"FaxQueues",route:"faxQueue",channel:"fax",translate:"FAX.FAXQUEUES",state:"app.fax.faxQueues",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(901)&&!o.hasRole("admin")}}),s.saveItem("apps.fax.faxAccounts",{id:902,title:"FaxAccounts",route:"faxAccount",channel:"fax",translate:"FAX.FAXACCOUNTS",state:"app.fax.faxAccounts",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(902)&&!o.hasRole("admin")}}),s.saveItem("apps.fax.realtime",{id:910,title:"Realtime",route:"",translate:"FAX.REALTIME",state:"app.fax.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(910)&&!o.hasRole("admin")}}),s.saveItem("apps.tools",{id:1e3,title:"Tools",translate:"TOOLS.TOOLS",icon:"icon-auto-fix",weight:13,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.tools.cannedAnswers",{id:1001,title:"CannedAnswers",route:"cannedAnswer",translate:"TOOLS.CANNEDANSWERS",state:"app.tools.cannedAnswers",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1001)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.dispositions",{id:1002,title:"Dispositions",route:"disposition",translate:"TOOLS.DISPOSITIONS",state:"app.tools.dispositions",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1002)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.customDashboards",{id:1003,title:"CustomDashboards",route:"dashboard",translate:"TOOLS.CUSTOMDASHBOARDS",state:"app.tools.customDashboards",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1003)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.intervals",{id:1004,title:"Intervals",route:"interval",translate:"TOOLS.INTERVALS",state:"app.tools.intervals",weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1004)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.pauses",{id:1005,title:"Pauses",route:"pause",translate:"TOOLS.PAUSES",state:"app.tools.pauses",weight:5,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1005)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.schedules",{id:1006,title:"Scheduler",route:"schedule",translate:"TOOLS.SCHEDULER",state:"app.tools.schedules",weight:6,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1006)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.sounds",{id:1007,title:"Sounds",route:"sound",translate:"TOOLS.SOUNDS",state:"app.tools.sounds",weight:7,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1007)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.tags",{id:1008,title:"Tags",route:"tag",translate:"TOOLS.TAGS",state:"app.tools.tags",weight:8,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1008)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.templates",{id:1009,title:"Templates",route:"template",translate:"TOOLS.TEMPLATES",state:"app.tools.templates",weight:9,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1009)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.triggers",{id:1010,title:"Triggers",route:"trigger",translate:"TOOLS.TRIGGERS",state:"app.tools.triggers",weight:10,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1010)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.trunks",{id:1011,title:"Trunks",route:"trunk",translate:"TOOLS.TRUNKS",state:"app.tools.trunks",weight:11,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1011)&&!o.hasRole("admin")}}),s.saveItem("apps.tools.variables",{id:1012,title:"Variables",route:"variable",translate:"TOOLS.VARIABLES",state:"app.tools.variables",weight:12,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1012)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare",{id:1100,title:"CallySquare",translate:"CALLYSQUARE.CALLYSQUARE",icon:"icon-sitemap",license:"voice",weight:11,hidden:function(){return!e.voice||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.odbcs",{id:1101,title:"ODBC",route:"squareOdbc",translate:"CALLYSQUARE.ODBC",state:"app.callysquare.odbcs",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1101)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.squareRecordings",{id:1102,title:"SquareRecordings",route:"squareRecording",translate:"CALLYSQUARE.SQUARERECORDINGS",state:"app.callysquare.squareRecordings",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1102)&&!o.hasRole("admin")}}),s.saveItem("apps.callysquare.projects",{id:1103,title:"Projects",route:"squareProject",translate:"CALLYSQUARE.PROJECTS",state:"app.callysquare.projects",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1103)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics",{id:1200,title:"Analytics",translate:"ANALYTICS.ANALYTICS",icon:"icon-chart-line",weight:14,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.metrics",{id:1201,title:"Metrics",route:"analyticMetric",translate:"ANALYTICS.METRICS",state:"app.analytics.metrics",weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1201)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.extractedReports",{id:1202,title:"ExtractedReports",route:"analyticExtractedReport",translate:"ANALYTICS.EXTRACTEDREPORTS",state:"app.analytics.extractedReports",weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1202)&&!o.hasRole("admin")}}),s.saveItem("apps.analytics.reports",{id:1203,title:"Reports",route:"",translate:"ANALYTICS.REPORTS",state:"app.analytics.reports",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1203)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations",{id:1300,title:"Integrations",translate:"INTEGRATIONS.INTEGRATIONS",icon:"icon-heart",weight:15,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.zendeskAccounts",{id:1301,title:"ZendeskAccounts",route:"intZendeskAccount",translate:"INTEGRATIONS.ZENDESKACCOUNTS",state:"app.integrations.zendeskAccounts",permissions:{association:!1,loading:!0},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1301)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.salesforceAccounts",{id:1302,title:"SalesforceAccounts",route:"intSalesforceAccount",translate:"INTEGRATIONS.SALESFORCEACCOUNTS",state:"app.integrations.salesforceAccounts",permissions:{association:!1,loading:!0},weight:2,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1302)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.freshdeskAccounts",{id:1303,title:"FreshdeskAccounts",route:"intFreshdeskAccount",translate:"INTEGRATIONS.FRESHDESKACCOUNTS",state:"app.integrations.freshdeskAccounts",permissions:{association:!1,loading:!0},weight:3,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1303)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.sugarcrmAccounts",{id:1305,title:"SugarcrmAccounts",route:"intSugarcrmAccount",translate:"INTEGRATIONS.SUGARCRMACCOUNTS",state:"app.integrations.sugarcrmAccounts",permissions:{association:!1,loading:!0},weight:4,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1305)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.deskAccounts",{id:1306,title:"DeskAccounts",route:"intDeskAccount",translate:"INTEGRATIONS.DESKACCOUNTS",state:"app.integrations.deskAccounts",permissions:{association:!1,loading:!0},weight:5,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1306)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.zohoAccounts",{id:1307,title:"ZohoAccounts",route:"intZohoAccount",translate:"INTEGRATIONS.ZOHOACCOUNTS",state:"app.integrations.zohoAccounts",permissions:{association:!1,loading:!0},weight:6,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1307)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.vtigerAccounts",{id:1308,title:"VtigerAccounts",route:"intVtigerAccount",translate:"INTEGRATIONS.VTIGERACCOUNTS",state:"app.integrations.vtigerAccounts",permissions:{association:!1,loading:!0},weight:7,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1308)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.dynamics365Accounts",{id:1309,title:"Dynamics365Accounts",route:"intDynamics365Account",translate:"INTEGRATIONS.DYNAMICS365ACCOUNTS",state:"app.integrations.dynamics365Accounts",permissions:{association:!1,loading:!0},weight:8,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1309)&&!o.hasRole("admin")}}),s.saveItem("apps.integrations.servicenowAccounts",{id:1310,title:"ServicenowAccounts",route:"intServicenowAccount",translate:"INTEGRATIONS.SERVICENOWACCOUNTS",state:"app.integrations.servicenowAccounts",permissions:{association:!1,loading:!0},weight:9,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1310)&&!o.hasRole("admin")}}),s.saveItem("apps.settings",{id:1400,title:"Settings",translate:"SETTINGS.SETTINGS",icon:"icon-cog",permissions:{hidden:!0},weight:18,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.generals",{id:1401,title:"General",route:"setting",translate:"SETTINGS.GENERAL",state:"app.settings.generals",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.smtps",{id:1402,title:"Smtp",route:"mailAccount",translate:"SETTINGS.SMTP",state:"app.settings.smtps",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.networks",{id:1403,title:"Networks",route:"network",translate:"SETTINGS.NETWORKS",state:"app.settings.networks",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.customizations",{id:1407,title:"Customizations",route:"setting",translate:"SETTINGS.CUSTOMIZATIONS",state:"app.settings.customizations",weight:1,hidden:function(){return!e.custom||o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.updates",{id:1404,title:"Updates",route:"",translate:"SETTINGS.UPDATES",state:"app.settings.updates",weight:1,hidden:function(){return!e.update||o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.license",{id:1405,title:"License",route:"",translate:"SETTINGS.LICENSE",state:"app.settings.license",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.settings.system",{id:1406,title:"System",route:"",translate:"SETTINGS.SYSTEM",state:"app.settings.system",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1400)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer",{id:1500,title:"MotionDialer",translate:"MOTIONDIALER.MOTIONDIALER",icon:"icon-fire",license:"dialer",weight:5,hidden:function(){return!e.dialer||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.queueCampaigns",{id:1501,title:"QueueCampaigns",route:"voiceQueue",channel:"bull",translate:"MOTIONDIALER.QUEUECAMPAIGNS",state:"app.motiondialer.queueCampaigns",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1501)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.ivrCampaigns",{id:1502,title:"IvrCampaigns",route:"campaign",translate:"MOTIONDIALER.IVRCAMPAIGNS",state:"app.motiondialer.ivrCampaigns",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1502)&&!o.hasRole("admin")}}),s.saveItem("apps.motiondialer.realtime",{id:1510,title:"Realtime",route:"",translate:"MOTIONDIALER.REALTIME",state:"app.motiondialer.realtime",permissions:{association:!1,crud:!1},weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1510)&&!o.hasRole("admin")}}),s.saveItem("apps.help",{id:1600,title:"Help",translate:"HELP.HELP",icon:"icon-help",permissions:{association:!1},weight:19,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1600)&&!o.hasRole("admin")}}),s.saveItem("apps.help.about",{id:1601,title:"About",route:"",translate:"HELP.ABOUT",state:"app.help.about",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1600)&&!o.hasRole("admin")}}),s.saveItem("apps.jscripty",{id:1700,title:"jscripty",translate:"JSCRIPTY.JSCRIPTY",icon:"icon-script",license:"jscripty",weight:12,hidden:function(){return!e.jscripty||o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.jscripty.projects",{id:1701,title:"Projects",route:"jscriptyProject",translate:"JSCRIPTY.PROJECTS",state:"app.jscripty.projects",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1701)&&!o.hasRole("admin")}}),s.saveItem("apps.marketplace",{id:1800,title:"Marketplace",translate:"MARKETPLACE.MARKETPLACE",icon:"icon-cart",weight:16,hidden:function(){return o.hasRole("agent")||!o.hasChildrenPermissions(u(this))&&!o.hasRole("admin")}}),s.saveItem("apps.marketplace.plugins",{id:1801,title:"Plugins",route:"plugin",translate:"MARKETPLACE.PLUGINS",state:"app.marketplace.plugins",weight:1,hidden:function(){return o.hasRole("agent")||!o.hasPermission(1801)&&!o.hasRole("admin")}}),s.sort(),a.saveItem("apps",{title:"APPS",group:!0,weight:1}),a.saveItem("apps.home",{id:100,title:"Home",translate:"DASHBOARDS.HOME",icon:"icon-home",weight:1}),a.saveItem("apps.home.dashboard",{id:101,title:"Dashboard",translate:"DASHBOARDS.DASHBOARD",state:"dashboard",view:"dashboard",icon:"icon-tile-four",iconClass:"cyan-500-fg",weight:1,hidden:function(){return!o.hasPermission(101)}}),a.saveItem("apps.home.contacts",{id:102,title:"Contacts",translate:"DASHBOARDS.CONTACTS",state:"contacts",view:"contacts",icon:"icon-account-circle",iconClass:"red-fg",weight:2,hidden:function(){return!e.cm||!o.hasPermission(102)}}),a.saveItem("apps.home.mycontacts",{id:103,title:"Contacts",translate:"DASHBOARDS.MYCONTACTS",state:"mycontacts",view:"mycontacts",icon:"icon-account-multiple",iconClass:"red-fg",weight:3,hidden:function(){return!e.cm||!o.hasPermission(103)}}),a.saveItem("apps.home.scheduled",{id:113,title:"Scheduled Calls",translate:"DASHBOARDS.SCHEDULED_CALLS",state:"scheduled",view:"scheduled",icon:"icon-calendar-clock",iconClass:"blue-grey-fg",weight:3,hidden:function(){return!e.dialer||!o.hasPermission(113)}}),a.saveItem("apps.home.voice",{id:110,title:"Voice",translate:"DASHBOARDS.VOICE",state:"voice",view:"voice",icon:"icon-phone",iconClass:"blue-A700-fg",weight:4,hidden:function(){return!e.voice||!o.hasPermission(110)}}),a.saveItem("apps.home.abandoned",{id:111,title:"Abandoned",translate:"DASHBOARDS.ABANDONED",state:"abandoned",view:"abandoned",icon:"icon-phone-missed",iconClass:"blue-fg",weight:5,hidden:function(){return!e.voice||!o.hasPermission(111)}}),a.saveItem("apps.home.recordings",{id:104,title:"Recordings",translate:"DASHBOARDS.RECORDINGS",state:"recordings",view:"recordings",icon:"icon-audiobook",iconClass:"indigo-A100-fg",weight:6,hidden:function(){return!e.voice||!o.hasPermission(104)}}),a.saveItem("apps.home.chat",{id:105,title:"Chat",translate:"DASHBOARDS.CHAT",state:"chat",view:"chat",icon:"icon-hangouts",iconClass:"green-A700-fg",weight:7,hidden:function(){return!e.chat||!o.hasPermission(105)}}),a.saveItem("apps.home.mail",{id:106,title:"Mail",translate:"DASHBOARDS.MAIL",state:"mail",view:"mail",icon:"icon-email",iconClass:"teal-fg",weight:8,hidden:function(){return!e.mail||!o.hasPermission(106)}}),a.saveItem("apps.home.sms",{id:107,title:"Sms",translate:"DASHBOARDS.SMS",state:"sms",view:"sms",icon:"icon-message-text",iconClass:"orange-fg",weight:9,hidden:function(){return!e.messaging||!o.hasPermission(107)}}),a.saveItem("apps.home.openchannel",{id:108,title:"Openchannel",translate:"DASHBOARDS.OPENCHANNEL",state:"openchannel",view:"openchannel",icon:"icon-google-earth",iconClass:"amber-A200-fg",weight:10,hidden:function(){return!e.openchannel||!o.hasPermission(108)}}),a.saveItem("apps.home.fax",{id:109,title:"Fax",translate:"DASHBOARDS.FAX",state:"fax",view:"fax",icon:"icon-deskphone",iconClass:"blue-grey-A200-fg",weight:11,hidden:function(){return!e.fax||!o.hasPermission(109)}}),t.$on("$viewContentAnimationEnded",function(e){e.targetScope.$id===t.$id&&n.$broadcast("msSplashScreen::remove")})}e.$inject=["$scope","$rootScope","msNavigationService","msNavigationAgentService","Auth","license","api","setting"],angular.module("motion").controller("MainController",e)}(),function(){"use strict";function e(e,t,n,a,o,r){var i=this;function s(e){if(e&&e.id){var t=99999+e.id;o.saveItem("apps.dashboards.custom_"+t,{id:t,title:e.name||"NONAME",state:"app.dashboards.custom",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(t)&&!r.hasRole("admin")}})}}function l(e){if(e&&e.id&&"never"!=e.sidebar)if(e.active){if("always"==e.sidebar||"adminOnly"==e.sidebar){o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return r.hasRole("agent")||!r.hasPermission(1900)&&!r.hasRole("admin")}});var t=88888+e.id;o.saveItem("apps.plugins.plugin_"+t,{id:t,title:e.name||"NONAME",state:"app.plugins.plugin",stateParams:e,weight:2,hidden:function(){return r.hasRole("agent")||!r.hasPermission(t)&&!r.hasRole("admin")}}),o.sort()}}else{t=88888+e.id;n=1900,a=t,i=o.getNavigation(),(s=_.find(i[0].children,{id:n}))&&_.some(s.children,{id:a})&&("always"==e.sidebar||"adminOnly"==e.sidebar)&&(o.deleteItem("apps.plugins.plugin_"+t),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}var n,a,i,s}function d(e){var t=o.getNavigation(),n=_.find(t[0].children,{id:e});return!!(n&&0<n.children.length)}i.bodyEl=angular.element("body"),i.msScrollOptions={suppressScrollX:!0},i.setting=n,i.$onInit=function(){i.folded="true"===t.get("motion.folded")||!1},i.toggleMsNavigationFolded=function(){i.folded=!i.folded,t.put("motion.folded",i.folded)},i.getLogo=function(){return i.setting.defaultHeaderWhiteLabel?"xCALLY Motion":i.setting.headerWhiteLabel},a.on("dashboard:save",s),a.on("dashboard:update",s),a.on("dashboard:remove",function(e){if(e&&e.id){var t=99999+e.id;o.deleteItem("apps.dashboards.custom_"+t)}}),a.on("plugin:save",l),a.on("plugin:update",l),a.on("plugin:remove",function(e){if(e&&e.id&&"never"!=e.sidebar){var t=88888+e.id;"always"!=e.sidebar&&"adminOnly"!=e.sidebar||(o.deleteItem("apps.plugins.plugin_"+t),d(1900)||o.saveItem("apps.plugins",{id:1900,title:"Plugins",translate:"PLUGINS.PLUGINS",icon:"icon-apps",weight:17,hidden:function(){return!0}}))}}),e.$on("$stateChangeSuccess",function(){i.bodyEl.removeClass("ms-navigation-horizontal-mobile-menu-active")})}e.$inject=["$scope","$cookies","setting","socket","msNavigationService","Auth"],angular.module("app.navigation").controller("NavigationController",e)}(),function(){"use strict";function e(e,a,i,t,n,s,o,r){var l=this;function d(n){o.isSupported()?o.requestPermission().then(function(){var e,t;t={autoClose:!0,duration:10,showOnPageHidden:!0,icon:"api/users/"+(e=n).FromId+"/avatar",body:e.body||"",focusOnclick:!0,closeOnClick:!0},o.show(a.instant("QUICKPANEL.NEW_INTERNAL_MESSAGE"),t)},function(e){console.error("Please enable browser notifications!",e)}):console.error("Browser notifications are not supported by the browser. Normal notifications will be used.")}l.date=moment().format(),l.currentUser=t.getCurrentUser(),l.license=r,l.unreadTotalMessages=0,l.unreadTotalGroupMessages=0,l.userIsNotPhonebar=function(){return"admin"===l.currentUser.role||"user"===l.currentUser.role||"agent"===l.currentUser.role&&0!==l.currentUser.showWebBar},l.onMessageSave=function(e){e.ToId===l.currentUser.id&&e.FromId!==l.currentUser.id&&!e.read&&e.ChatGroupId&&(l.unreadTotalGroupMessages++,d(e));e.ToId!==l.currentUser.id||e.ChatGroupId||(l.unreadTotalMessages+=1,d(e))},l.onMessageUpdate=function(e){e.ToId===l.currentUser.id&&e.read&&0<l.unreadTotalMessages&&!e.ChatGroupId&&(l.unreadTotalMessages-=1);e.ToId==l.currentUser.id&&e.FromId!==l.currentUser.id&&e.ChatGroupId&&e.read&&0<l.unreadTotalGroupMessages&&l.unreadTotalGroupMessages--},n.on("chatInternalMessage:save",l.onMessageSave),n.on("chatInternalMessage:update",l.onMessageUpdate),s.chatInternalMessage.get({fields:"FromId",ToId:l.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){return e&&e.count&&(l.unreadTotalMessages=e.count),s.user.getGroups({id:l.currentUser.id}).$promise}).then(function(e){for(var t=[],n=e.rows,a=0;a<n.length;a++)t.push(s.chatGroup.getUnread({id:n[a].id}).$promise);return i.all(t)}).then(function(e){for(var t=0;t<e.length;t++)l.unreadTotalGroupMessages+=e[t].count}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){n.removeAllListeners("chatInternalMessage:save"),n.removeAllListeners("chatInternalMessage:update")})}e.$inject=["$scope","$translate","$q","Auth","socket","api","desktopNotification","license"],angular.module("app.quick-panel").controller("QuickPanelController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l,d,c,m){var u=this;function p(e){var t=angular.element("#chat-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}function g(e){return _.isNil(e)?"":e.replace(/[^\w.+#*\-]+/g,"")}function v(e){return m.get(e).success(function(){t.success({title:"Successful call",msg:"Call properly handled!"})}).error(function(e){t.error({title:"PhoneBar API Error",msg:d.instant("CONTACTMANAGER.ERRORS.PHONEBAR_API")})})}u.currentUser=i.getCurrentUser(),u.user=void 0,u.users={count:0,rows:[]},u.standardDate=moment(0).format("YYYY-MM-DD HH:mm:ss"),u.unreadMessage={},u.replyMessage="",u.disabled=!1,u.init=function(e){u.license=e},u.toggleChat=function(e){if(e){if(!e.allowmessenger&&"agent"===e.role)return t.warning({title:d.instant("QUICKPANEL.WARNING"),msg:d.instant("QUICKPANEL.MESSENGER_DISABLED")}),void(u.user=void 0);u.user=e,u.replyMessage="",n.chatInternalMessage.get({sort:"createdAt",FromId:u.currentUser.id+","+e.id,ToId:u.currentUser.id+","+e.id,ChatGroupId:"null"}).$promise.then(function(e){if(e&&e.rows){u.user.messages=e;for(var t=0;t<u.user.messages.rows.length;t+=1)!1===u.user.messages.rows[t].read&&u.user.messages.rows[t].ToId===u.currentUser.id&&n.chatInternalMessage.update({id:u.user.messages.rows[t].id,read:!0})}}).finally(function(){p(0)})}else u.user=void 0},u.reply=function(){u.disabled=!0;Date.now();if(""===u.replyMessage)return void(u.disabled=!1);var e={FromId:u.currentUser.id,ToId:u.user.id,body:u.replyMessage,read:!1};u.replyMessage="",n.chatInternalMessage.save(e).$promise.then(function(e){u.user.messages.rows.push(e),u.user.lastMessageAt=e.createdAt,u.user.lastMessage=e,p(400)}).catch(function(e){}).finally(function(){u.disabled=!1})},u.onMessageSave=function(e){if(e.ToId===u.currentUser.id&&!e.ChatGroupId){u.user&&u.user.id===e.FromId?(u.user.messages.rows.push(e),p(0),n.chatInternalMessage.update({id:e.id,read:!0})):u.unreadMessage[e.FromId]=u.unreadMessage[e.FromId]?u.unreadMessage[e.FromId]+1:1;var t=_.find(u.users.rows,{id:e.FromId});t&&(t.lastMessageAt=e.createdAt,t.lastMessage=e)}},u.onMessageUpdate=function(e){if((e.FromId===u.currentUser.id||e.ToId===u.currentUser.id)&&!e.ChatGroupId){if(u.user){var t=_.find(u.user.messages.rows,{id:e.id});t&&_.merge(t,e)}var n=_.find(u.users.rows,{id:u.currentUser.id===e.FromId?e.ToId:e.FromId});n&&n.lastMessage&&_.merge(n.lastMessage,e),e.ToId===u.currentUser.id&&e.read&&0<u.unreadMessage[e.FromId]&&(u.unreadMessage[e.FromId]-=1)}},u.onUserUpdate=function(e){var t=_.find(u.users.rows,{id:e.id});t&&(_.isNil(e.online)||t.online===e.online||(t.online=e.online),_.isNil(e.allowmessenger)||t.allowmessenger===e.allowmessenger||(t.allowmessenger=e.allowmessenger))},u.webcall=function(e){c.$broadcast("webrtc::call",{target:g(e)})},u.call=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/originate/"+g(e))},u.transfer=function(e){return v("http://127.0.0.1:"+(u.user.phoneBarRemoteControlPort||"9888")+"/api/transfer?number="+g(e))},s.on("chatInternalMessage:save",u.onMessageSave),s.on("chatInternalMessage:update",u.onMessageUpdate),s.on("user:update",u.onUserUpdate),o("quick-panel").onClose(function(){u.user=void 0}),n.chatInternalMessage.get({fields:"FromId",ToId:u.currentUser.id,read:!1,nolimit:!0,ChatGroupId:"null"}).$promise.then(function(e){u.unreadMessage=_.countBy(e.rows,"FromId")}).catch(function(e){}),n.chatInternalMessage.getUsers().$promise.then(function(e){u.users=e}).catch(function(e){console.error(e)}),e.$on("$destroy",function(){s.removeAllListeners("chatInternalMessage:save"),s.removeAllListeners("chatInternalMessage:update"),s.removeAllListeners("user:update")})}e.$inject=["$scope","toasty","api","$timeout","Auth","socket","$mdSidenav","$q","$interval","$translate","$rootScope","$http"],angular.module("app.quick-panel").controller("ChatInternalController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r,l){var d=this;function c(e){a.hide(e)}d.errors=[],d.title="QUICKPANEL.EDIT_CHATGROUP",d.group=angular.copy(r),d.currentUser=o.getCurrentUser(),d.members=l,d.newChatGroup=!0,d.group||(d.group={write:!0,members:[]},d.title="QUICKPANEL.NEW_CHATGROUP"),d.saveChatGroup=function(){var n;return d.errors=[],s.chatGroup.save({name:d.group.name,write:d.group.write}).$promise.then(function(e){var t=_.map(d.group.members,"id");return t.unshift(d.currentUser.id),n=e,s.chatGroup.addMembers({id:n.id,ids:t}).$promise}).then(function(){i.success({title:"Group properly saved!",msg:n.name+" has been saved!"}),c(n)}).catch(function(e){i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatQueue.update",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},d.closeDialog=c,d.querySearch=function(e){return e?d.members.rows.filter((t=e,n=angular.lowercase(t),function(e){var t=e.name.toLowerCase();return-1!=t.indexOf(n)})):[];var t,n}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","group","members"],angular.module("app.quick-panel").controller("CreateOrEditChatGroupDialogController",e)}(),function(){"use strict";function e(e,n,a,s,t,o,i,r,l,d){var c=this;function m(){delete c.group}function u(e){var t=angular.element("#chat-group-dialog");a(function(){t.animate({scrollTop:t[0].scrollHeight},e)},0)}c.currentUser=i.getCurrentUser(),c.unreadGroupMessages={},c.groups={},c.participants,c.group,c.init=function(e){return c.license=e,r.user.getGroups({id:c.currentUser.id}).$promise.then(function(e){for(var t=0,n=[];t<e.rows.length;t++)e.rows[t].unreadGroupMessages=0,c.groups[e.rows[t].id]=e.rows[t],n.push(r.chatGroup.getUnread({id:e.rows[t].id}).$promise);return o.all(n)}).then(function(e){for(var t=0;t<e.length;t++)c.groups[e[t].id].unreadGroupMessages+=e[t].count}).catch(function(e){console.error(e)})},c.back=m,c.addGroup=function(e,t){s.show({controller:"CreateOrEditChatGroupDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/create/dialog.html",parent:angular.element(n.body),targetEvent:t,clickOutsideToClose:!0,locals:{group:e,me:c.currentUser,license:null,setting:null},resolve:{members:function(){return i.hasRole("admin")?r.user.get({role:"agent"}).$promise:r.userProfile.getResources({id:i.getCurrentUser().userProfileId,section:"Agents",role:"agent"}).$promise}}}).then(function(e){e&&(c.groups[e.id]=e)}).catch(function(e){e&&console.error(e.message)})},c.deleteGroup=function(e,t){var n=s.confirm().title("Are you sure want to delete the selected group?").htmlContent("Group <b>"+e.name+"</b> will be deleted.").ariaLabel("delete Group").targetEvent(t).ok("OK").cancel("CANCEL");s.show(n).then(function(){return r.chatGroup.delete({id:e.id}).$promise}).then(function(){delete c.groups[e.id],d.success({title:"Group properly deleted!",msg:e.name+" has been deleted!"})}).catch(function(e){e&&d.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.chatGroup.delete",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},c.groupsToArray=function(){return _.values(c.groups)},c.showMessageInfo=function(e,i){s.show({controller:"ShowMessageInfoDialogController",controllerAs:"vm",templateUrl:"app/quick-panel/tabs/groups/info/dialog.html",parent:angular.element(n.body),targetEvent:e,clickOutsideToClose:!0,locals:{message:i},resolve:{data:function(){var a={messages:[]};return r.chatInternalMessage.get({ChatInternalMessageId:i.id}).$promise.then(function(e){var t=[];a.messages=e.rows,a.messages.unshift(i);for(var n=0;n<a.messages.length;n++)t.push(r.user.get({id:a.messages[n].ToId,fields:"id,name,fullname,userpic"}).$promise);return o.all(t)}).then(function(e){return a.users=e,a}).catch(function(e){e&&console.error(e)})}}}).then(function(){}).catch(function(e){e&&console.error(e.message)})},c.toggleChat=function(t){c.group={id:t.id,write:t.write,messages:{}},r.chatGroup.getMembers({id:t.id,fields:"id,name,fullname"}).$promise.then(function(e){return c.group.membersByKeys=_.keyBy(e.rows,"id"),c.group.members=_.differenceBy(e.rows,[{id:c.currentUser.id}],"id"),c.participants=_.map(c.group.members,"fullname").join(", "),r.chatGroup.getMessages({id:t.id,nolimit:!0}).$promise}).then(function(e){for(var t,n=0,a=[];n<e.count;n++)e.rows[n].ToId===c.currentUser.id&&(t=e.rows[n],c.group.messages[t.id]=t,e.rows[n].ToId!=c.currentUser.id||e.rows[n].FromId===c.currentUser.id||t.read||a.push(r.chatInternalMessage.update({id:t.id,read:!0})));return o.all(a)}).then(function(){u(400)}).catch(function(e){console.error(e.message)})},c.reply=function(){if(!c.replyMessage)return;var n={id:c.group.id,FromId:c.currentUser.id,ToId:c.currentUser.id,body:c.replyMessage,read:!0},a=[];c.replyMessage="",r.chatGroup.addMessage(n).$promise.then(function(e){n.read=!1,n.ChatInternalMessageId=e.id;for(var t=0;t<c.group.members.length;t++)c.group.members[t].id!==c.currentUser.id&&(n.ToId=c.group.members[t].id,a.push(r.chatGroup.addMessage(angular.copy(n)).$promise));return o.all(a)}).catch(function(e){console.log(e)})},l.on("chatInternalMessage:save",function(t){if(!c.group&&t.ToId===c.currentUser.id&&t.FromId!==c.currentUser.id&&!t.read&&t.ChatGroupId){var e=c.groups[t.ChatGroupId];if(!e)return r.chatGroup.get({id:t.ChatGroupId}).$promise.then(function(e){e.unreadGroupMessages=1,c.groups[e.id]=e});e.unreadGroupMessages||(e.unreadGroupMessages=0),e.unreadGroupMessages++}c.group&&t.ChatGroupId===c.group.id&&t.ToId===c.currentUser.id&&r.chatInternalMessage.update({id:t.id,read:!0}).$promise.then(function(){var e;e=t,c.group.messages[e.id]=e,u(400)})}),l.on("chatInternalMessage:update",function(e){e.ToId==c.currentUser.id&&e.FromId!==c.currentUser.id&&e.ChatGroupId&&e.read&&(0<c.groups[e.ChatGroupId].unreadGroupMessages&&c.groups[e.ChatGroupId].unreadGroupMessages--,c.group.messages[e.id]&&(c.group.messages[e.id].read=!0))}),l.on("chatGroup:remove",function(e){c.groups[e.id]&&delete c.groups[e.id]}),t("quick-panel").onClose(m),e.$on("$destroy",function(){l.removeAllListeners("chatInternalMessage:save"),l.removeAllListeners("chatInternalMessage:update"),l.removeAllListeners("chatGroup:remove")})}e.$inject=["$scope","$document","$timeout","$mdDialog","$mdSidenav","$q","Auth","api","socket","toasty"],angular.module("app.quick-panel").controller("ChatGroupController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){this.data=r,this.title="QUICKPANEL.INFO",this.closeDialog=function(){a.hide()}}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","Auth","data"],angular.module("app.quick-panel").controller("ShowMessageInfoDialogController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;o.form={token:s.token},o.setting={},o.resetPassword=function(){return i.auth.reset(o.form).$promise.then(function(){t.success({title:n.instant("RESETPASSWORD.PASSWORD_RESET"),msg:n.instant("RESETPASSWORD.PASSWORD_RESET_MESSAGE")}),a.go("app.login")}).catch(function(e){e&&t.error({title:n.instant("RESETPASSWORD.PASSWORD_RESET_ERROR"),msg:e.data?e.data.message||e.message||e:e.message||e})})},o.onInit=function(){e.isLoggedIn()&&a.go("app.dashboards.general");return i.setting.gdpr({id:1}).$promise.then(function(e){o.setting=e,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:""}).catch(function(e){e&&t.error({title:"Error",msg:e.data?e.data.message||e.message||e:e.message||e})})}}e.$inject=["Auth","toasty","$translate","$state","api","$stateParams"],angular.module("app.reset").controller("ResetPasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s){var o=this;function r(){e.hide()}o.errors=[],o.user=a,o.setting=i,o.reset=s,o.passwordPattern=o.setting.securePassword?/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/:"",o.savePassword=function(){o.errors=[],n.user.changePassword({id:o.user.id},{oldPassword:o.oldPassword,newPassword:o.password}).$promise.then(function(){t.show(t.simple().textContent("Your password properly updated").position("top right").hideDelay(5e3)),r()}).catch(function(e){console.error(e),o.errors=e.data.errors&&e.data.errors.length?e.data.errors:[{message:e.data.message||"Authorization error",type:"api.user.changePassword"}]})},o.closeDialog=r}e.$inject=["$mdDialog","$mdToast","api","user","setting","reset"],angular.module("app.toolbar").controller("ChangePasswordController",e)}(),function(){"use strict";function e(e,t,n,a,i,s,o,r){var l=this;function d(e){_.isNil(e)&&s.cmHopper.update({id:l.preview.id,UserId:null}),a.hide()}l.customFieldsMap=r&&r.rows?_.mapValues(_.keyBy(r.rows,function(e){return"cf_"+e.id}),"name"):{},l.errors=[],l.hopperIds=[],l.preview=o,l.originated=!1,l.disable=!1,l.disableGetContact=!1,l.hopperIds.push(l.preview.id),l.originatePreview=function(){l.originated=!0,l.disable=!0,_.isEmpty(l.preview)?(i.error({title:"Message",msg:"Contact not available"}),l.disable=!1,l.hopperIds=[],d(!0)):s.rpc.getVoiceQueuesPreview({id:l.preview.id}).$promise.then(function(e){d(!0)}).catch(function(e){i.error({title:"Message",msg:e.data}),d(!0)}).finally(function(){l.disable=!1,l.hopperIds=[]})},l.closeDialog=d,l.nextContact=function(){return l.disableGetContact=!0,s.cmHopper.getPreview({hopperIds:l.hopperIds,direction:"next"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(l.disableGetContact=!1,l.hopperIds=[],404===e.status)l.getFirstAvailableContact();else if(e.data&&e.data.errors&&e.data.errors.length){a.hide();for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})},l.previousContact=function(){if(l.disableGetContact=!0,1<l.hopperIds.length){var e=_.without(l.hopperIds,l.preview.id);return s.cmHopper.getPreview({hopperIds:e,direction:"prev"}).$promise.then(function(e){l.disableGetContact=!1,_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(l.hopperIds=[],a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(_.remove(l.hopperIds,function(e){return e==l.preview.id}),l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e)}).catch(function(e){if(404===e.status)l.hopperIds=[l.preview.id],i.info({title:"PREVIEW",msg:"PREVIOUS CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){l.hopperIds=[],a.hide();for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else l.hopperIds=[],a.hide(),i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})})}},l.getFirstAvailableContact=function(){return l.disableGetContact=!0,i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE. REWINDING THE LIST"}),s.cmHopper.getPreview({hopperIds:[l.preview.id],direction:"next"}).$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?(a.hide(),i.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"})):(l.originated||s.cmHopper.update({id:l.preview.id,UserId:null}),l.preview=e,l.hopperIds.push(l.preview.id))}).catch(function(e){if(a.hide(),404===e.status)i.info({title:"PREVIEW",msg:"CONTACTS NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length)for(var t=0;t<e.data.errors.length;t+=1)i.error({title:e.data.errors[t].type,msg:e.data.errors[t].message});else i.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api preview",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){l.disableGetContact=!1})},l.isCustomField=function(e){return _.startsWith(e,"cf_")},l.isHiddenField=function(e){return _.includes(["Company","CompanyId","ListId","UserId","createdAt","deletedAt","id","priority","scheduledat","tags","updatedAt","facebook","twitter","skype","wechat","teams","viber","line","telegram"],e)},l.isNil=function(e){return _.isNil(e)},e.$on("$destroy",function(){l.originated||s.cmHopper.update({id:l.preview.id,UserId:null})})}e.$inject=["$scope","$state","$location","$mdDialog","toasty","api","preview","customFields"],angular.module("app.toolbar").controller("PreviewDialogController",e)}(),function(){"use strict";function e(t,n,s,a,o,e,i,r,l,d,c,m,u,p,g,v,h,f,b,E,A){var y,S=this;S.voiceQueues={},S.polling=!0,n.global={search:""},S.pauses=[],S.license=b,S.currentUser=v.getCurrentUser(),S.unreadTotalMessages=0,S.unreadTotalGroupMessages=0,S.contcts=0,"agent"===S.currentUser.role&&(y=A(function(){_.some(S.voiceQueues,{dialMethod:"preview",dialActive:!0})&&S.license.dialer&&S.polling?(S.polling=!1,f.cmHopper.getOpenContacts().$promise.then(function(e){e&&_.isNumber(e.contacts)&&(S.contacts=e.contacts)}).finally(function(){S.polling=!0})):S.contacts=0},14999)),S.setting=E,S.bodyEl=angular.element("body"),S.conf={realm:"asterisk",host:e.host(),protocol:e.protocol(),remotePlayerId:"remote-audio",ua:"Motion WebRTC Bar 0.2.0",license:S.license.webrtc,phoneBarExpires:S.currentUser.phoneBarExpires,phoneBarPrefixRequired:S.currentUser.phoneBarPrefixRequired},S.query={id:v.getCurrentUser().id,fields:"id,name,type,dialMethod,dialActive",channel:"voice",nolimit:!0},S.userStatusOptions=[{title:"Online",icon:"icon-checkbox-marked-circle",color:"#4CAF50"},{title:"Away",icon:"icon-clock",color:"#FFC107"},{title:"Do not Disturb",icon:"icon-minus-circle",color:"#F44336"},{title:"Invisible",icon:"icon-checkbox-blank-circle-outline",color:"#BDBDBD"},{title:"Offline",icon:"icon-checkbox-blank-circle-outline",color:"#616161"}],S.languages={ar:{title:"Arabic",translation:"TOOLBAR.ARABIC",code:"ar",flag:"ar"},da:{title:"Danish",translation:"TOOLBAR.DANISH",code:"da",flag:"da"},de:{title:"German",translation:"TOOLBAR.GERMAN",code:"de",flag:"de"},en:{title:"English",translation:"TOOLBAR.ENGLISH",code:"en",flag:"us"},es:{title:"Spanish",translation:"TOOLBAR.SPANISH",code:"es",flag:"es"},fa:{title:"Persian",translation:"TOOLBAR.PERSIAN",code:"fa",flag:"fa"},fi:{title:"Finnish",translation:"TOOLBAR.FINNISH",code:"fi",flag:"fi"},fr:{title:"French",translation:"TOOLBAR.FRENCH",code:"fr",flag:"fr"},he:{title:"Hebrew",translation:"TOOLBAR.HEBREW",code:"he",flag:"he"},hi:{title:"Hindi",translation:"TOOLBAR.HINDI",code:"hi",flag:"hi"},id:{title:"Indonesian",translation:"TOOLBAR.INDONESIAN",code:"id",flag:"id"},it:{title:"Italian",translation:"TOOLBAR.ITALIAN",code:"it",flag:"it"},ja:{title:"Japanese",translation:"TOOLBAR.JAPANESE",code:"ja",flag:"ja"},ko:{title:"Korean",translation:"TOOLBAR.KOREAN",code:"ko",flag:"ko"},lv:{title:"Latvian",translation:"TOOLBAR.LATVIAN",code:"lv",flag:"lv"},nl:{title:"Dutch",translation:"TOOLBAR.DUTCH",code:"nl",flag:"nl"},no:{title:"Norwegian",translation:"TOOLBAR.NORWEGIAN",code:"no",flag:"no"},pl:{title:"Polish",translation:"TOOLBAR.POLISH",code:"pl",flag:"pl"},"pt-BR":{title:"Brazilian",translation:"TOOLBAR.BRAZILIAN",code:"pt-BR",flag:"pt-BR"},"pt-PT":{title:"Portuguese",translation:"TOOLBAR.PORTUGUESE",code:"pt-PT",flag:"pt-PT"},ru:{title:"Russian",translation:"TOOLBAR.RUSSIAN",code:"ru",flag:"ru"},sv:{title:"Swedish",translation:"TOOLBAR.SWEDISH",code:"sv",flag:"sv"},tr:{title:"Turkish",translation:"TOOLBAR.TURKISH",code:"tr",flag:"tr"},"zh-CN":{title:"ChineseSimplified",translation:"TOOLBAR.CHINESESIMPLIFIED",code:"zh-CN",flag:"zh-CN"},"zh-TW":{title:"ChineseTraditional",translation:"TOOLBAR.CHINESETRADITIONAL",code:"zh-TW",flag:"zh-TW"}};var T=["ar","fa","he"];function I(e){S.voiceQueues=e?_.keyBy(e.rows?e.rows:[],"id"):{}}function C(){S.promise=f.user.getQueues(S.query,I).$promise}function w(e){return v.logout(e).then(function(){return h.disconnect(),n.$broadcast("webrtc::logout"),a.go("app.login")}).catch(function(e){console.error(e)})}function O(e,t){c.show({controller:"ChangePasswordController",controllerAs:"vm",templateUrl:"app/toolbar/changepassword/changepassword.html",parent:angular.element(m.body),targetEvent:e,clickOutsideToClose:!t,locals:{user:S.user,setting:E,reset:t}})}S.toggleSidenav=function(e){i(e).toggle()},S.logout=w,S.changeLanguage=function(e){if(!S.languages.hasOwnProperty(e.code)){return void l.show({template:'<md-toast id="language-message" layout="column" layout-align="center start"><div class="md-toast-content">Motion supports multiple translations through angular-translate module, but currently we do not support the selected language. If you want to help us, send us a message.</div></md-toast>',hideDelay:7e3,position:"top right",parent:"#content"})}S.selectedLanguage=e,u.put("motion.language",e.code),r.use(e.code),"app.callysquare.projects.edit"===a.current.name&&d.location.reload();0<=T.indexOf(e.code)?p.info({title:r.instant("TOOLBAR.CHANGE_LANGUAGE_TITLE"),msg:r.instant("TOOLBAR.CHANGE_LANGUAGE_MESSAGE")}):t.$parent.$parent.vm.direction="ltr"},S.setUserStatus=function(e){S.userStatus=e},S.toggleHorizontalMobileMenu=function(){S.bodyEl.toggleClass("ms-navigation-horizontal-mobile-menu-active")},S.toggleMsNavigationFolded=function(){g.toggleFolded()},S.search=function(t){for(var e=[],n=g.getFlatNavigation(),a=s.defer(),i=0;i<n.length;i++)n[i].uisref&&e.push(n[i]);t&&(e=e.filter(function(e){if(-1<angular.lowercase(e.title).search(angular.lowercase(t)))return!0}));return o(function(){a.resolve(e)},1e3),a.promise},S.searchResultClick=function(e){e.uisref&&(e.stateParams?a.go(e.state,e.stateParams):a.go(e.state))},S.openSettings=function(e){n.$broadcast("webrtc::settings")},S.changePassword=O,S.isAgent=function(){return v.getCurrentUser()&&v.hasRole("agent")},S.onUserUpdate=function(e){if(e.id===S.user.id)if("agent"===e.role&&_.isBoolean(e.online)&&!e.online)if(0!==S.user.showWebBar){var t=c.confirm().title(r.instant("TOOLBAR.WARNING")+"!").textContent(r.instant("TOOLBAR.SOMEONE_LOGGED_YOU_OUT")).ariaLabel(r.instant("TOOLBAR.WARNING")+"!").ok(r.instant("TOOLBAR.STAY_LOGGED")).cancel("Logout");c.show(t).then(function(){v.queueLogin()}).catch(function(e){w(!0)}).finally(function(){_.merge(S.user,e),v.updateCurrentUser(S.user)})}else w(!0),_.merge(S.user,e),v.updateCurrentUser(S.user);else _.merge(S.user,e),v.updateCurrentUser(S.user)},S.onUserCalled=function(e){2===S.currentUser.showWebBar&&"agent"===S.currentUser.role&&S.currentUser.name===e.membername&&p.info({title:"WebRTC Popup",msg:"<div> <span>Call from: "+e.calleridnum+"</span><br> <span>Queue: "+e.queue+"</span><br> <span>Extra: "+(e.variables&&e.variables.extravar?e.variables.extravar:"Not defined")+"</span><br> </div>",showClose:!0,timeout:1e4,html:!0})},S.pause=function(e){return f.user.pause({id:S.user.id,type:e||"DEFAULT PAUSE"}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:PAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.unpause=function(){return f.user.unpause({id:S.user.id}).$promise.catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:UNPAUSEUSER",msg:e.status?JSON.stringify(e.data):e.toString()})})},S.preview=function(t){return S.disable=!0,f.cmHopper.getPreview().$promise.then(function(e){_.isNil(e)||_.isNil(e.Queue)||!e.Queue.dialActive?p.info({title:"PREVIEW",msg:"CAMPAIGN NOT ACTIVE"}):c.show({controller:"PreviewDialogController",controllerAs:"vm",templateUrl:"app/toolbar/preview/dialog.html",parent:angular.element(m.body),targetEvent:t,clickOutsideToClose:!0,locals:{preview:e},resolve:{customFields:["apiResolver",function(e){return e.resolve("cmCustomField@get",{nolimit:!0})}]}})}).catch(function(e){if(404===e.status)p.info({title:"PREVIEW",msg:"CONTACT NOT AVAILABLE"});else if(e.data&&e.data.errors&&e.data.errors.length){S.errors=e.data.errors||[{message:e.toString(),type:"api.openchannelMessage.accept"}];for(var t=0;t<e.data.errors.length;t+=1)p.error({title:e.data.errors[t].type,msg:e.data.errors[t].message})}else p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"api.openchannelMessage.accept",msg:e.data?JSON.stringify(e.data.message):e.toString()})}).finally(function(){S.disable=!1})},S.getLogo=function(){return S.setting.defaultHeaderWhiteLabel?"xCALLY Motion":S.setting.headerWhiteLabel},S.userIsNotPhonebar=function(){return"admin"===S.currentUser.role||"user"===S.currentUser.role||"agent"===S.currentUser.role&&0!==S.currentUser.showWebBar},S.onInternalMessageSave=function(e){e.ToId!==S.currentUser.id||e.ChatGroupId||(S.unreadTotalMessages+=1);e.ToId===S.currentUser.id&&e.FromId!==S.currentUser.id&&!e.read&&e.ChatGroupId&&S.unreadTotalGroupMessages++},S.onInternalMessageUpdate=function(e){e.ToId===S.currentUser.id&&e.read&&0<S.unreadTotalMessages&&!e.ChatGroupId&&(S.unreadTotalMessages-=1);e.ToId===S.currentUser.id&&e.read&&e.ChatGroupId&&0<S.unreadTotalGroupMessages&&S.unreadTotalGroupMessages--},S.onUserVoiceQueue=function(e){_.toInteger(e.UserId)===v.getCurrentUser().id&&C()},S.onVoiceQueue=function(e){C()},h.connect(),h.on("user:update",S.onUserUpdate),h.on("user:called",S.onUserCalled),h.on("chatInternalMessage:save",S.onInternalMessageSave),h.on("chatInternalMessage:update",S.onInternalMessageUpdate),h.on("userVoiceQueue:save",S.onUserVoiceQueue),h.on("voiceQueue:save",S.onVoiceQueue),h.on("userVoiceQueue:remove",S.onUserVoiceQueue),h.on("voiceQueue:remove",S.onVoiceQueue),h.on("voiceQueue:update",S.onVoiceQueue),function(){S.user=v.getCurrentUser(),S.conf.ha1=S.user.md5secret,S.conf.id=S.user.id,S.conf.name=S.user.name,S.conf.fullname=S.user.fullname,S.conf.internal=S.user.internal,S.conf.recording=S.user.phoneBarEnableRecording,S.conf.autoAnswer=S.user.phoneBarAutoAnswer,S.conf.enableSettings=S.user.phoneBarEnableSettings,S.conf.enableDtmfTone=S.user.phoneBarEnableDtmfTone,S.conf.autoAnswerDelay=S.user.phoneBarAutoAnswerDelay,S.userStatus=S.userStatusOptions[0];var e=u.get("motion.language");e&&S.languages.hasOwnProperty(e)?S.selectedLanguage=S.languages[e]:S.selectedLanguage=S.languages[r.preferredLanguage()];if(f.pause.get({fields:"name",nolimit:!0}).$promise.then(function(e){S.pauses=e.rows?e.rows:[]}).catch(function(e){p.error({title:e.status?"API:"+e.status+" - "+e.statusText:"SYSTEM:GETPAUSES",msg:e.status?JSON.stringify(e.data):e.toString()})}),S.setting.securePassword)if(S.user.passwordResetAt){var t=moment(S.user.passwordResetAt).add(S.setting.passwordExpiresDays||90,"day");moment().isAfter(t)?O(null,!0):moment().add(15,"day").isAfter(t)&&p.warning({title:r.instant("TOOLBAR.WARNING")+"!",msg:r.instant("TOOLBAR.PASSWORD_EXPIRE_REMAINING_DAYS")+": "+Math.ceil(t.diff(moment(),"days",!0)),timeout:2e4})}else O(null,!0)}(),C(),f.chatInternalMessage.get({fields:"FromId",ToId:S.currentUser.id,read:!1,nolimit:!0}).$promise.then(function(e){S.unreadTotalMessages=e.rows.length}),t.$on("$destroy",function(){h.removeAllListeners("user:called"),h.removeAllListeners("user:update"),h.removeAllListeners("chatInternalMessage:save"),h.removeAllListeners("chatInternalMessage:update"),h.removeAllListeners("userVoiceQueue:save"),h.removeAllListeners("voiceQueue:save"),h.removeAllListeners("userVoiceQueue:remove"),h.removeAllListeners("voiceQueue:remove"),h.removeAllListeners("voiceQueue:update"),y&&(A.cancel(y),y=null)})}e.$inject=["$scope","$rootScope","$q","$state","$timeout","$location","$mdSidenav","$translate","$mdToast","$window","$mdDialog","$document","$cookies","toasty","msNavigationService","Auth","socket","api","license","setting","$interval"],angular.module("app.toolbar").controller("ToolbarController",e)}();var urlParams=function(e){var t=new Object,n=e.lastIndexOf("?");if(0<n)for(var a=e.substring(n+1).split("&"),i=0;i<a.length;i++)0<(n=a[i].indexOf("="))&&(t[a[i].substring(0,n)]=a[i].substring(n+1));return t}(window.location.href),t0=new Date,MAX_REQUEST_SIZE=10485760,MAX_WIDTH=12e3,MAX_HEIGHT=12e3,EXPORT_URL="http://exp.draw.io/ImageExport2/export",SHARE_HOST="http://localhost:3000",SAVE_URL="api/square/projects/",VARIABLE_URL="/api/variables",STENCIL_PATH="/assets/plugins/square/stencils",SHAPES_PATH="/assets/plugins/square/shapes",IMAGE_PATH="/assets/plugins/square/images",STYLE_PATH="/assets/plugins/square/styles",CSS_PATH="/assets/plugins/square/styles",OPEN_FORM="api/square/projects/open",TEMPLATE_PATH="/assets/plugins/square/templates",RESOURCES_PATH="/assets/plugins/square/resources",RESOURCE_BASE=RESOURCES_PATH+"/grapheditor",CRUD_PERMISSIONS={readOnly:!1,canEdit:!1,canDelete:!1},tapAndHoldStartsConnection=!0,showConnectorImg=!0,mxLoadResources=!1,mxLanguages=["it","fr","ko","es","sv","ru","de","ja","zh-CN","zh-TW","nl","fi","da","pt-PT","no","hi","tr","fa"],mxLanguage="en",match=document.cookie.match(new RegExp("(^| )motion.language=([^;]+)"));match&&mxLanguages.includes(match[2])&&(mxLanguage=match[2]);var mxBasePath="assets/plugins/mxgraph",mxClient={VERSION:"2.0.0.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/"),IS_OT:navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0,IS_GC:0<=navigator.userAgent.indexOf("Chrome/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/"),NO_FO:0<=navigator.userAgent.indexOf("Firefox/1.")||0<=navigator.userAgent.indexOf("Iceweasel/1.")||0<=navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/1.")||0<=navigator.userAgent.indexOf("Camino/1.")||0<=navigator.userAgent.indexOf("Epiphany/2.")||0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Mozilla/2."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_MAC:0<navigator.userAgent.toUpperCase().indexOf("MACINTOSH"),IS_TOUCH:0<navigator.userAgent.toUpperCase().indexOf("IPAD")||0<navigator.userAgent.toUpperCase().indexOf("IPOD")||0<navigator.userAgent.toUpperCase().indexOf("IPHONE")||0<navigator.userAgent.toUpperCase().indexOf("ANDROID"),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(e,t,n){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+e+'" href="'+t+'" charset="ISO-8859-1" type="text/css"/>');else{var a=n.createElement("link");a.setAttribute("rel",e),a.setAttribute("href",t),a.setAttribute("charset","ISO-8859-1"),a.setAttribute("type","text/css"),n.getElementsByTagName("head")[0].appendChild(a)}},include:function(e){document.write('<script src="'+e+'"><\/script>')},dispose:function(){for(var e=0;e<mxEvent.objects.length;e++)null!=mxEvent.objects[e].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[e])}};if(mxClient.IS_OP&&mxClient.IS_OT?mxClient.CSS_PREFIX="O":mxClient.IS_SF||mxClient.IS_GC?mxClient.CSS_PREFIX="Webkit":mxClient.IS_MT?mxClient.CSS_PREFIX="Moz":mxClient.IS_IE&&9<=document.documentMode&&(mxClient.CSS_PREFIX="ms"),void 0===mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),void 0!==mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",mxClient.language=void 0!==mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),void 0!==mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_IE){if(9<=document.documentMode)mxClient.IS_VML=!1,mxClient.IS_SVG=!0;else{8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"));var ss=document.createStyleSheet();ss.cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}window.attachEvent("onunload",mxClient.dispose)}var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var e=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,t=document.createElement("table");t.setAttribute("width","100%"),t.setAttribute("height","100%");var n=document.createElement("tbody"),a=document.createElement("tr"),i=document.createElement("td");if(i.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",i.appendChild(mxLog.textarea),a.appendChild(i),n.appendChild(a),a=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),a.appendChild(mxLog.td),n.appendChild(a),t.appendChild(n),mxLog.addButton("Info",function(e){mxLog.info()}),mxLog.addButton("DOM",function(e){e=mxUtils.getInnerHtml(document.body),mxLog.debug(e)}),mxLog.addButton("Trace",function(e){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(e){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Show",function(e){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}),mxLog.addButton("Clear",function(e){mxLog.textarea.value=""}),a=n=0,a="number"==typeof window.innerWidth?(n=window.innerHeight,window.innerWidth):(n=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(e,t,Math.max(0,a-320),Math.max(0,n-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode){var s=mxLog.window.getElement();e=function(e,t){mxLog.textarea.style.height=Math.max(0,s.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,e),mxLog.window.addListener(mxEvent.MAXIMIZE,e),mxLog.window.addListener(mxEvent.NORMALIZE,e),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(e,t){var n=document.createElement("button");mxUtils.write(n,e),mxEvent.addListener(n,"click",t),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(e){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(e)},enter:function(e){if(mxLog.TRACE)return mxLog.writeln("Entering "+e),(new Date).getTime()},leave:function(e,t){if(mxLog.TRACE){var n=0!=t?" ("+((new Date).getTime()-t)+" ms)":"";mxLog.writeln("Leaving "+e+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=e,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=e},writeln:function(){for(var e="",t=0;t<arguments.length;t++)e+=arguments[t],t<arguments.length-1&&(e+=" ");mxLog.write(e+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(e){if("object"==typeof e&&null==e[mxObjectIdentity.FIELD_NAME]){var t=mxUtils.getFunctionName(e.constructor);e[mxObjectIdentity.FIELD_NAME]=t+"#"+mxObjectIdentity.counter++}return e[mxObjectIdentity.FIELD_NAME]},clear:function(e){"object"==typeof e&&delete e[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(e){return e=mxObjectIdentity.get(e),this.map[e]},mxDictionary.prototype.put=function(e,t){var n=mxObjectIdentity.get(e),a=this.map[n];return this.map[n]=t,a},mxDictionary.prototype.remove=function(e){e=mxObjectIdentity.get(e);var t=this.map[e];return delete this.map[e],t},mxDictionary.prototype.getKeys=function(){var e,t=[];for(e in this.map)t.push(e);return t},mxDictionary.prototype.getValues=function(){var e,t=[];for(e in this.map)t.push(this.map[e]);return t},mxDictionary.prototype.visit=function(e){for(var t in this.map)e(t,this.map[t])};var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(e){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,e)},getDefaultBundle:function(e,t){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(t)?e+mxResources.extension:null},getSpecialBundle:function(e,t){if(null==mxClient.languages||!this.isLanguageSupported(t)){var n=t.indexOf("-");0<n&&(t=t.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(t)&&t!=mxClient.defaultLanguage?e+"_"+t+mxResources.extension:null},add:function(e,t){if((t=null!=t?t:mxClient.language.toLowerCase())!=mxConstants.NONE){var n=mxResources.getDefaultBundle(e,t);if(null!=n)try{var a=mxUtils.load(n);a.isReady()&&mxResources.parse(a.getText())}catch(e){}if(null!=(n=mxResources.getSpecialBundle(e,t)))try{(a=mxUtils.load(n)).isReady()&&mxResources.parse(a.getText())}catch(e){}}},parse:function(e){if(null!=e){e=e.split("\n");for(var t=0;t<e.length;t++)if("#"!=e[t].charAt(0)){var n=e[t].indexOf("=");if(0<n){var a=e[t].substring(0,n),i=e[t].length;13==e[t].charCodeAt(i-1)&&i--,n=e[t].substring(n+1,i),this.resourcesEncoded?(n=n.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[a]=unescape(n)):mxResources.resources[a]=n}}}},get:function(e,t,n){if(null==(e=mxResources.resources[e])&&(e=n),null!=e&&null!=t){n=[];for(var a=null,i=0;i<e.length;i++){var s=e.charAt(i);"{"==s?a="":null!=a&&"}"==s?(0<=(a=parseInt(a)-1)&&a<t.length&&n.push(t[a]),a=null):null!=a?a+=s:n.push(s)}e=n.join("")}return e}};function mxPoint(e,t){this.x=null!=e?e:0,this.y=null!=t?t:0}function mxRectangle(e,t,n,a){mxPoint.call(this,e,t),this.width=null!=n?n:0,this.height=null!=a?a:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(e){return e.x==this.x&&e.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(e,t,n,a){this.x=e,this.y=t,this.width=n,this.height=a},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(e){if(null!=e){var t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width);e=Math.max(this.y+this.height,e.y+e.height),this.x=t,this.y=n,this.width=a-t,this.height=e-n}},mxRectangle.prototype.grow=function(e){this.x-=e,this.y-=e,this.width+=2*e,this.height+=2*e},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.equals=function(e){return e.x==this.x&&e.y==this.y&&e.width==this.width&&e.height==this.height};var mxEffects={animateChanges:function(l,d,c){var m=0,u=function(){for(var e=!1,t=0;t<d.length;t++){var n=d[t];if(n instanceof mxGeometryChange||n instanceof mxTerminalChange||n instanceof mxValueChange||n instanceof mxChildChange||n instanceof mxStyleChange){var a=l.getView().getState(n.cell||n.child,!1);if(null!=a)if(e=!0,n.constructor!=mxGeometryChange||l.model.isEdge(n.cell))mxUtils.setOpacity(a.shape.node,100*m/10);else{var i=l.getView().scale,s=(n.geometry.x-n.previous.x)*i,o=(n.geometry.y-n.previous.y)*i,r=(n.geometry.width-n.previous.width)*i;i=(n.geometry.height-n.previous.height)*i;0==m?(a.x-=s,a.y-=o,a.width-=r,a.height-=i):(a.x+=s/10,a.y+=o/10,a.width+=r/10,a.height+=i/10),l.cellRenderer.redraw(a),mxEffects.cascadeOpacity(l,n.cell,100*m/10)}}}m<10&&e?(m++,window.setTimeout(u,p)):null!=c&&c()},p=30;u()},cascadeOpacity:function(e,t,n){for(var a=e.model.getChildCount(t),i=0;i<a;i++){var s=e.model.getChildAt(t,i),o=e.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,n),mxEffects.cascadeOpacity(e,s,n))}if(null!=(t=e.model.getEdges(t)))for(i=0;i<t.length;i++)null!=(a=e.getView().getState(t[i]))&&mxUtils.setOpacity(a.shape.node,n)},fadeOut:function(e,t,n,a,i,s){a=a||40,i=i||30;var o=t||100;if(mxUtils.setOpacity(e,o),s||null==s){var r=function(){o=Math.max(o-a,0),mxUtils.setOpacity(e,o),0<o?window.setTimeout(r,i):(e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e))};window.setTimeout(r,i)}else e.style.visibility="hidden",n&&e.parentNode&&e.parentNode.removeChild(e)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(e){if(null!=e.style&&(e.style.cursor=""),null!=(e=e.childNodes))for(var t=e.length,n=0;n<t;n+=1)mxUtils.removeCursors(e[n])},getCurrentStyle:mxClient.IS_IE?function(e){return null!=e?e.currentStyle:null}:function(e){return null!=e?window.getComputedStyle(e,""):null},hasScrollbars:function(e){return null!=(e=mxUtils.getCurrentStyle(e))&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(e,t){return function(){return t.apply(e,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+a)}else try{b=eval(a)}catch(e){mxLog.warn(e.message+" while evaluating "+a)}return b},findNode:function(e,t,n){var a=e.getAttribute(t);if(null!=a&&a==n)return e;for(e=e.firstChild;null!=e;){if(null!=(a=mxUtils.findNode(e,t,n)))return a;e=e.nextSibling}return null},findNodeByAttribute:9<=document.documentMode?function(e,t,n){var a=null;if(null!=e)if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.getAttribute(t)==n)a=e;else for(e=e.firstChild;null!=e&&null==a;)a=mxUtils.findNodeByAttribute(e,t,n),e=e.nextSibling;return a}:mxClient.IS_IE?function(e,t,n){return null==e?null:e.ownerDocument.selectSingleNode("//*[@"+t+"='"+n+"']")}:function(e,t,n){return null==e?null:e.ownerDocument.evaluate("//*[@"+t+"='"+n+"']",e.ownerDocument,null,XPathResult.ANY_TYPE,null).iterateNext()},getFunctionName:function(e){var t=null;if(null!=e)if(null!=e.name)t=e.name;else{for(e=e.toString(),t=9;" "==e.charAt(t);)t++;var n=e.indexOf("(",t);t=e.substring(t,n)}return t},indexOf:function(e,t){if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t)return n;return-1},remove:function(e,t){var n=null;if("object"==typeof t)for(var a=mxUtils.indexOf(t,e);0<=a;)t.splice(a,1),n=e,a=mxUtils.indexOf(t,e);for(var i in t)t[i]==e&&(delete t[i],n=e);return n},isNode:function(e,t,n,a){return!(null==e||isNaN(e.nodeType)||null!=t&&e.nodeName.toLowerCase()!=t.toLowerCase())&&(null==n||e.getAttribute(n)==a)},getChildNodes:function(e,t){t=t||mxConstants.NODETYPE_ELEMENT;for(var n=[],a=e.firstChild;null!=a;)a.nodeType==t&&n.push(a),a=a.nextSibling;return n},createXmlDocument:function(){var e=null;return document.implementation&&document.implementation.createDocument?e=document.implementation.createDocument("","",null):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLDOM")),e},parseXml:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){var t=mxUtils.createXmlDocument();return t.async="false",t.loadXML(e),t}:function(e){return(new DOMParser).parseFromString(e,"text/xml")},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:void 0,getPrettyXml:function(e,t,n){var a=[];if(null!=e)if(t=t||" ",n=n||"",e.nodeType==mxConstants.NODETYPE_TEXT)a.push(e.nodeValue);else{a.push(n+"<"+e.nodeName);var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++){var o=mxUtils.htmlEntities(i[s].nodeValue);a.push(" "+i[s].nodeName+'="'+o+'"')}if(null!=(i=e.firstChild)){for(a.push(">\n");null!=i;)a.push(mxUtils.getPrettyXml(i,t,n+t)),i=i.nextSibling;a.push(n+"</"+e.nodeName+">\n")}else a.push("/>\n")}return a.join("")},removeWhitespace:function(e,t){for(var n=t?e.previousSibling:e.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var a=t?n.previousSibling:n.nextSibling,i=mxUtils.getTextContent(n);0==mxUtils.trim(i).length&&n.parentNode.removeChild(n),n=a}},htmlEntities:function(e,t){return e=(e=(e=(e=(e=(e||"").replace(/&/g,"&")).replace(/"/g,""")).replace(/\'/g,"'")).replace(/</g,"<")).replace(/>/g,">"),(null==t||t)&&(e=e.replace(/\n/g,"
")),e},isVml:function(e){return null!=e&&"urn:schemas-microsoft-com:vml"==e.tagUrn},getXml:function(e,t){var n="";return null!=e&&(n=null==(n=e.xml)?e.innerHTML?e.innerHTML:(new XMLSerializer).serializeToString(e):n.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),n.replace(/\n/g,t||"
")},getTextContent:function(e){var t="";return null!=e&&(null!=e.firstChild&&(e=e.firstChild),t=e.nodeValue||""),t},getInnerHtml:mxClient.IS_IE?function(e){return null!=e?e.innerHTML:""}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},getOuterHtml:mxClient.IS_IE?function(e){if(null==e)return"";if(null!=e.outerHTML)return e.outerHTML;var t=[];t.push("<"+e.nodeName);var n=e.attributes;if(null!=n)for(var a=0;a<n.length;a++){var i=n[a].nodeValue;null!=i&&0<i.length&&(t.push(" "),t.push(n[a].nodeName),t.push('="'),t.push(i),t.push('"'))}return 0==e.innerHTML.length?t.push("/>"):(t.push(">"),t.push(e.innerHTML),t.push("</"+e.nodeName+">")),t.join("")}:function(e){return null!=e?(new XMLSerializer).serializeToString(e):""},write:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&e.appendChild(n),n},writeln:function(e,t){var n=e.ownerDocument.createTextNode(t);return null!=e&&(e.appendChild(n),e.appendChild(document.createElement("br"))),n},br:function(e,t){t=t||1;for(var n=null,a=0;a<t;a++)null!=e&&(n=e.ownerDocument.createElement("br"),e.appendChild(n));return n},button:function(e,t,n){return n=(n=null!=n?n:document).createElement("button"),mxUtils.write(n,e),mxEvent.addListener(n,"click",function(e){t(e)}),n},para:function(e,t){var n=document.createElement("p");return mxUtils.write(n,t),null!=e&&e.appendChild(n),n},addTransparentBackgroundFilter:function(e){e.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(e,t,n,a,i){return mxUtils.link(e,t,function(){n.execute(a)},i)},linkInvoke:function(e,t,n,a,i,s){return mxUtils.link(e,t,function(){n[a](i)},s)},link:function(e,t,n,a){var i=document.createElement("span");return i.style.color="blue",i.style.textDecoration="underline",i.style.cursor="pointer",null!=a&&(i.style.paddingLeft=a+"px"),mxEvent.addListener(i,"click",n),mxUtils.write(i,t),null!=e&&e.appendChild(i),i},fit:function(e){var t=parseInt(e.offsetLeft),n=parseInt(e.offsetWidth),a=document.body,i=document.documentElement,s=(a.scrollLeft||i.scrollLeft)+(a.clientWidth||i.clientWidth);s<t+n&&(e.style.left=Math.max(a.scrollLeft||i.scrollLeft,s-n)+"px"),t=parseInt(e.offsetTop),n=parseInt(e.offsetHeight),(s=(a.scrollTop||i.scrollTop)+Math.max(a.clientHeight||0,i.clientHeight))<t+n&&(e.style.top=Math.max(a.scrollTop||i.scrollTop,s-n)+"px")},open:function(e){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return mxUtils.alert("Permission to read file denied."),""}var t=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);return t.initWithPath(e),t.exists()?((e=Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream)).init(t,1,4,null),(t=Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream)).init(e),t.read(t.available())):(mxUtils.alert("File not found."),"")}return e=(t=new ActiveXObject("Scripting.FileSystemObject").OpenTextFile(e,1)).readAll(),t.close(),e},save:function(e,t){if(mxClient.IS_NS){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){return void mxUtils.alert("Permission to write file denied.")}var n=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);n.initWithPath(e),n.exists()||n.create(0,420);var a=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);a.init(n,34,4,null),a.write(t,t.length),a.flush(),a.close()}else(n=new ActiveXObject("Scripting.FileSystemObject").CreateTextFile(e,!0)).Write(t),n.Close()},saveAs:function(e){var t=document.createElement("iframe");t.setAttribute("src",""),t.style.visibility="hidden",document.body.appendChild(t);try{if(mxClient.IS_NS){var n=t.contentDocument;n.open(),n.write(e),n.close();try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),t.focus(),saveDocument(n)}catch(e){mxUtils.alert("Permission to save document denied.")}}else(n=t.contentWindow.document).write(e),n.execCommand("SaveAs",!1,document.location)}finally{document.body.removeChild(t)}},copy:function(e){if(window.clipboardData)window.clipboardData.setData("Text",e);else{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var t=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(t){var n=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(n){n.addDataFlavor("text/unicode");var a=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);a.data=e,n.setTransferData("text/unicode",a,2*e.length),t.setData(n,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}},load:function(e){return(e=new mxXmlRequest(e,null,"GET",!1)).send(),e},get:function(e,t,n){return new mxXmlRequest(e,null,"GET").send(t,n)},post:function(e,t,n,a){return new mxXmlRequest(e,t).send(n,a)},submit:function(e,t,n,a){return new mxXmlRequest(e,t).simulate(n,a)},loadInto:function(e,t,n){mxClient.IS_IE?t.onreadystatechange=function(){4==t.readyState&&n()}:t.addEventListener("load",n,!1),t.load(e)},getValue:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n),e},getNumber:function(e,t,n){return null==(e=null!=e?e[t]:null)&&(e=n||0),Number(e)},getColor:function(e,t,n){return null==(e=null!=e?e[t]:null)?e=n:e==mxConstants.NONE&&(e=null),e},clone:function(e,t,n){n=null!=n&&n;var a=null;if(null!=e&&"function"==typeof e.constructor){var i;a=new e.constructor;for(i in e)i!=mxObjectIdentity.FIELD_NAME&&(null==t||mxUtils.indexOf(t,i)<0)&&(a[i]=n||"object"!=typeof e[i]?e[i]:mxUtils.clone(e[i]))}return a},equalPoints:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n=0;n<e.length;n++)if(e[n]==t[n]||null!=e[n]&&!e[n].equals(t[n]))return!1;return!0},equalEntries:function(e,t){if(null==e&&null!=t||null!=e&&null==t||null!=e&&null!=t&&e.length!=t.length)return!1;if(null!=e&&null!=t)for(var n in e)if(e[n]!=t[n])return!1;return!0},extend:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},toString:function(e){var t,n="";for(t in e)try{if(null==e[t])n+=t+" = [null]\n";else if("function"==typeof e[t])n+=t+" => [Function]\n";else if("object"==typeof e[t])n=n+(t+" => [")+mxUtils.getFunctionName(e[t].constructor)+"]\n";else n+=t+" = "+e[t]+"\n"}catch(e){n+=t+"="+e.message}return n},toRadians:function(e){return Math.PI*e/180},arcToCurves:function(e,t,n,a,i,s,o,r,l){if(r-=e,l-=t,0===n||0===a)return h;n=Math.abs(n),a=Math.abs(a);var d=-r/2,c=-l/2,m=Math.cos(i*Math.PI/180);i=m*d+(h=Math.sin(i*Math.PI/180))*c;d=-1*h*d+m*c;r=m*(c=(s=1<(v=(c=i*i)/(g=n*n)+(p=d*d)/(E=a*a))?(n*=Math.sqrt(v),a*=Math.sqrt(v),0):(v=1,s===o&&(v=-1),v*Math.sqrt((g*E-g*p-E*c)/(g*p+E*c))))*n*d/a)-h*(p=-1*s*a*i/n)+r/2,l=h*c+m*p+l/2,s=0<=(g=Math.atan2((d-p)/a,(i-c)/n)-Math.atan2(0,1))?g:2*Math.PI+g,i=0<=(g=Math.atan2((-d-p)/a,(-i-c)/n)-Math.atan2((d-p)/a,(i-c)/n))?g:2*Math.PI+g,0==o&&0<i?i-=2*Math.PI:0!=o&&i<0&&(i+=2*Math.PI),o=2*i/Math.PI,i/=o=Math.ceil(o<0?-1*o:o),d=8/3*Math.sin(i/4)*Math.sin(i/4)/Math.sin(i/2),c=m*n,m*=a,n*=h,a*=h;for(var u=Math.cos(s),p=-d*(c*(b=Math.sin(s))+a*u),g=-d*(n*b-m*u),v=E=0,h=[],f=0;f<o;++f){s+=i;var b,E=c*(u=Math.cos(s))-a*(b=Math.sin(s))+r,A=(v=n*u+m*b+l,-d*(c*b+a*u));u=-d*(n*b-m*u);h[b=6*f]=Number(p+e),h[b+1]=Number(g+t),h[b+2]=Number(E-A+e),h[b+3]=Number(v-u+t),h[b+4]=Number(E+e),h[b+5]=Number(v+t),p=E+A,g=v+u}return h},getBoundingBox:function(e,t){var n=null;if(null!=e&&null!=t&&0!=t){var a=mxUtils.toRadians(t),i=(n=Math.cos(a),Math.sin(a)),s=new mxPoint(e.x+e.width/2,e.y+e.height/2),o=new mxPoint(e.x,e.y),r=new mxPoint((a=new mxPoint(e.x+e.width,e.y)).x,e.y+e.height),l=new mxPoint(e.x,r.y);o=mxUtils.getRotatedPoint(o,n,i,s),a=mxUtils.getRotatedPoint(a,n,i,s),r=mxUtils.getRotatedPoint(r,n,i,s),l=mxUtils.getRotatedPoint(l,n,i,s);(n=new mxRectangle(o.x,o.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),n.add(new mxRectangle(r.x,r.y,0,0)),n.add(new mxRectangle(l.x,l.y,0,0))}return n},getRotatedPoint:function(e,t,n,a){a=null!=a?a:new mxPoint;var i=e.x-a.x;return new mxPoint(i*t-(e=e.y-a.y)*n+a.x,e*t+i*n+a.y)},getPortConstraints:function(e,t,n,a){return null==(e=mxUtils.getValue(e.style,mxConstants.STYLE_PORT_CONSTRAINT,null))?a:(a=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,0<=a.indexOf(mxConstants.DIRECTION_NORTH)&&(e|=mxConstants.DIRECTION_MASK_NORTH),0<=a.indexOf(mxConstants.DIRECTION_WEST)&&(e|=mxConstants.DIRECTION_MASK_WEST),0<=a.indexOf(mxConstants.DIRECTION_SOUTH)&&(e|=mxConstants.DIRECTION_MASK_SOUTH),0<=a.indexOf(mxConstants.DIRECTION_EAST)&&(e|=mxConstants.DIRECTION_MASK_EAST),e)},reversePortConstraints:function(e){return(e&mxConstants.DIRECTION_MASK_WEST)<<3|(e&mxConstants.DIRECTION_MASK_NORTH)<<1|(e&mxConstants.DIRECTION_MASK_SOUTH)>>1|(e&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(e,t,n){var a=-1;if(0<e.absolutePoints.length)for(var i=e.absolutePoints[0],s=null,o=1;o<e.absolutePoints.length;o++){var r=e.absolutePoints[o];i=mxUtils.ptSegDistSq(i.x,i.y,r.x,r.y,t,n);(null==s||i<s)&&(s=i,a=o-1),i=r}return a},rectangleIntersectsSegment:function(e,t,n){var a=e.y,i=e.x,s=a+e.height,o=i+e.width;e=t.x;var r=n.x;if(t.x>n.x&&(e=n.x,r=t.x),o<r&&(r=o),e<i&&(e=i),r<e)return!1;i=t.y,o=n.y;var l=n.x-t.x;return 1e-7<Math.abs(l)&&(i=(n=(n.y-t.y)/l)*e+(t=t.y-n*t.x),o=n*r+t),o<i&&(t=o,o=i,i=t),s<o&&(o=s),i<a&&(i=a),!(o<i)},contains:function(e,t,n){return e.x<=t&&e.x+e.width>=t&&e.y<=n&&e.y+e.height>=n},intersects:function(e,t){var n=e.width,a=e.height,i=t.width,s=t.height;if(i<=0||s<=0||n<=0||a<=0)return!1;var o=e.x,r=e.y,l=t.x,d=t.y;s+=d,n+=o,a+=r;return((i=i+l)<l||o<i)&&(s<d||r<s)&&(n<o||l<n)&&(a<r||d<a)},intersectsHotspot:function(e,t,n,a,i,s){if(i=null!=i?i:0,s=null!=s?s:0,0<(a=null!=a?a:1)){var o=e.getCenterX(),r=e.getCenterY(),l=e.width,d=e.height,c=mxUtils.getValue(e.style,mxConstants.STYLE_STARTSIZE)*e.view.scale;return 0<c&&(mxUtils.getValue(e.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=e.y+c/2,d=c):(o=e.x+c/2,l=c)),l=Math.max(i,l*a),d=Math.max(i,d*a),0<s&&(l=Math.min(l,s),d=Math.min(d,s)),a=new mxRectangle(o-l/2,r-d/2,l,d),0!=(o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(-o),s=Math.sin(-o),o=new mxPoint(e.getCenterX(),e.getCenterY()),t=(e=mxUtils.getRotatedPoint(new mxPoint(t,n),i,s,o)).x,n=e.y),mxUtils.contains(a,t,n)}return!0},getOffset:function(e,t){var n=0,a=0;if(null!=t&&t){var i=document.body,s=document.documentElement;n=n+(i.scrollLeft||s.scrollLeft),a=a+(i.scrollTop||s.scrollTop)}for(;e.offsetParent;)n+=e.offsetLeft,a+=e.offsetTop,e=e.offsetParent;return new mxPoint(n,a)},getScrollOrigin:function(e){for(var t=document.body,n=document.documentElement,a=new mxPoint(t.scrollLeft||n.scrollLeft,t.scrollTop||n.scrollTop);null!=e&&e!=t&&e!=n;)!isNaN(e.scrollLeft)&&!isNaN(e.scrollTop)&&(a.x+=e.scrollLeft,a.y+=e.scrollTop),e=e.parentNode;return a},convertPoint:function(e,t,n){var a=mxUtils.getScrollOrigin(e);return(e=mxUtils.getOffset(e)).x-=a.x,e.y-=a.y,new mxPoint(t-e.x,n-e.y)},ltrim:function(e,t){return e.replace(RegExp("^["+(t||"\\s")+"]+","g"),"")},rtrim:function(e,t){return e.replace(RegExp("["+(t||"\\s")+"]+$","g"),"")},trim:function(e,t){return mxUtils.ltrim(mxUtils.rtrim(e,t),t)},isNumeric:function(e){return null!=e&&(null==e.length||0<e.length&&e.indexOf("0x")<0&&e.indexOf("0X")<0)&&!isNaN(e)},mod:function(e,t){return(e%t+t)%t},intersection:function(e,t,n,a,i,s,o,r){var l=(r-s)*(n-e)-(o-i)*(a-t);return o=((o-i)*(t-s)-(r-s)*(e-i))/l,i=((n-e)*(t-s)-(a-t)*(e-i))/l,0<=o&&o<=1&&0<=i&&i<=1?new mxPoint(e+o*(n-e),t+o*(a-t)):null},ptSegDistSq:function(e,t,n,a,i,s){return n=(i-=e)*(n-=e)+(s-=t)*(a-=t)<=0?0:(e=(i=n-i)*n+(s=a-s)*a)<=0?0:e*e/(n*n+a*a),(i=i*i+s*s-n)<0&&(i=0),i},relativeCcw:function(e,t,n,a,i,s){return 0==(e=(i-=e)*(a-=t)-(s-=t)*(n-=e))&&(0<(e=i*n+s*a)&&((e=(i-n)*n+(s-a)*a)<0&&(e=0))),e<0?-1:0<e?1:0},animateChanges:function(e,t){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(e,t,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(e,t,n,a,i,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(e,t){mxUtils.isVml(e)?e.style.filter=100<=t?null:"alpha(opacity="+t/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?e.style.filter=100<=t?null:"alpha(opacity="+t+")":e.style.opacity=t/100},createImage:function(e){var t=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((t=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",e),t.style.borderStyle="none"):((t=document.createElement("img")).setAttribute("src",e),t.setAttribute("border","0")),t},sortCells:function(e,i){i=null==i||i;var s=new mxDictionary;return e.sort(function(e,t){var n=s.get(e);null==n&&(n=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),s.put(e,n));var a=s.get(t);return null==a&&(a=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),s.put(t,a)),0==(n=mxCellPath.compare(n,a))?0:0<n==i?1:-1}),e},getStylename:function(e){return null!=e&&(e=e.split(";")[0]).indexOf("=")<0?e:""},getStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)e[n].indexOf("=")<0&&t.push(e[n])}return t},indexOfStylename:function(e,t){if(null!=e&&null!=t)for(var n=e.split(";"),a=0,i=0;i<n.length;i++){if(n[i]==t)return a;a+=n[i].length+1}return-1},addStylename:function(e,t){return mxUtils.indexOfStylename(e,t)<0&&(null==e?e="":0<e.length&&";"!=e.charAt(e.length-1)&&(e+=";"),e+=t),e},removeStylename:function(e,t){var n=[];if(null!=e)for(var a=e.split(";"),i=0;i<a.length;i++)a[i]!=t&&n.push(a[i]);return n.join(";")},removeAllStylenames:function(e){var t=[];if(null!=e){e=e.split(";");for(var n=0;n<e.length;n++)0<=e[n].indexOf("=")&&t.push(e[n])}return t.join(";")},setCellStyles:function(e,t,n,a){if(null!=t&&0<t.length){e.beginUpdate();try{for(var i=0;i<t.length;i++)if(null!=t[i]){var s=mxUtils.setStyle(e.getStyle(t[i]),n,a);e.setStyle(t[i],s)}}finally{e.endUpdate()}}},setStyle:function(e,t,n){var a=null!=n&&(void 0===n.length||0<n.length);if(null==e||0==e.length)a&&(e=t+"="+n);else{var i=e.indexOf(t+"=");i<0?a&&(a=";"==e.charAt(e.length-1)?"":";",e=e+a+t+"="+n):(t=a?t+"="+n:"",n=e.indexOf(";",i),a||n++,e=e.substring(0,i)+t+(i<n?e.substring(n):""))}return e},setCellStyleFlags:function(e,t,n,a,i){if(null!=t&&0<t.length){e.beginUpdate();try{for(var s=0;s<t.length;s++)if(null!=t[s]){var o=mxUtils.setStyleFlag(e.getStyle(t[s]),n,a,i);e.setStyle(t[s],o)}}finally{e.endUpdate()}}},setStyleFlag:function(e,t,n,a){if(null==e||0==e.length)e=a||null==a?t+"="+n:t+"=0";else{var i=e.indexOf(t+"=");if(i<0)i=";"==e.charAt(e.length-1)?"":";",e=a||null==a?e+i+t+"="+n:e+i+t+"=0";else{var s=e.indexOf(";",i),o="";o=s<0?e.substring(i+t.length+1):e.substring(i+t.length+1,s),o=null==a?parseInt(o)^n:a?parseInt(o)|n:parseInt(o)&~n;e=e.substring(0,i)+t+"="+o+(0<=s?e.substring(s):"")}}return e},getAlignmentAsPoint:function(e,t){var n=0,a=0;return e==mxConstants.ALIGN_CENTER?n=-.5:e==mxConstants.ALIGN_RIGHT&&(n=-1),t==mxConstants.ALIGN_MIDDLE?a=-.5:t==mxConstants.ALIGN_BOTTOM&&(a=-1),new mxPoint(n,a)},getSizeForString:function(e,t,n){t=null!=t?t:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var a=document.createElement("div");return a.style.fontFamily=n,a.style.fontSize=Math.round(t)+"px",a.style.lineHeight=Math.round(t*mxConstants.LINE_HEIGHT)+"px",a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,document.body.appendChild(a),e=new mxRectangle(0,0,a.offsetWidth,a.offsetHeight),document.body.removeChild(a),e},getViewXml:function(e,t,n,a,i){a=null!=a?a:0,i=null!=i?i:0,t=null!=t?t:1,null==n&&(n=[e.getModel().getRoot()]);var s=e.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var l=s.drawPane,d=s.overlayPane;e.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var c=s.getTranslate();s.translate=new mxPoint(a,i),t=new mxTemporaryCellStates(e.getView(),t,n);try{o=(new mxCodec).encode(e.getView())}finally{t.destroy(),s.translate=c,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=l,s.overlayPane=d,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(e,t,n,a){if(e<1)return 1;a=null!=a?a:0;var i=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*a;n=n.height-2*a,a=t.getGraphBounds().clone(),t=t.getView().getScale(),a.width/=t,a.height/=t,n=(t=a.width)/a.height/(i/n),a=Math.sqrt(e);var s=Math.sqrt(n);if(n=a*s,a/=s,n<1&&e<a){var o=a/e;a=e,n/=o}for(a<1&&e<n&&(o=n/e,n=e,a/=o),o=Math.ceil(n)*Math.ceil(a),s=0;e<o;){o=Math.floor(n)/n;var r=Math.floor(a)/a;if(1==o&&(o=Math.floor(n-1)/n),1==r&&(r=Math.floor(a-1)/a),n*=o=r<o?o:r,a*=o,o=Math.ceil(n)*Math.ceil(a),10<++s)break}return i*n/t*.99999},show:function(e,t,n,a){if(n=null!=n?n:0,a=null!=a?a:0,null==t?t=window.open().document:t.open(),n=-(i=e.getGraphBounds()).x+n,a=-i.y+a,mxClient.IS_IE){for(var i="<html><head>",s=document.getElementsByTagName("base"),o=0;o<s.length;o++)i+=s[o].outerHTML;for(i+="<style>",o=0;o<document.styleSheets.length;o++)try{i+=document.styleSheets(o).cssText}catch(e){}i+="</style></head>",i+="<body>",i+=e.container.innerHTML,i+="</body>",i+="<html>",t.writeln(i),t.close(),null!=(e=t.body.getElementsByTagName("DIV")[0])&&(e.style.position="absolute",e.style.left=n+"px",e.style.top=a+"px")}else{for(t.writeln("<html"),t.writeln("<head>"),s=document.getElementsByTagName("base"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("link"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(s=document.getElementsByTagName("style"),o=0;o<s.length;o++)t.writeln(mxUtils.getOuterHtml(s[o]));for(t.writeln("</head>"),t.writeln("</html>"),t.close(),null==t.body&&t.documentElement.appendChild(t.createElement("body")),t.body.style.overflow="auto",e=e.container.firstChild;null!=e;)o=e.cloneNode(!0),t.body.appendChild(o),e=e.nextSibling;null!=(e=t.getElementsByTagName("g")[0])&&(e.setAttribute("transform","translate("+n+","+a+")"),(n=e.ownerSVGElement).setAttribute("width",i.width+Math.max(i.x,0)+3),n.setAttribute("height",i.height+Math.max(i.y,0)+3))}return mxUtils.removeCursors(t.body),t},printScreen:function(e){var t=window.open();mxUtils.show(e,t.document),e=function(){t.focus(),t.print(),t.close()},mxClient.IS_GC?t.setTimeout(e,500):e()},popup:function(e,t){if(t){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px";var a=document.createElement("pre");a.innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.appendChild(a),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,(document.body.clientHeight||document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(e)+"</pre"),n.document.close()):((a=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(e,!1).replace(/\n/g,"<br>").replace(/ /g," "),n.document.body.appendChild(a))},alert:function(e){alert(e)},prompt:function(e,t){return prompt(e,t)},confirm:function(e){return confirm(e)},error:function(e,t,n,a){var i=document.createElement("div");i.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",a||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",i.appendChild(s),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(" ")),mxUtils.write(i,e),e=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,i,(e-t)/2,a/4,t,null,!1,!0);return n&&(mxUtils.br(i),t=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",function(e){o.destroy()}),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),t.appendChild(n),i.appendChild(t),mxUtils.br(i),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(e,t,n,i,a,s,o,r,l,d){return(e=new mxDragSource(e,n)).dragOffset=new mxPoint(null!=a?a:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),e.autoscroll=o,e.setGuidesEnabled(!1),null!=l&&(e.highlightDropTargets=l),null!=d&&(e.getDropTarget=d),e.getGraphForEvent=function(e){return"function"==typeof t?t(e):t},null!=i&&(e.createDragElement=function(){return i.cloneNode(!0)},r&&(e.createPreviewElement=function(e){var t=i.cloneNode(!0),n=parseInt(t.style.width),a=parseInt(t.style.height);return t.style.width=Math.round(n*e.view.scale)+"px",t.style.height=Math.round(a*e.view.scale)+"px",t})),e}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",HIGHLIGHT_STROKEWIDTH:3,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_BEND_HANDLE:"pointer",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:7,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,LINE_HEIGHT:1.2,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:10,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_OPACITY:"opacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_LOOP:"loopStyle",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_SHADOW:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_BLOCK:"block",ARROW_OPEN:"open",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(e){this.name=e,this.properties=[];for(var t=1;t<arguments.length;t+=2)null!=arguments[t+1]&&(this.properties[arguments[t]]=arguments[t+1])}function mxMouseEvent(e,t){this.evt=e,this.state=t}function mxEventSource(e){this.setEventSource(e)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(e){return this.properties[e]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(e){if(null!=e)for(var t=this.getSource();null!=t;){if(t==e.node)return!0;t=t.parentNode}return!1},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var e=this.getState();return null!=e?e.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(e){(null==e||e)&&this.evt.preventDefault&&this.evt.preventDefault(),this.evt.returnValue=!1,this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(e){this.eventsEnabled=e},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(e){this.eventSource=e},mxEventSource.prototype.addListener=function(e,t){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(e),this.eventListeners.push(t)},mxEventSource.prototype.removeListener=function(e){if(null!=this.eventListeners)for(var t=0;t<this.eventListeners.length;)this.eventListeners[t+1]==e?this.eventListeners.splice(t,2):t+=2},mxEventSource.prototype.fireEvent=function(e,t){if(null!=this.eventListeners&&this.isEventsEnabled()){null==e&&(e=new mxEventObject),null==t&&(t=this.getEventSource()),null==t&&(t=this);for(var n=[t,e],a=0;a<this.eventListeners.length;a+=2){var i=this.eventListeners[a];(null==i||i==e.getName())&&this.eventListeners[a+1].apply(this,n)}}};var mxEvent={objects:[],addListener:function(){var a=function(e,t,n){null==e.mxListenerList&&(e.mxListenerList=[],mxEvent.objects.push(e)),e.mxListenerList.push({name:t,f:n})};return window.addEventListener?function(e,t,n){e.addEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.attachEvent("on"+t,n),a(e,t,n)}}(),removeListener:function(){var a=function(e,t,n){if(null!=e.mxListenerList){t=e.mxListenerList.length;for(var a=0;a<t;a++)if(e.mxListenerList[a].f==n){e.mxListenerList.splice(a,1);break}0==e.mxListenerList.length&&(e.mxListenerList=null)}};return window.removeEventListener?function(e,t,n){e.removeEventListener(t,n,!1),a(e,t,n)}:function(e,t,n){e.detachEvent("on"+t,n),a(e,t,n)}}(),removeAllListeners:function(e){var t=e.mxListenerList;if(null!=t)for(;0<t.length;){var n=t[0];mxEvent.removeListener(e,n.name,n.f)}},addGestureListeners:function(e,t,n,a){null!=t&&mxEvent.addListener(e,"mousedown",t),null!=n&&mxEvent.addListener(e,"mousemove",n),null!=a&&mxEvent.addListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.addListener(e,"touchstart",t),null!=n&&mxEvent.addListener(e,"touchmove",n),null!=a&&mxEvent.addListener(e,"touchend",a))},removeGestureListeners:function(e,t,n,a){null!=t&&mxEvent.removeListener(e,"mousedown",t),null!=n&&mxEvent.removeListener(e,"mousemove",n),null!=a&&mxEvent.removeListener(e,"mouseup",a),mxClient.IS_TOUCH&&(null!=t&&mxEvent.removeListener(e,"touchstart",t),null!=n&&mxEvent.removeListener(e,"touchmove",n),null!=a&&mxEvent.removeListener(e,"touchend",a))},redirectMouseEvents:function(e,n,t,a,i,s,o){var r=function(e){return"function"==typeof t?t(e):t};mxEvent.addGestureListeners(e,function(e){null!=a?a(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,r(e)))},function(e){null!=i?i(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))},function(e){null!=s?s(e):mxEvent.isConsumed(e)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e)))}),mxEvent.addListener(e,"dblclick",function(e){if(null!=o)o(e);else if(!mxEvent.isConsumed(e)){var t=r(e);n.dblClick(e,null!=t?t.cell:null)}})},release:function(e){if(null!=e&&(mxEvent.removeAllListeners(e),null!=(e=e.childNodes)))for(var t=e.length,n=0;n<t;n+=1)mxEvent.release(e[n])},addMouseWheelListener:function(n){if(null!=n){var e=function(e){null==e&&(e=window.event);var t=0;0!=(t=!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC?e.wheelDelta/120:-e.detail/2)&&n(e,0<t)};mxClient.IS_NS?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",e):mxEvent.addListener(document,"mousewheel",e)}},disableContextMenu:mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?function(e){mxEvent.addListener(e,"contextmenu",function(){return!1})}:function(e){e.setAttribute("oncontextmenu","return false;")},getSource:function(e){return null!=e.srcElement?e.srcElement:e.target},isConsumed:function(e){return null!=e.isConsumed&&e.isConsumed},isLeftMouseButton:function(e){return e.button==(mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?1:0)},isRightMouseButton:function(e){return 2==e.button},isPopupTrigger:function(e){return mxEvent.isRightMouseButton(e)||mxEvent.isShiftDown(e)&&!mxEvent.isControlDown(e)},isShiftDown:function(e){return null!=e&&e.shiftKey},isAltDown:function(e){return null!=e&&e.altKey},isControlDown:function(e){return null!=e&&e.ctrlKey},isMetaDown:function(e){return null!=e&&e.metaKey},getMainEvent:function(e){return"touchstart"!=e.type&&"touchmove"!=e.type||null==e.touches||null==e.touches[0]?"touchend"==e.type&&null!=e.changedTouches&&null!=e.changedTouches[0]&&(e=e.changedTouches[0]):e=e.touches[0],e},getClientX:function(e){return mxEvent.getMainEvent(e).clientX},getClientY:function(e){return mxEvent.getMainEvent(e).clientY},consume:function(e,t,n){n=null==n||n,(null==t||t)&&(e.preventDefault?(n&&e.stopPropagation(),e.preventDefault()):n&&(e.cancelBubble=!0)),e.isConsumed=!0,e.returnValue=!1},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",SESSION:"session",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(e,t,n,a,i,s){this.url=e,this.params=t,this.method=n||"POST",this.async=null==a||a,this.username=i,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(e){this.binary=e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var e=this.getXml();return null!=e?e.documentElement:null},mxXmlRequest.prototype.getXml=function(){var e=this.request.responseXML;return(9<=document.documentMode||null==e||null==e.documentElement)&&(e=mxUtils.parseXml(this.request.responseText)),e},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var e=new XMLHttpRequest;return this.isBinary()&&e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined"),e}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(e,t){this.request=this.create(),null!=this.request&&(null!=e&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(e(this),this.onreadystatechaange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(e,t){null!=t&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(e,t){var n=null;(e=e||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var a=e.createElement("form");a.setAttribute("method",this.method),a.setAttribute("action",this.url),null!=t&&a.setAttribute("target",t),a.style.display="none",a.style.visibility="hidden";for(var i=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<i.length;s++){if(0<(o=i[s].indexOf("="))){var o,r=i[s].substring(0,o),l=i[s].substring(o+1);(o=e.createElement("textarea")).setAttribute("name",r),l=l.replace(/\n/g,"
"),r=e.createTextNode(l),o.appendChild(r),a.appendChild(o)}}e.body.appendChild(a),a.submit(),e.body.removeChild(a),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,isEmpty:function(){return null==mxClipboard.cells},cut:function(e,t){return t=mxClipboard.copy(e,t),mxClipboard.insertCount=0,mxClipboard.removeCells(e,t),t},removeCells:function(e,t){e.removeCells(t)},copy:function(e,t){t=t||e.getSelectionCells();var n=e.getExportableCells(t);return mxClipboard.insertCount=1,mxClipboard.cells=e.cloneCells(n),n},paste:function(e){if(null!=mxClipboard.cells){var t=e.getImportableCells(mxClipboard.cells),n=mxClipboard.insertCount*mxClipboard.STEPSIZE,a=e.getDefaultParent();t=e.importCells(t,n,n,a);mxClipboard.insertCount++,e.setSelectionCells(t)}}};function mxWindow(e,t,n,a,i,s,o,r,l,d){null!=t&&(o=null==o||o,this.content=t,this.init(n,a,i,s,d),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(e),(null==r||r)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}function mxForm(e){this.table=document.createElement("table"),this.table.className=e,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(e,t,n){this.src=e,this.width=t,this.height=n}function mxDivResizer(e,t){if("div"==e.nodeName.toLowerCase()){null==t&&(t=window),this.div=e;var n=mxUtils.getCurrentStyle(e);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(t,"resize",mxUtils.bind(this,function(e){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(e,t){this.element=e,this.dropHandler=t,mxEvent.addGestureListeners(e,mxUtils.bind(this,this.mouseDown))}function mxToolbar(e){this.container=e}function mxSession(t,e,n,a){this.model=t,this.urlInit=e,this.urlPoll=n,this.urlNotify=a,null!=t&&(this.codec=new mxCodec,this.codec.lookup=function(e){return t.getCell(e)}),t.addListener(mxEvent.NOTIFY,mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");(null!=n&&this.debug||this.connected&&!this.suspended)&&this.notify("<edit>"+this.encodeChanges(n.changes,n.undone)+"</edit>")}))}function mxUndoableEdit(e,t){this.source=e,this.changes=[],this.significant=null==t||t}function mxUndoManager(e){this.size=null!=e?e:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.content=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.title=!1,mxWindow.prototype.content=!1,mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.init=function(e,t,n,a,i){i=null!=i?i:"mxWindow",this.div=document.createElement("div"),this.div.className=i,this.div.style.left=e+"px",this.div.style.top=t+"px",this.table=document.createElement("table"),this.table.className=i,null!=n&&(mxClient.IS_IE||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=a&&(mxClient.IS_IE||(this.div.style.height=a+"px"),this.table.style.height=a+"px"),e=document.createElement("tbody"),t=document.createElement("tr"),this.title=document.createElement("td"),this.title.className=i+"Title",t.appendChild(this.title),e.appendChild(t),t=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=i+"Pane",this.contentWrapper=document.createElement("div"),this.contentWrapper.className=i+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_IE||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),t.appendChild(this.td),e.appendChild(t),this.table.appendChild(e),this.div.appendChild(this.table),i=mxUtils.bind(this,function(e){this.activate()}),mxEvent.addListener(this.title,"mousedown",i),mxEvent.addListener(this.table,"mousedown",i),mxClient.IS_TOUCH&&(mxEvent.addListener(this.title,"touchstart",i),mxEvent.addListener(this.table,"touchstart",i)),this.hide()},mxWindow.prototype.setTitle=function(e){for(var t=this.title.firstChild;null!=t;){var n=t.nextSibling;t.nodeType==mxConstants.NODETYPE_TEXT&&t.parentNode.removeChild(t),t=n}mxUtils.write(this.title,e||"")},mxWindow.prototype.setScrollable=function(e){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=e?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var e=null!=(e=mxUtils.getCurrentStyle(this.getElement()))?e.zIndex:3;if(mxWindow.activeWindow){var t=mxWindow.activeWindow.getElement();null!=t&&null!=t.style&&(t.style.zIndex=e)}t=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",t))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(e){e?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",mxClient.imageBasePath+"/resize.gif"),this.resize.style.cursor="nw-resize",mxEvent.addGestureListeners(this.resize,mxUtils.bind(this,function(e){this.activate();var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.div.offsetWidth,o=this.div.offsetHeight,t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setSize(s+t,o+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",e)),mxEvent.consume(e)}),null,null),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(e,t){e=Math.max(this.minimumSize.width,e),t=Math.max(this.minimumSize.height,t),mxClient.IS_IE||(this.div.style.width=e+"px",this.div.style.height=t+"px"),this.table.style.width=e+"px",this.table.style.height=t+"px",mxClient.IS_IE||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")},mxWindow.prototype.setMinimizable=function(e){this.minimize.style.display=e?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("align","right"),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginRight="1px",this.minimize.style.display="none",this.title.appendChild(this.minimize);var n=!1,a=null,i=null,e=mxUtils.bind(this,function(e){if(this.activate(),n)n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=a,mxClient.IS_IE||(this.div.style.height=i),this.table.style.height=i,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",a=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var t=this.getMinimumSize();0<t.height&&(mxClient.IS_IE||(this.div.style.height=t.height+"px"),this.table.style.height=t.height+"px"),0<t.width&&(mxClient.IS_IE||(this.div.style.width=t.width+"px"),this.table.style.width=t.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",e))}mxEvent.consume(e)});mxEvent.addListener(this.minimize,"mousedown",e),mxClient.IS_TOUCH&&mxEvent.addListener(this.minimize,"touchstart",e)},mxWindow.prototype.setMaximizable=function(e){this.maximize.style.display=e?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("align","right"),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="1px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.title.appendChild(this.maximize);var n=!1,a=null,i=null,s=null,o=null,e=mxUtils.bind(this,function(e){if(this.activate(),"none"!=this.maximize.style.display){if(n)n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.visibility="",this.div.style.left=a+"px",this.div.style.top=i+"px",mxClient.IS_IE||(this.div.style.height=s,this.div.style.width=o,"auto"!=(t=mxUtils.getCurrentStyle(this.contentWrapper)).overflow&&null==this.resize)||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",e));else{if(n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",this.minimize.style.visibility="hidden",a=parseInt(this.div.style.left),i=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",mxClient.IS_IE||(this.div.style.height=document.body.clientHeight-2+"px",this.div.style.width=document.body.clientWidth-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=document.body.clientHeight-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_IE){var t=mxUtils.getCurrentStyle(this.contentWrapper);"auto"!=t.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",e))}mxEvent.consume(e)}});mxEvent.addGestureListeners(this.maximize,e),mxEvent.addListener(this.title,"dblclick",e)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(e){var a=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=this.getX(),o=this.getY(),t=mxUtils.bind(this,function(e){var t=mxEvent.getClientX(e)-a,n=mxEvent.getClientY(e)-i;this.setLocation(s+t,o+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",e)),mxEvent.consume(e)}),n=mxUtils.bind(this,function(e){mxEvent.removeGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",e)),mxEvent.consume(e)});mxEvent.addGestureListeners(document,null,t,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",e)),mxEvent.consume(e)}))},mxWindow.prototype.setLocation=function(e,t){this.div.style.left=e+"px",this.div.style.top=t+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("align","right"),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.title.insertBefore(this.closeImg,this.title.firstChild),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",e)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(e)}))},mxWindow.prototype.setImage=function(e){this.image=document.createElement("img"),this.image.setAttribute("src",e),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(e){this.closeImg.style.display=e?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"hidden"!=this.div.style.visibility},mxWindow.prototype.setVisible=function(e){null!=this.div&&this.isVisible()!=e&&(e?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.visibility="",this.activate();var e=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_IE||"auto"!=e.overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-2+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.visibility="hidden",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.contentWrapper=this.content=this.title=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");n.appendChild(a);a=document.createElement("td");var i=document.createElement("button");mxUtils.write(i,mxResources.get("ok")||"OK"),a.appendChild(i),mxEvent.addListener(i,"click",function(){e()}),i=document.createElement("button"),mxUtils.write(i,mxResources.get("cancel")||"Cancel"),a.appendChild(i),mxEvent.addListener(i,"click",function(){t()}),n.appendChild(a),this.body.appendChild(n)},mxForm.prototype.addText=function(e,t){var n=document.createElement("input");return n.setAttribute("type","text"),n.value=t,this.addField(e,n)},mxForm.prototype.addCheckbox=function(e,t){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(e,n),t&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(e,t,n){var a=document.createElement("textarea");return mxClient.IS_NS&&n--,a.setAttribute("rows",n||2),a.value=t,this.addField(e,a)},mxForm.prototype.addCombo=function(e,t,n){var a=document.createElement("select");return null!=n&&a.setAttribute("size",n),t&&a.setAttribute("multiple","true"),this.addField(e,a)},mxForm.prototype.addOption=function(e,t,n,a){var i=document.createElement("option");mxUtils.writeln(i,t),i.setAttribute("value",n),a&&i.setAttribute("selected",a),e.appendChild(i)},mxForm.prototype.addField=function(e,t){var n=document.createElement("tr"),a=document.createElement("td");return mxUtils.write(a,e),n.appendChild(a),(a=document.createElement("td")).appendChild(t),n.appendChild(a),this.body.appendChild(n),t},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var e=this.getDocumentWidth(),t=this.getDocumentHeight(),n=parseInt(this.div.style.left),a=parseInt(this.div.style.right),i=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(a)&&0<=n&&0<=a&&0<e-a-n&&(this.div.style.width=e-a-n+"px"),this.resizeHeight&&!isNaN(i)&&!isNaN(s)&&0<=i&&0<=s&&0<t-i-s&&(this.div.style.height=t-i-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(e){this.enabled=e},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(e){this.guidesEnabled=e},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxDragSource.prototype.getGraphForEvent=function(e){return null},mxDragSource.prototype.getDropTarget=function(e,t,n){return e.getCellAt(t,n)},mxDragSource.prototype.createDragElement=function(e){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(e){return null},mxDragSource.prototype.mouseDown=function(e){this.enabled&&!mxEvent.isConsumed(e)&&null==this.mouseMoveHandler&&(this.startDrag(e),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxEvent.consume(e,!0,!1))},mxDragSource.prototype.startDrag=function(e){this.dragElement=this.createDragElement(e),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity)},mxDragSource.prototype.stopDrag=function(e){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.graphContainsEvent=function(e,t){var n=mxEvent.getClientX(t),a=mxEvent.getClientY(t),i=mxUtils.getOffset(e.container),s=mxUtils.getScrollOrigin();return n>=i.x-s.x&&a>=i.y-s.y&&n<=i.x-s.x+e.container.offsetWidth&&a<=i.y-s.y+e.container.offsetHeight},mxDragSource.prototype.mouseMove=function(e){if(null!=(t=this.getGraphForEvent(e))&&!this.graphContainsEvent(t,e)&&(t=null),t!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph),this.currentGraph=t,null!=this.currentGraph&&this.dragEnter(this.currentGraph)),null!=this.currentGraph&&this.dragOver(this.currentGraph,e),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var t=mxEvent.getClientX(e),n=mxEvent.getClientY(e);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(t+=this.dragOffset.x,n+=this.dragOffset.y),t+=document.body.scrollLeft||document.documentElement.scrollLeft,n+=document.body.scrollTop||document.documentElement.scrollTop,this.dragElement.style.left=t+"px",this.dragElement.style.top=n+"px"}mxEvent.consume(e)},mxDragSource.prototype.mouseUp=function(e){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var t=this.currentGraph.view.scale,n=this.currentGraph.view.translate;this.drop(this.currentGraph,e,this.currentDropTarget,this.currentPoint.x/t-n.x,this.currentPoint.y/t-n.y)}this.dragExit(this.currentGraph)}this.stopDrag(e),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.currentGraph=this.mouseUpHandler=this.mouseMoveHandler=null,mxEvent.consume(e)},mxDragSource.prototype.dragEnter=function(e){e.isMouseDown=!0,this.previewElement=this.createPreviewElement(e),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(e,e.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(e,mxConstants.DROP_TARGET_COLOR))},mxDragSource.prototype.dragExit=function(e){this.currentPoint=this.currentDropTarget=null,e.isMouseDown=!1,null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(e,t){var n=mxUtils.getOffset(e.container),a=mxUtils.getScrollOrigin(e.container),i=mxEvent.getClientX(t)-n.x+a.x;n=mxEvent.getClientY(t)-n.y+a.y;if(e.autoScroll&&(null==this.autoscroll||this.autoscroll)&&e.scrollPointToVisible(i,n,e.autoExtend),null!=this.currentHighlight&&e.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(e,i,n),a=e.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(a)),null!=this.previewElement){null==this.previewElement.parentNode&&(e.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");a=this.isGridEnabled()&&e.isGridEnabledEvent(t);var s=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(t))s=new mxRectangle(0,0,s=parseInt(this.previewElement.style.width),o=parseInt(this.previewElement.style.height)),n=new mxPoint(i,n),n=this.currentGuide.move(s,n,a),s=!1,i=n.x,n=n.y;else if(a){a=e.view.scale;var o=e.view.translate,r=e.gridSize/2;i=(e.snap(i/a-o.x-r)+o.x)*a,n=(e.snap(n/a-o.y-r)+o.y)*a}null!=this.currentGuide&&s&&this.currentGuide.hide(),null!=this.previewOffset&&(i+=this.previewOffset.x,n+=this.previewOffset.y),this.previewElement.style.left=Math.round(i)+"px",this.previewElement.style.top=Math.round(n)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(i,n)},mxDragSource.prototype.drop=function(e,t,n,a,i){this.dropHandler(e,t,n,a,i),e.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(e,t,n,a,i,s){var o=document.createElement(null!=t?"img":"button"),r=i||(null!=s?"mxToolbarMode":"mxToolbarItem");return o.className=r,o.setAttribute("src",t),null!=e&&(null!=t?o.setAttribute("title",e):mxUtils.write(o,e)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n)),e=mxUtils.bind(this,function(e){null!=a?o.setAttribute("src",t):o.style.backgroundColor=""}),mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){if(null!=a?o.setAttribute("src",a):o.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var t=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu(),t!=o&&(this.currentImg=o,this.menu.factoryMethod=s,t=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(t.x,t.y,null,e),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null}))}}),null,e),mxEvent.addListener(o,"mouseout",e),o},mxToolbar.prototype.addCombo=function(e){var t=document.createElement("div");t.style.display="inline",t.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=e||"mxToolbarCombo",t.appendChild(n),this.container.appendChild(t),n},mxToolbar.prototype.addActionCombo=function(e,t){var n=document.createElement("select");return n.className=t||"mxToolbarCombo",this.addOption(n,e,null),mxEvent.addListener(n,"change",function(e){var t=n.options[n.selectedIndex];n.selectedIndex=0,null!=t.funct&&t.funct(e)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(e,t,n){var a=document.createElement("option");return mxUtils.writeln(a,t),"function"==typeof n?a.funct=n:a.setAttribute("value",n),e.appendChild(a),a},mxToolbar.prototype.addSwitchMode=function(e,t,n,a,i){var s=document.createElement("img");return s.initialClassName=i||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",t),s.altIcon=a,null!=e&&s.setAttribute("title",e),mxEvent.addListener(s,"click",mxUtils.bind(this,function(e){null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),n()),s},mxToolbar.prototype.addMode=function(e,t,n,a,i,s){s=null==s||s;var o=document.createElement(null!=t?"img":"button");return o.initialClassName=i||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",t),o.altIcon=a,null!=e&&o.setAttribute("title",e),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(e){this.selectMode(o,n),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(e){this.selectMode(o,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(e,t){if(this.selectedMode!=e){if(null!=this.selectedMode){var n=this.selectedMode.altIcon;null!=n?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=e,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",t))}},mxToolbar.prototype.resetMode=function(e){(e||!this.noReset)&&this.selectedMode!=this.defaultMode&&this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(e){return this.addItem(null,e,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var e=document.createElement("hr");e.style.marginRight="6px",e.setAttribute("size","1"),this.container.appendChild(e)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null,null!=this.menu&&this.menu.destroy()},mxSession.prototype=new mxEventSource,mxSession.prototype.constructor=mxSession,mxSession.prototype.model=null,mxSession.prototype.urlInit=null,mxSession.prototype.urlPoll=null,mxSession.prototype.urlNotify=null,mxSession.prototype.codec=null,mxSession.prototype.linefeed="
",mxSession.prototype.escapePostData=!0,mxSession.prototype.significantRemoteChanges=!0,mxSession.prototype.sent=0,mxSession.prototype.received=0,mxSession.prototype.debug=!1,mxSession.prototype.connected=!1,mxSession.prototype.suspended=!1,mxSession.prototype.polling=!1,mxSession.prototype.start=function(){this.debug?(this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT))):this.connected||this.get(this.urlInit,mxUtils.bind(this,function(e){this.connected=!0,this.fireEvent(new mxEventObject(mxEvent.CONNECT)),this.poll()}))},mxSession.prototype.suspend=function(){this.connected&&!this.suspended&&(this.suspended=!0,this.fireEvent(new mxEventObject(mxEvent.SUSPEND)))},mxSession.prototype.resume=function(e,t,n){this.connected&&this.suspended&&(this.suspended=!1,this.fireEvent(new mxEventObject(mxEvent.RESUME)),this.polling||this.poll())},mxSession.prototype.stop=function(e){this.connected&&(this.connected=!1),this.fireEvent(new mxEventObject(mxEvent.DISCONNECT,"reason",e))},mxSession.prototype.poll=function(){this.connected&&!this.suspended&&null!=this.urlPoll?(this.polling=!0,this.get(this.urlPoll,mxUtils.bind(this,function(){this.poll()}))):this.polling=!1},mxSession.prototype.notify=function(e,t,n){null!=e&&0<e.length&&(null!=this.urlNotify&&(this.debug?(mxLog.show(),mxLog.debug("mxSession.notify: "+this.urlNotify+" xml="+e)):(e="<message><delta>"+e+"</delta></message>",this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(this.urlNotify,"xml="+e,t,n))),this.sent+=e.length,this.fireEvent(new mxEventObject(mxEvent.NOTIFY,"url",this.urlNotify,"xml",e)))},mxSession.prototype.get=function(n,a,t){if(void 0!==mxUtils){var i=mxUtils.bind(this,function(e){null!=t?t(e):this.stop(e)});mxUtils.get(n,mxUtils.bind(this,function(e){if(void 0!==mxUtils)if(e.isReady()&&404!=e.getStatus()){if(this.received+=e.getText().length,this.fireEvent(new mxEventObject(mxEvent.GET,"url",n,"request",e)),this.isValidResponse(e)){if(0<e.getText().length){var t=e.getDocumentElement();null==t?i("Invalid response: "+e.getText()):this.receive(t)}null!=a&&a(e)}}else i("Response not ready")}),function(e){i("Transmission error")})}},mxSession.prototype.isValidResponse=function(e){return e.getText().indexOf("<?php")<0},mxSession.prototype.encodeChanges=function(e,t){for(var n="",a=t?-1:1,i=t?e.length-1:0;0<=i&&i<e.length;i+=a){var s=this.codec.encode(e[i]);n=n+mxUtils.getXml(s,this.linefeed)}return n},mxSession.prototype.receive=function(e){if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){var t=e.getAttribute("namespace");for(null!=t&&(this.model.prefix=t+"-"),t=e.firstChild;null!=t;){var n=t.nodeName.toLowerCase();"state"==n?this.processState(t):"delta"==n&&this.processDelta(t),t=t.nextSibling}this.fireEvent(new mxEventObject(mxEvent.RECEIVE,"node",e))}},mxSession.prototype.processState=function(e){new mxCodec(e.ownerDocument).decode(e.firstChild,this.model)},mxSession.prototype.processDelta=function(e){for(e=e.firstChild;null!=e;)"edit"==e.nodeName&&this.processEdit(e),e=e.nextSibling},mxSession.prototype.processEdit=function(e){if(0<(e=this.decodeChanges(e)).length){var t=this.createUndoableEdit(e);this.model.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",e)),this.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)),this.fireEvent(new mxEventObject(mxEvent.FIRED,"edit",t))}},mxSession.prototype.createUndoableEdit=function(e){var t=new mxUndoableEdit(this.model,this.significantRemoteChanges);return t.changes=e,t.notify=function(){t.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",t,"changes",t.changes)),t.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",t,"changes",t.changes))},t},mxSession.prototype.decodeChanges=function(e){this.codec.document=e.ownerDocument;var t=[];for(e=e.firstChild;null!=e;){var n=this.decodeChange(e);null!=n&&t.push(n),e=e.nextSibling}return t},mxSession.prototype.decodeChange=function(e){var t=null;return e.nodeType==mxConstants.NODETYPE_ELEMENT&&(null!=(t="mxRootChange"==e.nodeName?new mxCodec(e.ownerDocument).decode(e):this.codec.decode(e))&&(t.model=this.model,t.execute(),"mxChildChange"==e.nodeName&&null==t.parent&&this.cellRemoved(t.child))),t},mxSession.prototype.cellRemoved=function(e,t){this.codec.putObject(e.getId(),e);for(var n=this.model.getChildCount(e),a=0;a<n;a++)this.cellRemoved(this.model.getChildAt(e,a))},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(e){this.changes.push(e)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length-1;0<=e;e--){var t=this.changes[e];null!=t.execute?t.execute():null!=t.undo&&t.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var e=this.changes.length,t=0;t<e;t++){var n=this.changes[t];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var e=this.history[--this.indexOfNextAdd];if(e.undo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var e=this.history.length;this.indexOfNextAdd<e;){var t=this.history[this.indexOfNextAdd++];if(t.redo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",t));break}}},mxUndoManager.prototype.undoableEditHappened=function(e){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(e),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",e))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var e=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),t=0;t<e.length;t++)e[t].die()};var mxUrlConverter=function(e){var n=!0,a=null,i=null;return{isEnabled:function(){return n},setEnabled:function(e){n=e},getBaseUrl:function(){return a},setBaseUrl:function(e){a=e},getBaseDomain:function(){return a},setBaseDomain:function(e){a=e},isRelativeUrl:function(e){return"http://"!=e.substring(0,7)&&"https://"!=e.substring(0,8)&&"data:image"!=e.substring(0,10)},convert:function(e){if(n&&this.isRelativeUrl(e)){if(null==a){i=location.protocol+"//"+location.host;var t=(a=i+location.pathname).lastIndexOf("/");0<t&&(a=a.substring(0,t+1))}e="/"==e.charAt(0)?i+e:a+e}return e}}};function mxPanningManager(s){this.thread=null,this.active=!1,this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0,this.scrollbars=!1,this.scrollTop=this.scrollLeft=0,this.mouseListener={mouseDown:function(e,t){},mouseMove:function(e,t){},mouseUp:mxUtils.bind(this,function(e,t){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-s.container.scrollLeft-Math.ceil(this.dx),t=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(e,t),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(e,t,n,a){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,a=null!=a?a:0;var i=s.container;this.dx=e+(null!=n?n:0)-i.scrollLeft-i.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.dx=this.handleMouseOut?Math.max(this.dx,0):0,0==this.dx&&(this.dx=e-i.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0),this.dy=t+a-i.scrollTop-i.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0,0==this.dy&&(this.dy=t-i.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=s.panDx,t=s.panDy;0==e&&0==t||(s.panGraph(0,0),s.view.setTranslate(this.t0x+e/s.view.scale,this.t0y+t/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener)}}function mxPopupMenu(e){null!=(this.factoryMethod=e)&&this.init()}function mxAutoSaveManager(e){this.changeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.graphModelChanged(t.getProperty("edit").changes)}),this.setGraph(e)}function mxAnimation(e){this.delay=null!=e?e:20}function mxMorphing(e,t,n,a){mxAnimation.call(this,a),this.graph=e,this.steps=null!=t?t:6,this.ease=null!=n?n:1.5}function mxImageBundle(e){this.images=[],this.alt=null!=e&&e}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(e){mxAbstractCanvas2D.call(this),this.root=e,this.writeDefaults()}function mxSvgCanvas2D(e,t){mxAbstractCanvas2D.call(this),this.root=e,this.gradients=[],this.defs=null,this.styleEnabled=null!=t&&t;var n=null;if(e.ownerDocument!=document)for(n=e;null!=n&&"svg"!=n.nodeName;)n=n.parentNode;null!=n&&(0<n.getElementsByTagName("defs").length&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(e){this.enabled=e},mxPopupMenu.prototype.isPopupTrigger=function(e){return e.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(e.getEvent())},mxPopupMenu.prototype.addItem=function(e,t,n,a,i,s){a=a||this,this.itemCount++,a.willAddSeparator&&(a.containsItems&&this.addSeparator(a,!0),a.willAddSeparator=!1),a.containsItems=!0;var o=document.createElement("tr");o.className="mxPopupMenuItem";var r=document.createElement("td");return r.className="mxPopupMenuIcon",null!=t?((i=document.createElement("img")).src=t,r.appendChild(i)):null!=i&&((t=document.createElement("div")).className=i,r.appendChild(t)),o.appendChild(r),this.labels&&((r=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),mxUtils.write(r,e),r.align="left",o.appendChild(r),(e=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" disabled"),e.style.paddingRight="6px",e.style.textAlign="right",o.appendChild(e),null==a.div&&this.createSubmenu(a)),a.tbody.appendChild(o),(null==s||s)&&(mxEvent.addGestureListeners(o,mxUtils.bind(this,function(e){this.eventReceiver=o,a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),mxEvent.consume(e)}),mxUtils.bind(this,function(e){a.activeRow!=o&&a.activeRow!=a&&(null!=a.activeRow&&null!=a.activeRow.div.parentNode&&this.hideSubmenu(a),this.autoExpand&&null!=o.div&&(this.showSubmenu(a,o),a.activeRow=o)),o.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(e){this.eventReceiver==o&&(a.activeRow!=o&&this.hideMenu(),null!=n&&n(e)),this.eventReceiver=null,mxEvent.consume(e)})),mxEvent.addListener(o,"mouseout",mxUtils.bind(this,function(e){o.className="mxPopupMenuItem"}))),o},mxPopupMenu.prototype.createSubmenu=function(e){e.table=document.createElement("table"),e.table.className="mxPopupMenu",e.tbody=document.createElement("tbody"),e.table.appendChild(e.tbody),e.div=document.createElement("div"),e.div.className="mxPopupMenu",e.div.style.position="absolute",e.div.style.display="inline",e.div.style.zIndex=this.zIndex,e.div.appendChild(e.table);var t=document.createElement("img");t.setAttribute("src",this.submenuImage),td=e.firstChild.nextSibling.nextSibling,td.appendChild(t)},mxPopupMenu.prototype.showSubmenu=function(e,t){if(null!=t.div){t.div.style.left=e.div.offsetLeft+t.offsetLeft+t.offsetWidth-1+"px",t.div.style.top=e.div.offsetTop+t.offsetTop+"px",document.body.appendChild(t.div);var n=parseInt(t.div.offsetLeft),a=parseInt(t.div.offsetWidth),i=document.body,s=document.documentElement;n+a>(i.scrollLeft||s.scrollLeft)+(i.clientWidth||s.clientWidth)&&(t.div.style.left=e.div.offsetLeft-a+(mxClient.IS_IE?6:-6)+"px"),mxUtils.fit(t.div)}},mxPopupMenu.prototype.addSeparator=function(e,t){if(e=e||this,this.smartSeparators&&!t)e.willAddSeparator=!0;else if(null!=e.tbody){e.willAddSeparator=!1;var n=document.createElement("tr"),a=document.createElement("td");a.className="mxPopupMenuIcon",a.style.padding="0 0 0 0px",n.appendChild(a),(a=document.createElement("td")).style.padding="0 0 0 0px",a.setAttribute("colSpan","2");var i=document.createElement("hr");i.setAttribute("size","1"),a.appendChild(i),n.appendChild(a),e.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(e,t,n,a){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=e+"px",this.div.style.top=t+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,a),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1)},mxPopupMenu.prototype.hideSubmenu=function(e){null!=e.activeRow&&(this.hideSubmenu(e.activeRow),null!=e.activeRow.div.parentNode&&e.activeRow.div.parentNode.removeChild(e.activeRow.div),e.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(e){this.enabled=e},mxAutoSaveManager.prototype.setGraph=function(e){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=e,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(e){(e=((new Date).getTime()-this.lastSnapshot)/1e3)>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){var e=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var t=0;t<this.cells.length;t++)this.animateCell(cells[t],e,!1);else this.animateCell(this.graph.getModel().getRoot(),e,!0);this.show(e),(e.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(e){e.show()},mxMorphing.prototype.animateCell=function(e,t,n){var a=this.graph.getView().getState(e),i=null;if(null!=a&&(i=this.getDelta(a),this.graph.getModel().isVertex(e)&&(0!=i.x||0!=i.y))){var s=this.graph.view.getTranslate(),o=this.graph.view.getScale();i.x+=s.x*o,i.y+=s.y*o,t.moveState(a,-i.x/this.ease,-i.y/this.ease)}if(n&&!this.stopRecursion(a,i))for(a=this.graph.getModel().getChildCount(e),i=0;i<a;i++)this.animateCell(this.graph.getModel().getChildAt(e,i),t,n)},mxMorphing.prototype.stopRecursion=function(e,t){return null!=t&&(0!=t.x||0!=t.y)},mxMorphing.prototype.getDelta=function(e){var t=this.getOriginForCell(e.cell),n=this.graph.getView().getTranslate(),a=this.graph.getView().getScale();return e=new mxPoint(e.x/a-n.x,e.y/a-n.y),new mxPoint((t.x-e.x)*a,(t.y-e.y)*a)},mxMorphing.prototype.getOriginForCell=function(e){var t=null;return null!=e&&(t=this.getOriginForCell(this.graph.getModel().getParent(e)),null!=(e=this.graph.getCellGeometry(e))&&(t.x+=e.x,t.y+=e.y)),null==t&&(t=new mxPoint(-(t=this.graph.view.getTranslate()).x,-t.y)),t},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(e,t,n){this.images[e]={value:t,fallback:n}},mxImageBundle.prototype.getImage=function(e){var t=null;return null!=e&&(null!=(e=this.images[e])&&(t=this.alt?e.fallback:e.value)),t},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(e,t){null!=e&&(this.visitStatesRecursive(e,t,this.drawCellState),this.includeOverlays&&this.visitStatesRecursive(e,t,this.drawOverlays))},mxImageExport.prototype.visitStatesRecursive=function(e,t,n){if(null!=e){n(e,t);for(var a=e.view.graph,i=a.model.getChildCount(e.cell),s=0;s<i;s++){var o=a.view.getState(a.model.getChildAt(e.cell,s));this.visitStatesRecursive(o,t,n)}}},mxImageExport.prototype.drawCellState=function(e,t){e.shape instanceof mxShape&&(t.save(),e.shape.paint(t),t.restore()),null!=e.text&&(t.save(),e.text.paint(t),t.restore())},mxImageExport.prototype.drawOverlays=function(e,n){null!=e.overlays&&e.overlays.visit(function(e,t){t instanceof mxShape&&t.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillColor:null,fillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(e){return Math.round(parseFloat(e))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var e=this.state,t=2;t<arguments.length;t+=2)this.lastX=arguments[t-1],this.lastY=arguments[t],this.path.push(this.format((this.lastX+e.dx)*e.scale)),this.path.push(this.format((this.lastY+e.dy)*e.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(e,t,n,a,i){return n*=Math.PI/180,mxUtils.getRotatedPoint(new mxPoint(e,t),Math.cos(n),Math.sin(n),new mxPoint(a,i))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){this.state=this.states.pop()},mxAbstractCanvas2D.prototype.scale=function(e){this.state.scale*=e,this.state.strokeWidth*=e},mxAbstractCanvas2D.prototype.translate=function(e,t){this.state.dx+=e,this.state.dy+=t},mxAbstractCanvas2D.prototype.setAlpha=function(e){this.state.alpha=e},mxAbstractCanvas2D.prototype.setFillColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fillColor=e,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(e,t,n,a,i,s,o,r,l){(n=this.state).fillColor=e,n.fillAlpha=null!=r?r:1,n.gradientColor=t,n.gradientAlpha=null!=l?l:1,n.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(e){e==mxConstants.NONE&&(e=null),this.state.strokeColor=e},mxAbstractCanvas2D.prototype.setStrokeWidth=function(e){this.state.strokeWidth=e},mxAbstractCanvas2D.prototype.setDashed=function(e){this.state.dashed=e},mxAbstractCanvas2D.prototype.setDashPattern=function(e){this.state.dashPattern=e},mxAbstractCanvas2D.prototype.setLineCap=function(e){this.state.lineCap=e},mxAbstractCanvas2D.prototype.setLineJoin=function(e){this.state.lineJoin=e},mxAbstractCanvas2D.prototype.setMiterLimit=function(e){this.state.miterLimit=e},mxAbstractCanvas2D.prototype.setFontColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontColor=e},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBackgroundColor=e},mxAbstractCanvas2D.prototype.setFontBorderColor=function(e){e==mxConstants.NONE&&(e=null),this.state.fontBorderColor=e},mxAbstractCanvas2D.prototype.setFontSize=function(e){this.state.fontSize=e},mxAbstractCanvas2D.prototype.setFontFamily=function(e){this.state.fontFamily=e},mxAbstractCanvas2D.prototype.setFontStyle=function(e){null==e&&(e=0),this.state.fontStyle=e},mxAbstractCanvas2D.prototype.setShadow=function(e){this.state.shadow=e},mxAbstractCanvas2D.prototype.setShadowColor=function(e){e==mxConstants.NONE&&(e=null),this.state.shadowColor=e},mxAbstractCanvas2D.prototype.setShadowAlpha=function(e){this.state.shadowAlpha=e},mxAbstractCanvas2D.prototype.setShadowOffset=function(e,t){this.state.shadowDx=e,this.state.shadowDy=t},mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(e,t){this.addOp(this.moveOp,e,t)},mxAbstractCanvas2D.prototype.lineTo=function(e,t){this.addOp(this.lineOp,e,t)},mxAbstractCanvas2D.prototype.quadTo=function(e,t,n,a){this.addOp(this.quadOp,e,t,n,a)},mxAbstractCanvas2D.prototype.curveTo=function(e,t,n,a,i,s){this.addOp(this.curveOp,e,t,n,a,i,s)},mxAbstractCanvas2D.prototype.arcTo=function(e,t,n,a,i,s,o){for(e=mxUtils.arcToCurves(this.lastX,this.lastY,e,t,n,a,i,s,o),t=0;t<e.length;t+=6)this.curveTo(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])},mxAbstractCanvas2D.prototype.close=function(e,t,n,a,i,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var e;(e=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(e),(e=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(e),(e=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(e),(e=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(e),(e=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),e.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(e)},mxXmlCanvas2D.prototype.format=function(e){return parseFloat(parseFloat(e).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(e){return this.root.ownerDocument.createElement(e)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(e){if(this.compressed){if(this.state.scale==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("scale");t.setAttribute("scale",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.translate=function(e,t){var n=this.createElement("translate");n.setAttribute("dx",this.format(e)),n.setAttribute("dy",this.format(t)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(e,t,n,a,i){var s=this.createElement("rotate");(0!=e||t||n)&&(s.setAttribute("theta",this.format(e)),s.setAttribute("flipH",t?"1":"0"),s.setAttribute("flipV",n?"1":"0"),s.setAttribute("cx",this.format(a)),s.setAttribute("cy",this.format(i)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(e){if(this.compressed){if(this.state.alpha==e)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var t=this.createElement("alpha");t.setAttribute("alpha",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFillColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fillColor==e)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var t=this.createElement("fillcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setGradient=function(e,t,n,a,i,s,o,r,l){if(null!=e&&null!=t){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var d=this.createElement("gradient");d.setAttribute("c1",e),d.setAttribute("c2",t),d.setAttribute("x",this.format(n)),d.setAttribute("y",this.format(a)),d.setAttribute("w",this.format(i)),d.setAttribute("h",this.format(s)),null!=o&&d.setAttribute("direction",o),null!=r&&d.setAttribute("alpha1",r),null!=l&&d.setAttribute("alpha2",l),this.root.appendChild(d)}},mxXmlCanvas2D.prototype.setStrokeColor=function(e){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.strokeColor==e)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var t=this.createElement("strokecolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setStrokeWidth=function(e){if(this.compressed){if(this.state.strokeWidth==e)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var t=this.createElement("strokewidth");t.setAttribute("width",this.format(e)),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashed=function(e){if(this.compressed){if(this.state.dashed==e)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var t=this.createElement("dashed");t.setAttribute("dashed",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setDashPattern=function(e){if(this.compressed){if(this.state.dashPattern==e)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var t=this.createElement("dashpattern");t.setAttribute("pattern",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineCap=function(e){if(this.compressed){if(this.state.lineCap==e)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var t=this.createElement("linecap");t.setAttribute("cap",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setLineJoin=function(e){if(this.compressed){if(this.state.lineJoin==e)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var t=this.createElement("linejoin");t.setAttribute("join",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setMiterLimit=function(e){if(this.compressed){if(this.state.miterLimit==e)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var t=this.createElement("miterlimit");t.setAttribute("limit",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setFontColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontColor==e)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var t=this.createElement("fontcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBackgroundColor==e)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var t=this.createElement("fontbackgroundcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(e){if(this.textEnabled){if(e==mxConstants.NONE&&(e=null),this.compressed){if(this.state.fontBorderColor==e)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var t=this.createElement("fontbordercolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontSize=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==e)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var t=this.createElement("fontsize");t.setAttribute("size",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontFamily=function(e){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==e)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var t=this.createElement("fontfamily");t.setAttribute("family",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setFontStyle=function(e){if(this.textEnabled){if(null==e&&(e=0),this.compressed){if(this.state.fontStyle==e)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var t=this.createElement("fontstyle");t.setAttribute("style",e),this.root.appendChild(t)}},mxXmlCanvas2D.prototype.setShadow=function(e){if(this.compressed){if(this.state.shadow==e)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var t=this.createElement("shadow");t.setAttribute("enabled",e?"1":"0"),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowColor=function(e){if(this.compressed){if(e==mxConstants.NONE&&(e=null),this.state.shadowColor==e)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var t=this.createElement("shadowcolor");t.setAttribute("color",null!=e?e:mxConstants.NONE),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowAlpha=function(e){if(this.compressed){if(this.state.shadowAlpha==e)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var t=this.createElement("shadowalpha");t.setAttribute("alpha",e),this.root.appendChild(t)},mxXmlCanvas2D.prototype.setShadowOffset=function(e,t){if(this.compressed){if(this.state.shadowDx==e&&this.state.shadowDy==t)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",e),n.setAttribute("dy",t),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(e,t,n,a){var i=this.createElement("rect");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(e)),o.setAttribute("y",this.format(t)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(a)),o.setAttribute("dx",this.format(i)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.createElement("ellipse");i.setAttribute("x",this.format(e)),i.setAttribute("y",this.format(t)),i.setAttribute("w",this.format(n)),i.setAttribute("h",this.format(a)),this.root.appendChild(i)},mxXmlCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){i=this.converter.convert(i);var l=this.createElement("image");l.setAttribute("x",this.format(e)),l.setAttribute("y",this.format(t)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(a)),l.setAttribute("src",i),l.setAttribute("aspect",s?"1":"0"),l.setAttribute("flipH",o?"1":"0"),l.setAttribute("flipV",r?"1":"0"),this.root.appendChild(l)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastY=this.lastX=0},mxXmlCanvas2D.prototype.moveTo=function(e,t){var n=this.createElement("move");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.lineTo=function(e,t){var n=this.createElement("line");n.setAttribute("x",this.format(e)),n.setAttribute("y",this.format(t)),this.root.appendChild(n),this.lastX=e,this.lastY=t},mxXmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.createElement("quad");i.setAttribute("x1",this.format(e)),i.setAttribute("y1",this.format(t)),i.setAttribute("x2",this.format(n)),i.setAttribute("y2",this.format(a)),this.root.appendChild(i),this.lastX=n,this.lastY=a},mxXmlCanvas2D.prototype.curveTo=function(e,t,n,a,i,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(e)),o.setAttribute("y1",this.format(t)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(a)),o.setAttribute("x3",this.format(i)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=i,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){mxUtils.isNode(i)&&(i=mxUtils.getOuterHtml(i));var u=this.createElement("text");u.setAttribute("x",this.format(e)),u.setAttribute("y",this.format(t)),u.setAttribute("w",this.format(n)),u.setAttribute("h",this.format(a)),u.setAttribute("str",i),null!=s&&u.setAttribute("align",s),null!=o&&u.setAttribute("valign",o),u.setAttribute("wrap",r?"1":"0"),null==l&&(l=""),u.setAttribute("format",l),null!=d&&u.setAttribute("fill",d?"1":"0"),null!=c&&u.setAttribute("clip",c?"1":"0"),null!=m&&u.setAttribute("rotation",m),this.root.appendChild(u)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(e){return(e=this.createElement("style")).setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(e,t){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(t||mxConstants.NS_SVG,e);var n=this.root.ownerDocument.createElement(e);return null!=t&&n.setAttribute("xmlns",t),n},mxSvgCanvas2D.prototype.createGradientId=function(e,t,n,a,i){return"#"==e.charAt(0)&&(e=e.substring(1)),"#"==t.charAt(0)&&(t=t.substring(1)),e=e.toLowerCase()+"-"+n,t=t.toLowerCase()+"-"+a,(n=null)==i||i==mxConstants.DIRECTION_SOUTH?n="s":i==mxConstants.DIRECTION_EAST?n="e":(a=e,e=t,t=a,i==mxConstants.DIRECTION_NORTH?n="s":i==mxConstants.DIRECTION_WEST&&(n="e")),"mx-gradient-"+e+"-"+t+"-"+n},mxSvgCanvas2D.prototype.getSvgGradient=function(e,t,n,a,i){var s=this.createGradientId(e,t,n,a,i),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,l=0,d=s+"-"+l;if(null!=r)for(o=r.ownerDocument.getElementById(d);null!=o&&o.ownerSVGElement!=r;)d=s+"-"+l++,o=r.ownerDocument.getElementById(d);else d="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(e,t,n,a,i)).setAttribute("id",d),null!=this.defs?this.defs.appendChild(o):r.appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(e,t,n,a,i){var s=this.createElement("linearGradient");return s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==i||i==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):i==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):i==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):i==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%"),n=n<1?";stop-opacity:"+n:"",(i=this.createElement("stop")).setAttribute("offset","0%"),i.setAttribute("style","stop-color:"+e+n),s.appendChild(i),n=a<1?";stop-opacity:"+a:"",(i=this.createElement("stop")).setAttribute("offset","100%"),i.setAttribute("style","stop-color:"+t+n),s.appendChild(i),s},mxSvgCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}e&&null!=a.fillColor?this.updateFill():this.styleEnabled||("ellipse"!=n.nodeName||!mxClient.IS_NS||mxClient.IS_GC||mxClient.IS_SF?n.setAttribute("fill","none"):n.setAttribute("fill","transparent"),e=!1),t&&null!=a.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=a.transform&&0<a.transform.length&&n.setAttribute("transform",a.transform),a.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!e&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents&&("path"!=n.nodeName||this.path[this.path.length-1]==this.closeOp)&&n.setAttribute("pointer-events","all"),this.root.appendChild(n)}},mxSvgCanvas2D.prototype.updateFill=function(){var e=this.state;e.alpha<1&&this.node.setAttribute("fill-opacity",e.alpha),null!=e.fillColor&&(null!=e.gradientColor?(e=this.getSvgGradient(e.fillColor,e.gradientColor,e.fillAlpha,e.gradientAlpha,e.gradientDirection),this.node.setAttribute("fill","url(#"+e+")")):this.node.setAttribute("fill",e.fillColor.toLowerCase()))},mxSvgCanvas2D.prototype.updateStroke=function(){var e=this.state;this.node.setAttribute("stroke",e.strokeColor.toLowerCase()),e.alpha<1&&this.node.setAttribute("stroke-opacity",e.alpha);var t=Math.max(1,this.format(e.strokeWidth*e.scale));1!=t&&this.node.setAttribute("stroke-width",t),"path"==this.node.nodeName&&this.updateStrokeAttributes(),e.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern(t))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var e=this.state;if(null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap){var t=e.lineCap;"flat"==t&&(t="butt"),"butt"!=t&&this.node.setAttribute("stroke-linecap",t)}null!=e.miterLimit&&(!this.styleEnabled||10!=e.miterLimit)&&this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(e){var t=this.state.dashPattern.split(" "),n=[];if(0<t.length)for(var a=0;a<t.length;a++)n[a]=Number(t[a])*e;return n.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(e){e=e.cloneNode(!0);var t=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",t),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OP?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(e){e=e.cloneNode(!0);var t=this.state;return"none"!=e.getAttribute("fill")&&e.setAttribute("fill",t.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",t.shadowColor),e.setAttribute("transform","translate("+this.format(t.shadowDx*t.scale)+","+this.format(t.shadowDy*t.scale)+")"+(t.transform||"")),e.setAttribute("opacity",t.shadowAlpha),e},mxSvgCanvas2D.prototype.rotate=function(e,t,n,a,i){if(0!=e||t||n){var s=this.state;if(a+=s.dx,i+=s.dy,a*=s.scale,i*=s.scale,s.transform=s.transform||"",t&&n)e+=180;else if(t^n){var o=t?a:0,r=t?-1:1,l=n?i:0,d=n?-1:1;s.transform+="translate("+this.format(o)+","+this.format(l)+")scale("+this.format(r)+","+this.format(d)+")translate("+this.format(-o)+","+this.format(-l)+")"}(t?!n:n)&&(e*=-1),0!=e&&(s.transform+="rotate("+this.format(e)+","+this.format(a)+","+this.format(i)+")"),s.rotation+=e,s.rotationCx=a,s.rotationCy=i}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(e,t,n,a){var i=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((e+i.dx)*i.scale)),s.setAttribute("y",this.format((t+i.dy)*i.scale)),s.setAttribute("width",this.format(n*i.scale)),s.setAttribute("height",this.format(a*i.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){this.rect(e,t,n,a),0<i&&this.node.setAttribute("rx",this.format(i*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(e,t,n,a){var i=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((e+n/2+i.dx)*i.scale)),s.setAttribute("cy",Math.round((t+a/2+i.dy)*i.scale)),s.setAttribute("rx",n/2*i.scale),s.setAttribute("ry",a/2*i.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){i=this.converter.convert(i),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var l=this.state;e+=l.dx,t+=l.dy;var d=this.createElement("image");if(d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),null==d.setAttributeNS?d.setAttribute("xlink:href",i):d.setAttributeNS(mxConstants.NS_XLINK,"href",i),s||d.setAttribute("preserveAspectRatio","none"),l.alpha<1&&d.setAttribute("opacity",l.alpha),i=this.state.transform||"",o||r){var c=s=1,m=0,u=0;o&&(s=-1,m=-n-2*e),r&&(c=-1,u=-a-2*t),i+="scale("+s+","+c+")translate("+m+","+u+")"}0<i.length&&d.setAttribute("transform",i),this.root.appendChild(d),this.blockImagePointerEvents&&(d.setAttribute("style","pointer-events:none"),(d=this.createElement("rect")).setAttribute("visibility","hidden"),d.setAttribute("pointer-events","fill"),d.setAttribute("x",this.format(e*l.scale)),d.setAttribute("y",this.format(t*l.scale)),d.setAttribute("width",this.format(n*l.scale)),d.setAttribute("height",this.format(a*l.scale)),this.root.appendChild(d))},mxSvgCanvas2D.prototype.createDiv=function(e,t,n,a,i){return n=this.state,a="display:inline-block;font-size:"+Math.round(n.fontSize)+"px;font-family:"+n.fontFamily+";color:"+n.fontColor+";line-height:"+Math.round(n.fontSize*mxConstants.LINE_HEIGHT)+"px;"+a,(n.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight:bold;"),(n.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a+="font-style:italic;"),(n.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a+="font-decoration:underline;"),t==mxConstants.ALIGN_CENTER?a+="text-align:center;":t==mxConstants.ALIGN_RIGHT&&(a+="text-align:right;"),t="",null!=n.fontBackgroundColor&&(t+="background-color:"+n.fontBackgroundColor+";"),null!=n.fontBorderColor&&(t+="border:1px solid "+n.fontBorderColor+";"),mxUtils.isNode(e)||((n=document.createElement("textarea")).innerHTML=e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">"),e=n.value,i?a+=t:0<t.length&&(e='<div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;'+t+'">'+e+"</div>")),!mxClient.IS_IE&&document.createElementNS?((i=document.createElementNS("http://www.w3.org/1999/xhtml","div")).setAttribute("style",a),mxUtils.isNode(e)?this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e):i.innerHTML=e,i):(mxUtils.isNode(e)&&this.root.ownerDocument!=document&&(e=e.outerHTML),e=e.replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+a+'">'+e+"</div>").documentElement)},mxSvgCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){m=null!=m?m:0;var u=this.state;if(e+=u.dx,t+=u.dy,this.foEnabled&&"html"==l){var p="vertical-align:top;";if(c?(p+="overflow:hidden;",0<a&&(p+="max-height:"+Math.round(a)+"px;"),0<n&&(p+="width:"+Math.round(n)+"px;")):d&&(p+="width:"+Math.round(n)+"px;",0<a&&(p+="max-height:"+Math.round(a)+"px;")),r?(!c&&0<n&&(p+="width:"+Math.round(n)+"px;"),p+="white-space:normal;"):p+="white-space:nowrap;",r=this.createElement("g"),u.alpha<1&&r.setAttribute("opacity",u.alpha),(l=this.createElement("foreignObject")).setAttribute("pointer-events","all"),null!=(p=this.createDiv(i,s,o,p,d))){r.appendChild(l),this.root.appendChild(r);var g=0;if(mxClient.IS_IE&&!mxClient.IS_SVG){var v=document.createElement("div");v.style.cssText=p.getAttribute("style"),v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",v.style.visibility="hidden",v.innerHTML=mxUtils.isNode(i)?i.outerHTML:i,document.body.appendChild(v),g=v.offsetWidth,a=mxClient.IS_QUIRKS&&0<a&&c?Math.min(a,v.offsetHeight+2):v.offsetHeight,v.parentNode.removeChild(v),l.appendChild(p)}else this.root.ownerDocument!=document?(p.style.visibility="hidden",document.body.appendChild(p),g=p.offsetWidth,a=p.offsetHeight,l.appendChild(p),p.style.visibility=""):(l.appendChild(p),g=p.offsetWidth,a=p.offsetHeight);n=d?Math.max(n,g):g,u.alpha<1&&r.setAttribute("opacity",u.alpha),d=i=0,s==mxConstants.ALIGN_CENTER?i-=n/2:s==mxConstants.ALIGN_RIGHT&&(i-=n),e+=i,o==mxConstants.ALIGN_MIDDLE?d-=a/2:o==mxConstants.ALIGN_BOTTOM&&(d-=a),t+=d,s=1!=u.scale?"scale("+u.scale+")":"",0!=u.rotation&&this.rotateHtml?(s+="rotate("+u.rotation+","+n/2+","+a/2+")",e=(t=this.rotatePoint((e+n/2)*u.scale,(t+a/2)*u.scale,u.rotation,u.rotationCx,u.rotationCy)).x-n*u.scale/2,t=t.y-a*u.scale/2):(e*=u.scale,t*=u.scale),0!=m&&(s+="rotate("+m+","+-i+","+-d+")"),r.setAttribute("transform","translate("+Math.round(e)+","+Math.round(t)+")"+s),l.setAttribute("width",Math.round(Math.max(1,n))),l.setAttribute("height",Math.round(Math.max(1,a)))}}else this.plainText(e,t,n,a,i,s,o,r,d,c,m)}},mxSvgCanvas2D.prototype.createClip=function(e,t,n,a){for(var i="mx-clip-"+(e=Math.round(e))+"-"+(t=Math.round(t))+"-"+(n=Math.round(n))+"-"+(a=Math.round(a)),s=0,o=i+"-"+s;null!=document.getElementById(o);)o=i+"-"+ ++s;return clip=this.createElement("clipPath"),clip.setAttribute("id",o),(i=this.createElement("rect")).setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("width",n),i.setAttribute("height",a),clip.appendChild(i),clip},mxSvgCanvas2D.prototype.plainText=function(e,t,n,a,i,s,o,r,l,d,c){c=null!=c?c:0,r=this.state;var m=Math.round(r.fontSize),u=this.createElement("g"),p=r.transform||"";if(0!=c&&(p+="rotate("+c+","+this.format(e*r.scale)+","+this.format(t*r.scale)+")"),d&&0<n&&0<a){var g=e;c=t,s==mxConstants.ALIGN_CENTER?g-=n/2:s==mxConstants.ALIGN_RIGHT&&(g-=n),o==mxConstants.ALIGN_MIDDLE?c-=a/2:o==mxConstants.ALIGN_BOTTOM&&(c-=a),c=this.createClip(g*r.scale-2,c*r.scale-2,n*r.scale+4,a*r.scale+4),null!=this.defs?this.defs.appendChild(c):this.root.appendChild(c),u.setAttribute("clip-path","url(#"+c.getAttribute("id")+")")}this.updateFont(u,s),"start"!=(c=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start")&&u.setAttribute("text-anchor",c),(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE)&&u.setAttribute("font-size",Math.round(m*r.scale)+"px"),0<p.length&&u.setAttribute("transform",p),r.alpha<1&&u.setAttribute("opacity",r.alpha);p=i.split("\n"),g=Math.round(m*mxConstants.LINE_HEIGHT);var v=m+(p.length-1)*g;for(c=t+m-1,o==mxConstants.ALIGN_MIDDLE?c-=(a=(this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)/2)+1:o==mxConstants.ALIGN_BOTTOM&&(c-=(a=this.matchHtmlAlignment&&d&&0<a?Math.min(v,a):v)+2),a=0;a<p.length;a++)0<p[a].length&&0<mxUtils.trim(p[a]).length&&((d=this.createElement("text")).setAttribute("x",this.format(e*r.scale)),d.setAttribute("y",this.format(c*r.scale)),mxUtils.write(d,p[a]),u.appendChild(d)),c+=g;this.root.appendChild(u),this.addTextBackground(u,i,e,t,n,v,s,o,l)},mxSvgCanvas2D.prototype.updateFont=function(e){var t=this.state;e.setAttribute("fill",t.fontColor),(!this.styleEnabled||t.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&e.setAttribute("font-family",t.fontFamily),(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&e.setAttribute("font-weight","bold"),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&e.setAttribute("font-style","italic"),(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(e,t,n,a,i,s,o,r,l){var d=this.state;if(null!=d.fontBackgroundColor||null!=d.fontBorderColor){var c=null;null!=(c=l?(o==mxConstants.ALIGN_CENTER?n-=i/2:o==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((n+1)*d.scale,a*d.scale,(i-2)*d.scale,(s+2)*d.scale)):null!=e.getBBox&&this.root.ownerDocument==document?(c=e.getBBox(),t=mxClient.IS_IE&&mxClient.IS_SVG,new mxRectangle(c.x,c.y+(t?0:1),c.width,c.height+(t?1:0))):((c=document.createElement("div")).style.lineHeight=Math.round(d.fontSize*mxConstants.LINE_HEIGHT)+"px",c.style.fontSize=Math.round(d.fontSize)+"px",c.style.fontFamily=d.fontFamily,c.style.whiteSpace="nowrap",c.style.position="absolute",c.style.visibility="hidden",c.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",c.style.zoom="1",(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle="italic"),t=mxUtils.htmlEntities(t,!1),c.innerHTML=t.replace(/\n/g,"<br/>"),document.body.appendChild(c),i=c.offsetWidth,s=c.offsetHeight,c.parentNode.removeChild(c),o==mxConstants.ALIGN_CENTER?n-=i/2:o==mxConstants.ALIGN_RIGHT&&(n-=i),r==mxConstants.ALIGN_MIDDLE?a-=s/2:r==mxConstants.ALIGN_BOTTOM&&(a-=s),new mxRectangle((n+1)*d.scale,(a+2)*d.scale,i*d.scale,(s+1)*d.scale)))&&((t=this.createElement("rect")).setAttribute("fill",d.fontBackgroundColor||"none"),t.setAttribute("stroke",d.fontBorderColor||"none"),t.setAttribute("x",Math.floor(c.x-1)),t.setAttribute("y",Math.floor(c.y-1)),t.setAttribute("width",Math.ceil(c.width+2)),t.setAttribute("height",Math.ceil(c.height)),d=null!=d.fontBorderColor?Math.max(1,this.format(d.scale)):0,t.setAttribute("stroke-width",d),this.root.ownerDocument==document&&1==mxUtils.mod(d,2)&&t.setAttribute("transform","translate(0.5, 0.5)"),e.insertBefore(t,e.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(e){mxAbstractCanvas2D.call(this),this.root=e};function mxGuide(e,t){this.graph=e,this.setStates(t)}function mxStencil(e){this.desc=e,this.parseDescription(),this.parseConstraints()}function mxShape(e){this.stencil=e,this.strokewidth=1,this.rotation=0,this.opacity=100,this.flipV=this.flipH=!1}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.addNode=function(e,t){var n=this.node,a=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,a.strokeWidth*a.scale/this.vmlScale))+"px",a.shadow&&this.root.appendChild(this.createShadow(n,e&&null!=a.fillColor,t&&null!=a.strokeColor)),t&&null!=a.strokeColor?(n.stroked="true",n.strokecolor=a.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),e&&null!=a.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.src=mxClient.imageBasePath+"/transparent.gif",e.type="tile",e},mxVmlCanvas2D.prototype.createFill=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":fill");if(t.color=e.fillColor,null!=e.gradientColor){t.type="gradient",t.method="none",t.color2=e.gradientColor;var n=180-e.rotation;n=e.gradientDirection==mxConstants.DIRECTION_WEST?n-(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_EAST?n+(90+("x"==this.root.style.flip?180:0)):e.gradientDirection==mxConstants.DIRECTION_NORTH?n-(180+("y"==this.root.style.flip?-180:0)):n+("y"==this.root.style.flip?-180:0);"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),t.angle=mxUtils.mod(n,360),t.opacity=100*e.alpha*e.fillAlpha+"%",t.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*e.alpha*e.gradientAlpha+"%")}else e.alpha<1&&(t.opacity=100*e.alpha+"%");return t},mxVmlCanvas2D.prototype.createStroke=function(){var e=this.state,t=document.createElement(mxClient.VML_PREFIX+":stroke");return t.endcap=e.lineCap||"flat",t.joinstyle=e.lineJoin||"miter",t.miterlimit=e.miterLimit||"10",e.alpha<1&&(t.opacity=100*e.alpha+"%"),e.dashed&&(t.dashstyle=this.getVmlDashStyle()),t},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var e="dash";if(null!=this.state.dashPattern){var t=this.state.dashPattern.split(" ");0<t.length&&1==t[0]&&(e="0 2")}return e},mxVmlCanvas2D.prototype.createShadow=function(e,t,n){var a=this.state,i=-a.rotation*(Math.PI/180),s=Math.cos(i),o=(i=Math.sin(i),a.shadowDx*a.scale),r=a.shadowDy*a.scale;"x"==this.root.style.flip?o*=-1:"y"==this.root.style.flip&&(r*=-1);var l=e.cloneNode(!0);return l.style.marginLeft=Math.round(o*s-r*i)+"px",l.style.marginTop=Math.round(o*i+r*s)+"px",8==document.documentMode&&(l.strokeweight=e.strokeweight,"shape"==e.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(e.style.width)+" "+parseInt(e.style.height))),n?(l.strokecolor=a.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",t?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var e=document.createElement(mxClient.VML_PREFIX+":fill");return e.color=this.state.shadowColor,e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.createShadowStroke=function(){var e=this.createStroke();return e.opacity=100*this.state.alpha*this.state.shadowAlpha+"%",e},mxVmlCanvas2D.prototype.rotate=function(e,t,n,a,i){t&&n?e+=180:t?this.root.style.flip="x":n&&(this.root.style.flip="y"),(t?!n:n)&&(e*=-1),this.root.style.rotation=e,this.state.rotation+=e,this.state.rotationCx=a,this.state.rotationCy=i},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=document.createElement(mxClient.VML_PREFIX+":shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(e,t,n,a){var i=this.state,s=(this.lastX+i.dx)*i.scale,o=(this.lastY+i.dy)*i.scale;e=(e+i.dx)*i.scale;o+=2/3*((t=(t+i.dy)*i.scale)-o);var r=(n=(n+i.dx)*i.scale)+2/3*(e-n);t=(a=(a+i.dy)*i.scale)+2/3*(t-a),this.path.push("c "+this.format(s+2/3*(e-s))+" "+this.format(o)+" "+this.format(r)+" "+this.format(t)+" "+this.format(n)+" "+this.format(a)),this.lastX=n/i.scale-i.dx,this.lastY=a/i.scale-i.dy},mxVmlCanvas2D.prototype.createRect=function(e,t,n,a,i){var s=this.state;return(e=document.createElement(e)).style.position="absolute",e.style.left=this.format((t+s.dx)*s.scale)+"px",e.style.top=this.format((n+s.dy)*s.scale)+"px",e.style.width=this.format(a*s.scale)+"px",e.style.height=this.format(i*s.scale)+"px",e},mxVmlCanvas2D.prototype.rect=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)},mxVmlCanvas2D.prototype.roundrect=function(e,t,n,a,i,s){this.node=this.createRect(mxClient.VML_PREFIX+":roundrect",e,t,n,a),this.node.setAttribute("arcsize",Math.max(100*i/n,100*s/a)+"%")},mxVmlCanvas2D.prototype.ellipse=function(e,t,n,a){this.node=this.createRect(mxClient.VML_PREFIX+":oval",e,t,n,a)},mxVmlCanvas2D.prototype.image=function(e,t,n,a,i,s,o,r){var l=null;s?((l=this.createRect(mxClient.VML_PREFIX+":rect",e,t,n,a)).stroked="false",(e=document.createElement(mxClient.VML_PREFIX+":fill")).aspect=s?"atmost":"ignore",e.rotate="true",e.type="frame",e.src=i,l.appendChild(e)):(l=this.createRect(mxClient.VML_PREFIX+":image",e,t,n,a)).src=i,o&&r?l.style.rotation="180":o?l.style.flip="x":r&&(l.style.flip="y"),this.state.alpha<1&&(l.style.filter+="alpha(opacity="+100*this.state.alpha+")"),this.root.appendChild(l)},mxVmlCanvas2D.prototype.createDiv=function(e,t,n,a){n=document.createElement("div");var i=this.state,s="";return null!=i.fontBackgroundColor&&(s+="background-color:"+i.fontBackgroundColor+";"),null!=i.fontBorderColor&&(s+="border:1px solid "+i.fontBorderColor+";"),mxUtils.isNode(e)?n.appendChild(e):0<s.length&&!a?((a=document.createElement("div")).style.cssText=s,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.innerHTML=e,n.appendChild(a)):(n.style.cssText=s,n.innerHTML=e),(e=n.style).fontSize=Math.round(i.fontSize/this.vmlScale)+"px",e.fontFamily=i.fontFamily,e.color=i.fontColor,e.verticalAlign="top",e.textAlign=t||"left",e.lineHeight=Math.round(i.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale)+"px",(i.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e.fontWeight="bold"),(i.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e.fontStyle="italic"),(i.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(e.fontDecoration="underline"),n},mxVmlCanvas2D.prototype.text=function(e,t,n,a,i,s,o,r,l,d,c,m){if(this.textEnabled&&null!=i){var u=this.state;if("html"==l){null!=u.rotation&&(e=(t=this.rotatePoint(e,t,u.rotation,u.rotationCx,u.rotationCy)).x,t=t.y),8==document.documentMode?(e+=u.dx,t+=u.dy):(e*=u.scale,t*=u.scale),(l=8==document.documentMode?document.createElement(mxClient.VML_PREFIX+":group"):document.createElement("div")).style.position="absolute",l.style.display="inline",l.style.left=this.format(e)+"px",l.style.top=this.format(t)+"px",l.style.zoom=u.scale;var p=document.createElement("div");p.style.position="relative",p.style.display="inline";var g=(v=mxUtils.getAlignmentAsPoint(s,o)).x,v=v.y;if(i=this.createDiv(i,s,o,d),s=document.createElement("div"),r?(!c&&0<n&&(i.style.width=Math.round(n)+"px"),i.style.whiteSpace="normal"):i.style.whiteSpace="nowrap",r=u.rotation+(m||0),this.rotateHtml&&0!=r?(s.style.display="inline",s.style.zoom="1",s.appendChild(i),8==document.documentMode&&"DIV"!=this.root.nodeName?(p.appendChild(s),l.appendChild(p)):l.appendChild(s)):8==document.documentMode?(p.appendChild(i),l.appendChild(p)):(i.style.display="inline",l.appendChild(i)),"DIV"!=this.root.nodeName?((m=document.createElement(mxClient.VML_PREFIX+":rect")).stroked="false",m.filled="false",m.appendChild(l),this.root.appendChild(m)):this.root.appendChild(l),c?(i.style.overflow="hidden",0<n&&(i.style.width=Math.round(n)+"px"),0<a&&8==document.documentMode&&(i.style.maxHeight=Math.round(a)+"px")):d&&(i.style.width=n+"px",0<a&&(i.style.maxHeight=Math.round(a)+"px")),this.rotateHtml&&0!=r){n=r*(Math.PI/180),r=parseFloat(parseFloat(Math.cos(n)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-n)).toFixed(8)),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(n%=Math.PI)>Math.PI/2&&(n=Math.PI-n),o=Math.cos(n);var h=Math.sin(n);8==document.documentMode&&(i.style.display="inline-block",s.style.display="inline-block",p.style.display="inline-block"),i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&(c||d)&&a<p&&(p=a,i.style.height=p+"px"),c=((a=p)-a*o+n*-h)/2-m*n*(g+.5)+r*a*(v+.5),d=(n-n*o+a*-h)/2+r*n*(g+.5)+m*a*(v+.5),"group"==l.nodeName&&"DIV"==this.root.nodeName?((g=document.createElement("div")).style.display="inline-block",g.style.position="absolute",g.style.left=this.format(e+(d-n/2)*u.scale)+"px",g.style.top=this.format(t+(c-a/2)*u.scale)+"px",l.parentNode.appendChild(g),g.appendChild(l)):(u=8==document.documentMode?1:u.scale,l.style.left=this.format(e+(d-n/2)*u)+"px",l.style.top=this.format(t+(c-a/2)*u)+"px"),s.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+m+", M21="+-m+", M22="+r+", sizingMethod='auto expand')",s.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(s.style.filter+="alpha(opacity="+100*this.state.alpha+")"),i.style.visibility="",s.appendChild(i)}else 8!=document.documentMode?(i.style.verticalAlign="top",this.state.alpha<1&&(l.style.filter="alpha(opacity="+100*this.state.alpha+")"),u=i.parentNode,i.style.visibility="hidden",document.body.appendChild(i),n=i.offsetWidth,p=i.offsetHeight,mxClient.IS_QUIRKS&&c&&a<p&&(p=a,i.style.height=p+"px"),a=p,i.style.visibility="",u.appendChild(i),l.style.left=this.format(e+n*g*this.state.scale)+"px",l.style.top=this.format(t+a*v*this.state.scale)+"px"):(this.state.alpha<1&&(i.style.filter="alpha(opacity="+100*this.state.alpha+")"),p.style.left=100*g+"%",p.style.top=100*v+"%")}else this.plainText(e,t,n,a,mxUtils.htmlEntities(i,!1),s,o,r,l,d,c,m)}},mxVmlCanvas2D.prototype.plainText=function(e,t,n,a,i,s,o,r,l,d,c,m){e=(e+(a=this.state).dx)*a.scale,t=(t+a.dy)*a.scale,(n=document.createElement(mxClient.VML_PREFIX+":shape")).style.width="1px",n.style.height="1px",n.stroked="false",(d=document.createElement(mxClient.VML_PREFIX+":fill")).color=a.fontColor,d.opacity=100*a.alpha+"%",n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":path")).textpathok="true",d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),n.appendChild(d),(d=document.createElement(mxClient.VML_PREFIX+":textpath")).style.cssText="v-text-align:"+s,d.style.align=s,d.style.fontFamily=a.fontFamily,d.string=i,d.on="true",s=Math.round(a.fontSize*a.scale/this.vmlScale),d.style.fontSize=s+"px",(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline"),a=s+((i=i.split("\n")).length-1)*s*mxConstants.LINE_HEIGHT,s=i=0,o==mxConstants.ALIGN_BOTTOM?s=-a/2:o!=mxConstants.ALIGN_MIDDLE&&(s=a/2),null!=m&&(o=(n.style.rotation=m)*(Math.PI/180),i=Math.sin(o)*s,s*=Math.cos(o)),n.appendChild(d),n.style.left=this.format(e-i)+"px",n.style.top=this.format(t+s)+"px",this.root.appendChild(n)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(e){this.states=e},mxGuide.prototype.isEnabledForEvent=function(e){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxGuide.prototype.createGuideShape=function(e){return(e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)).isDashed=!0,e},mxGuide.prototype.move=function(a,e,t){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=e){var n=this.graph.getView().translate,i=this.graph.getView().scale,s=e.x,o=e.y,r=!1,l=!1,d=f=this.getGuideTolerance(),c=f;(f=a.clone()).x+=e.x,f.y+=e.y;var m=f.x,u=f.x+f.width,p=f.getCenterX(),g=f.y,v=f.y+f.height,h=f.getCenterY();e=function(e){e+=this.graph.panDx;var t=!1;if(Math.abs(e-p)<d?(s=e-a.getCenterX(),d=Math.abs(e-p),t=!0):Math.abs(e-m)<d?(s=e-a.x,d=Math.abs(e-m),t=!0):Math.abs(e-u)<d&&(s=e-a.x-a.width,d=Math.abs(e-u),t=!0),t){null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDx,this.guideX.points=[new mxPoint(e,-this.graph.panDy),new mxPoint(e,n.scrollHeight-3-this.graph.panDy)]}r=r||t};for(var f=function(e){e+=this.graph.panDy;var t=!1;if(Math.abs(e-h)<c?(o=e-a.getCenterY(),c=Math.abs(e-h),t=!0):Math.abs(e-g)<c?(o=e-a.y,c=Math.abs(e-g),t=!0):Math.abs(e-v)<c&&(o=e-a.y-a.height,c=Math.abs(e-v),t=!0),t){null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()));var n=this.graph.container;e-=this.graph.panDy,this.guideY.points=[new mxPoint(-this.graph.panDx,e),new mxPoint(n.scrollWidth-3-this.graph.panDx,e)]}l=l||t},b=0;b<this.states.length;b++){var E=this.states[b];null!=E&&(this.horizontal&&(e.call(this,E.getCenterX()),e.call(this,E.x),e.call(this,E.x+E.width)),this.vertical&&(f.call(this,E.getCenterY()),f.call(this,E.y),f.call(this,E.y+E.height)))}r||null==this.guideX?null!=this.guideX&&(this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",l||null==this.guideY?null!=this.guideY&&(this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",t&&(r||(t=a.x-(this.graph.snap(a.x/i-n.x)+n.x)*i,s=this.graph.snap(s/i)*i-t),l||(n=a.y-(this.graph.snap(a.y/i-n.y)+n.y)*i,o=this.graph.snap(o/i)*i-n)),e=new mxPoint(s,o)}return e},mxGuide.prototype.hide=function(){null!=this.guideX&&(this.guideX.node.style.visibility="hidden"),null!=this.guideY&&(this.guideY.node.style.visibility="hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxStencil.defaultLocalized=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var e=this.desc.getAttribute("aspect");this.aspect=null!=e?e:"variable",e=this.desc.getAttribute("strokewidth"),this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var e=this.desc.getElementsByTagName("connections")[0];if(null!=e&&(null!=(e=mxUtils.getChildNodes(e))&&0<e.length)){this.constraints=[];for(var t=0;t<e.length;t++)this.constraints.push(this.parseConstraint(e[t]))}},mxStencil.prototype.parseConstraint=function(e){var t=Number(e.getAttribute("x")),n=Number(e.getAttribute("y"));return e="1"==e.getAttribute("perimeter"),new mxConnectionConstraint(new mxPoint(t,n),e)},mxStencil.prototype.evaluateTextAttribute=function(e,t,n){return t=this.evaluateAttribute(e,t,n),e=e.getAttribute("localized"),(mxStencil.defaultLocalized&&null==e||"1"==e)&&(t=mxResources.get(t)),t},mxStencil.prototype.evaluateAttribute=function(e,t,n){return null==(t=e.getAttribute(t))&&(null!=(e=mxUtils.getTextContent(e))&&("function"==typeof(e=mxUtils.eval(e))&&(t=e(n)))),t},mxStencil.prototype.drawShape=function(e,t,n,a,i,s){this.drawChildren(e,t,n,a,i,s,this.bgNode,!1),this.drawChildren(e,t,n,a,i,s,this.fgNode,!0)},mxStencil.prototype.drawChildren=function(e,t,n,a,i,s,o,r){if(null!=o){var l=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,null);for(n=this.computeAspect(t.style,n,a,i,s,l),a=Math.min(n.width,n.height),a="inherit"==this.strokewidth?Number(mxUtils.getNumber(t.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a,e.setStrokeWidth(a),o=o.firstChild;null!=o;)o.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,o,n,r),o=o.nextSibling}},mxStencil.prototype.computeAspect=function(e,t,n,a,i,s){e=t,t=a/this.w0;var o=i/this.h0;if(s="north"==s||"south"==s){o=a/this.h0,t=i/this.w0;var r=(a-i)/2;e+=r,n-=r}return"fixed"==this.aspect&&(t=o=Math.min(t,o),s?(e+=(i-this.w0*t)/2,n+=(a-this.h0*o)/2):(e+=(a-this.w0*t)/2,n+=(i-this.h0*o)/2)),new mxRectangle(e,n,t,o)},mxStencil.prototype.drawNode=function(e,t,n,a,i){var s=n.nodeName,o=a.x,r=a.y,l=a.width,d=a.height,c=Math.min(l,d);if("save"==s)e.save();else if("restore"==s)e.restore();else if("path"==s)for(e.begin(),n=n.firstChild;null!=n;)n.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(e,t,n,a,i),n=n.nextSibling;else if("close"==s)e.close();else if("move"==s)e.moveTo(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("line"==s)e.lineTo(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("quad"==s)e.quadTo(o+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,o+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d);else if("curve"==s)e.curveTo(o+Number(n.getAttribute("x1"))*l,r+Number(n.getAttribute("y1"))*d,o+Number(n.getAttribute("x2"))*l,r+Number(n.getAttribute("y2"))*d,o+Number(n.getAttribute("x3"))*l,r+Number(n.getAttribute("y3"))*d);else if("arc"==s)e.arcTo(Number(n.getAttribute("rx"))*l,Number(n.getAttribute("ry"))*d,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d);else if("rect"==s)e.rect(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("roundrect"==s)0==(t=n.getAttribute("arcsize"))&&(t=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,t=Number(t)/100,t=Math.min(c*t,a*t),e.roundrect(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,c,a,t,t);else if("ellipse"==s)e.ellipse(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d);else if("image"==s)t=this.evaluateAttribute(n,"src",t),e.image(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*l,Number(n.getAttribute("h"))*d,t,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"));else if("text"==s){if(c=this.evaluateTextAttribute(n,"str",t),a="1"==n.getAttribute("vertical")?-90:0,"0"==n.getAttribute("align-shape")){var m=t.rotation,u=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0);t=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),a=u&&t?a-m:u||t?a+m:a-m}a-=n.getAttribute("rotation"),e.text(o+Number(n.getAttribute("x"))*l,r+Number(n.getAttribute("y"))*d,0,0,c,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",!1,!1,a)}else if("include-shape"==s)null!=(m=mxStencilRegistry.getStencil(n.getAttribute("name")))&&(o+=Number(n.getAttribute("x"))*l,r+=Number(n.getAttribute("y"))*d,c=Number(n.getAttribute("w"))*l,a=Number(n.getAttribute("h"))*d,m.drawShape(e,t,o,r,c,a));else if("fillstroke"==s)e.fillAndStroke();else if("fill"==s)e.fill();else if("stroke"==s)e.stroke();else if("strokewidth"==s)e.setStrokeWidth(Number(n.getAttribute("width"))*c);else if("dashed"==s)e.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==s){if(null!=(n=n.getAttribute("pattern"))){for(n=n.split(" "),l=[],d=0;d<n.length;d++)0<n[d].length&&l.push(Number(n[d])*c);n=l.join(" "),e.setDashPattern(n)}}else"strokecolor"==s?e.setStrokeColor(n.getAttribute("color")):"linecap"==s?e.setLineCap(n.getAttribute("cap")):"linejoin"==s?e.setLineJoin(n.getAttribute("join")):"miterlimit"==s?e.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==s?e.setFillColor(n.getAttribute("color")):"alpha"==s?e.setAlpha(n.getAttribute("alpha")):"fontcolor"==s?e.setFontColor(n.getAttribute("color")):"fontstyle"==s?e.setFontStyle(n.getAttribute("style")):"fontfamily"==s?e.setFontFamily(n.getAttribute("family")):"fontsize"==s&&e.setFontSize(Number(n.getAttribute("size"))*c);i&&("fillstroke"==s||"fill"==s||"stroke"==s)&&e.setShadow(!1)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.style=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=6,mxShape.prototype.pointerEvents=!0,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.init=function(e){null==this.node&&(this.node=this.create(e),null!=e&&e.appendChild(this.node))},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round(this.strokewidth*this.scale)),2)?.5:0},mxShape.prototype.create=function(e){return null!=e.ownerSVGElement?this.createSvg(e):8==document.documentMode||this.dialect==mxConstants.DIALECT_SVG||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(e):this.createVml(e)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e},mxShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.checkBounds()?(this.node.style.visibility="","DIV"==this.node.nodeName&&this.isHtmlAllowed()?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.updateBoundsFromPoints=function(){var e=this.points;if(null!=e&&0<e.length&&null!=e[0]){this.bounds=new mxRectangle(Number(e[0].x),Number(e[0].y),1,1);for(var t=1;t<this.points.length;t++)null!=e[t]&&this.bounds.add(new mxRectangle(Number(e[t].x),Number(e[t].y),1,1))}},mxShape.prototype.checkBounds=function(){return null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var e=document.createElement(mxClient.VML_PREFIX+":group");return e.style.position="absolute",e.style.width=this.node.style.width,e.style.height=this.node.style.height,e},mxShape.prototype.redrawShape=function(){var e=this.createCanvas();for(e.pointerEvents=this.pointerEvents;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);this.paint(e),this.node!=e.root&&this.node.insertAdjacentHTML("beforeend",e.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",(null==this.stencil||!this.stencilPointerEvents)&&mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(e)},mxShape.prototype.createCanvas=function(){var e=null,t=null;if(null!=this.node.ownerSVGElement)(e=new mxSvgCanvas2D(this.node,!1)).strokeTolerance=this.svgStrokeTolerance,e.blockImagePointerEvents=mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC,0!=(t=this.getSvgScreenOffset())?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform");else{this.updateVmlContainer();var n=Math.max(1,Math.round(this.bounds.width)),a=Math.max(1,Math.round(this.bounds.height));t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);""!=t.tagUrn&&(t.coordsize=n*this.vmlScale+","+a*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale),t=this.scale,e.translate(-Math.round(this.bounds.x/t),-Math.round(this.bounds.y/t))}return e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var e=Math.max(1,Math.round(this.bounds.width)),t=Math.max(1,Math.round(this.bounds.height));this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.style.overflow="visible"},mxShape.prototype.destroyCanvas=function(e){if(e instanceof mxSvgCanvas2D){for(var t in e.gradients){var n=e.gradients[t];n.mxRefCount=(n.mxRefCount||0)+1}this.releaseSvgGradients(this.oldGradients),this.oldGradients=e.gradients}},mxShape.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t,s=this.bounds.height/t;if(this.isPaintBoundsInverted()){n=n+(o=(i-s)/2),a=a-o;var o=i;i=s,s=o}if(this.updateTransform(e,n,a,i,s),this.configureCanvas(e,n,a,i,s),null!=this.stencil)this.paintStencilShape(e,n,a,i,s);else if(e.setStrokeWidth(this.strokewidth),null!=this.points){for(n=[],a=0;a<this.points.length;a++)n.push(new mxPoint(this.points[a].x/t,this.points[a].y/t));this.paintEdgeShape(e,n)}else this.paintVertexShape(e,n,a,i,s)},mxShape.prototype.configureCanvas=function(e,t,n,a,i){var s=null;null!=this.style&&(s=this.style.dashPattern),e.setAlpha(this.opacity/100),null!=this.isShadow&&e.setShadow(this.isShadow),null!=this.isDashed&&e.setDashed(this.isDashed),null!=s&&e.setDashPattern(s),null!=this.gradient?(t=this.getGradientBounds(e,t,n,a,i),e.setGradient(this.fill,this.gradient,t.x,t.y,t.width,t.height,this.gradientDirection)):e.setFillColor(this.fill),e.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,i)},mxShape.prototype.updateTransform=function(e,t,n,a,i){e.scale(this.scale),e.rotate(this.getShapeRotation(),this.flipH,this.flipV,t+a/2,n+i/2)},mxShape.prototype.paintStencilShape=function(e,t,n,a,i){this.stencilPointerEvents&&(this.dialect==mxConstants.DIALECT_SVG?this.addTransparentBackgroundRectangle(this.node,t,n,a,i):8!=document.documentMode&&this.setTransparentBackgroundImage(this.node)),this.stencil.drawShape(e,this,t,n,a,i)},mxShape.prototype.paintVertexShape=function(e,t,n,a,i){this.paintBackground(e,t,n,a,i),e.setShadow(!1),this.paintForeground(e,t,n,a,i)},mxShape.prototype.paintBackground=function(e,t,n,a,i){},mxShape.prototype.paintForeground=function(e,t,n,a,i){},mxShape.prototype.paintEdgeShape=function(e,t){},mxShape.prototype.getArcSize=function(e,t){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(e*n,t*n)},mxShape.prototype.paintGlassEffect=function(e,t,n,a,i,s){var o=Math.ceil(this.strokewidth/2);e.setGradient("#ffffff","#ffffff",t,n,a,.6*i,"south",.9,.1),e.begin(),s+=2*o,this.isRounded?(e.moveTo(t-o+s,n-o),e.quadTo(t-o,n-o,t-o,n-o+s),e.lineTo(t-o,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+o,n+.4*i),e.lineTo(t+a+o,n-o+s),e.quadTo(t+a+o,n-o,t+a+o-s,n-o)):(e.moveTo(t-o,n-o),e.lineTo(t-o,n+.4*i),e.quadTo(t+.5*a,n+.7*i,t+a+o,n+.4*i),e.lineTo(t+a+o,n-o)),e.close(),e.fill()},mxShape.prototype.apply=function(e){this.state=e,this.style=e.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),"north"!=this.direction&&"south"!=this.direction||(e=this.flipH,this.flipH=this.flipV,this.flipV=e),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),"none"==this.fill&&(this.fill=null),"none"==this.gradient&&(this.gradient=null),"none"==this.stroke&&(this.stroke=null))},mxShape.prototype.setCursor=function(e){null==e&&(e=""),this.cursor=e,null!=this.node&&(this.node.style.cursor=e)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.updateBoundingBox=function(){if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var t=this.getShapeRotation();0!=t&&(e=mxUtils.getBoundingBox(e,t)),e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height)}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var e=this.bounds.clone();if(this.isPaintBoundsInverted()){var t=(e.width-e.height)/2;e.x+=t,e.y-=t,t=e.width,e.width=e.height,e.height=t}return e},mxShape.prototype.augmentBoundingBox=function(e){this.isShadow&&(e.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),e.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));var t=Math.ceil(this.strokewidth*this.scale);e.grow(Math.ceil(t/2))},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&("north"==this.direction||"south"==this.direction)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var e=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxShape.prototype.getShapeRotation=function(){var e=this.getRotation();return null!=this.direction&&("north"==this.direction?e+=270:"west"==this.direction?e+=180:"south"==this.direction&&(e+=90)),e},mxShape.prototype.addTransparentBackgroundRectangle=function(e,t,n,a,i){(e=document.createElementNS(mxConstants.NS_SVG,"rect")).setAttribute("x",t),e.setAttribute("y",n),e.setAttribute("width",a),e.setAttribute("height",i),e.setAttribute("fill","none"),e.setAttribute("stroke","none"),e.setAttribute("pointer-events","all"),this.node.appendChild(e)},mxShape.prototype.setTransparentBackgroundImage=function(e){e.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(e){if(null!=e)for(var t in e){var n=e[t];n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n)}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null};var mxStencilRegistry={stencils:[],addStencil:function(e,t){mxStencilRegistry.stencils[e]=t},getStencil:function(e){return mxStencilRegistry.stencils[e]}},mxMarker={markers:[],addMarker:function(e,t){mxMarker.markers[e]=t},createMarker:function(e,t,n,a,i,s,o,r,l,d){var c=mxMarker.markers[n];return null!=c?c(e,t,n,a,i,s,o,r,l,d):null}};function mxActor(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxCloud(e,t,n,a){mxActor.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRectangleShape(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxDoubleEllipse(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxRhombus(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxPolyline(e,t,n){mxShape.call(this),this.points=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxArrow(e,t,n,a,i,s,o){mxShape.call(this),this.points=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1,this.arrowWidth=null!=i?i:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxText(e,t,n,a,i,s,o,r,l,d,c,m,u,p,g,v,h,f,b,E){mxShape.call(this),this.value=e,this.bounds=t,this.color=null!=i?i:"black",this.align=null!=n?n:"",this.valign=null!=a?a:"",this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(l||2),this.spacingTop=this.spacing+parseInt(d||0),this.spacingRight=this.spacing+parseInt(c||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(u||0),this.horizontal=null==p||p,this.background=g,this.border=v,this.wrap=null!=h&&h,this.clipped=null!=f&&f,this.overflow=null!=b?b:"visible",this.labelPadding=null!=E?E:0,this.rotation=0}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(e,t,n){mxShape.call(this),this.bounds=e,this.stroke=t,this.strokewidth=null!=n?n:1}function mxImageShape(e,t,n,a,i){mxShape.call(this),this.bounds=e,this.image=t,this.fill=n,this.stroke=a,this.strokewidth=null!=i?i:1,this.shadow=!1}function mxLabel(e,t,n,a){mxRectangleShape.call(this,e,t,n,a)}function mxCylinder(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxConnector(e,t,n){mxPolyline.call(this,e,t,n)}function mxSwimlane(e,t,n,a){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=n,this.strokewidth=null!=a?a:1}function mxGraphLayout(e){this.graph=e}function mxStackLayout(e,t,n,a,i,s){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=null!=n?n:0,this.x0=null!=a?a:0,this.y0=null!=i?i:0,this.border=null!=s?s:0}function mxPartitionLayout(e,t,n,a){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.spacing=n||0,this.border=a||0}function mxCompactTreeLayout(e,t,n){mxGraphLayout.call(this,e),this.horizontal=null==t||t,this.invert=null!=n&&n}function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxFastOrganicLayout(e){mxGraphLayout.call(this,e)}function mxCircleLayout(e,t){mxGraphLayout.call(this,e),this.radius=null!=t?t:100}function mxParallelEdgeLayout(e){mxGraphLayout.call(this,e)}function mxCompositeLayout(e,t,n){mxGraphLayout.call(this,e),this.layouts=t,this.master=n}function mxEdgeLabelLayout(e,t){mxGraphLayout.call(this,e)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=e}function mxGraphHierarchyEdge(e){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=e}function mxGraphHierarchyModel(e,t,n,a,i){for(e.getGraph(),this.tightenToSource=i,this.roots=n,this.parent=a,this.vertexMapper={},this.edgeMapper={},this.maxRank=0,n=[],null==t&&(t=this.graph.getChildVertices(a)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(e,t,n),a=0;a<t.length;a++){i=n[a].connectsAsSource;for(var s=0;s<i.length;s++){var o=i[s];if(null!=(r=o.edges)&&0<r.length){var r=r[0],l=e.getVisibleTerminal(r,!1);l=mxCellPath.create(l),l=this.vertexMapper[l];n[a]==l&&(l=e.getVisibleTerminal(r,!0),l=mxCellPath.create(l),l=this.vertexMapper[l]),null!=l&&n[a]!=l&&(0==(o.target=l).connectsAsTarget.length&&(l.connectsAsTarget=[]),mxUtils.indexOf(l.connectsAsTarget,o)<0&&l.connectsAsTarget.push(o))}}n[a].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(e){this.layout=e}function MedianCellSorter(){}function mxMinimumCycleRemover(e){this.layout=e}function mxCoordinateAssignment(e,t,n,a,i,s){this.layout=e,this.intraCellSpacing=t,this.interRankCellSpacing=n,this.orientation=a,this.initialX=i,this.parallelEdgeSpacing=s}!function(){function e(e,t,n,a,i,s,o,r,l,d){t=1.118*i*l,r=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=t,c.y-=r,o=n!=mxConstants.ARROW_CLASSIC?1:.75,a.x+=-i*o-t,a.y+=-s*o-r,function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i-s/2,c.y-s+i/2),n==mxConstants.ARROW_CLASSIC&&e.lineTo(c.x-3*i/4,c.y-3*s/4),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.close(),d?e.fillAndStroke():e.stroke()}}function t(e,t,n,a,i,s,o,r,l,d){r=n==mxConstants.ARROW_DIAMOND?.7071:.9862,t=i*l*r,r*=s*l,i*=o+l,s*=o+l;var c=a.clone();c.x-=t,c.y-=r,a.x+=-i-t,a.y+=-s-r;var m=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){e.begin(),e.moveTo(c.x,c.y),e.lineTo(c.x-i/2-s/m,c.y+i/m-s/2),e.lineTo(c.x-i,c.y-s),e.lineTo(c.x-i/2+s/m,c.y-s/2-i/m),e.close(),d?e.fillAndStroke():e.stroke()}}mxMarker.addMarker("classic",e),mxMarker.addMarker("block",e),mxMarker.addMarker("open",function(e,t,n,a,i,s,o,r,l,d){t=1.118*i*l,n=1.118*s*l,i*=o+l,s*=o+l;var c=a.clone();return c.x-=t,c.y-=n,a.x+=2*-t,a.y+=2*-n,function(){e.begin(),e.moveTo(c.x-i-s/2,c.y-s+i/2),e.lineTo(c.x,c.y),e.lineTo(c.x+s/2-i,c.y-s-i/2),e.stroke()}}),mxMarker.addMarker("oval",function(e,t,n,a,i,s,o,r,l,d){var c=o/2,m=a.clone();return a.x-=i*c,a.y-=s*c,function(){e.ellipse(m.x-c,m.y-c,o,o),d?e.fillAndStroke():e.stroke()}}),mxMarker.addMarker("diamond",t),mxMarker.addMarker("diamondThin",t)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i),e.fillAndStroke()},mxActor.prototype.redrawPath=function(e,t,n,a,i){t=a/3,e.moveTo(0,i),e.curveTo(0,3*i/5,0,2*i/5,a/2,2*i/5),e.curveTo(a/2-t,2*i/5,a/2-t,0,a/2,0),e.curveTo(a/2+t,0,a/2+t,2*i/5,a/2,2*i/5),e.curveTo(a,2*i/5,a,3*i/5,a,i),e.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,.25*i),e.curveTo(.05*a,.25*i,0,.5*i,.16*a,.55*i),e.curveTo(0,.66*i,.18*a,.9*i,.31*a,.8*i),e.curveTo(.4*a,i,.7*a,i,.8*a,.8*i),e.curveTo(a,.8*i,a,.6*i,.875*a,.5*i),e.curveTo(a,.3*i,.8*a,.1*i,.625*a,.2*i),e.curveTo(.5*a,.05*i,.3*a,.05*i,.25*a,.25*i),e.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.isRounded&&!this.glass&&0==this.rotation},mxRectangleShape.prototype.paintBackground=function(e,t,n,a,i){if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.min(a*s,i*s);e.roundrect(t,n,a,i,s,s)}else e.rect(t,n,a,i);e.fillAndStroke()},mxRectangleShape.prototype.paintForeground=function(e,t,n,a,i){this.glass&&this.paintGlassEffect(e,t,n,a,i,this.getArcSize(a+this.strokewidth,i+this.strokewidth))},mxRectangleShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxRectangleShape.prototype.updateHtmlBounds=function(e){var t=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);e.style.borderWidth=Math.max(1,t)+"px",e.style.overflow="hidden",e.style.left=Math.round(this.bounds.x-t/2)+"px",e.style.top=Math.round(this.bounds.y-t/2)+"px","CSS1Compat"==document.compatMode&&(t=-t),e.style.width=Math.round(Math.max(0,this.bounds.width+t))+"px",e.style.height=Math.round(Math.max(0,this.bounds.height+t))+"px"},mxRectangleShape.prototype.updateHtmlColors=function(e){var t=this.stroke;null!=t&&t!=mxConstants.NONE?(e.style.borderColor=t,this.isDashed?e.style.borderStyle="dashed":0<this.strokewidth&&(e.style.borderStyle="solid"),e.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):e.style.borderWidth="0px",null!=(t=this.fill)&&t!=mxConstants.NONE?(e.style.backgroundColor=t,e.style.backgroundImage="none"):this.pointerEvents?e.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(e):this.setTransparentBackgroundImage(e)},mxRectangleShape.prototype.updateHtmlFilters=function(e){var t="";if(this.opacity<100&&(t+="alpha(opacity="+this.opacity+")"),this.isShadow&&(t+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.SHADOWCOLOR+"')"),this.gradient){var n=this.fill,a=this.gradient,i="0",s={east:0,south:1,west:2,north:3},o=null!=this.direction?s[this.direction]:0;null!=this.gradientDirection&&(o=mxUtils.mod(o+s[this.gradientDirection]-1,4)),1==o?(i="1",s=n,n=a,a=s):2==o?(s=n,n=a,a=s):3==o&&(i="1"),t+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+a+"', gradientType='"+i+"')"}e.style.filter=t},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(e,t,n,a,i){e.ellipse(t,n,a,i),e.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(e,t,n,a,i){var s=Math.min(4,Math.min(a/5,i/5));i-=2*s,0<(a-=2*s)&&0<i&&e.ellipse(t+s,n+s,a,i),e.stroke()},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(e,t,n,a,i){var s=a/2,o=i/2;e.begin(),e.moveTo(t+s,n),e.lineTo(t+a,n+o),e.lineTo(t+s,n+i),e.lineTo(t,n+o),e.close(),e.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.paintEdgeShape=function(e,t){this.paintLine(e,t,this.isRounded)},mxPolyline.prototype.paintLine=function(e,t,n){var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,i=t[0],s=t[t.length-1];e.begin(),e.moveTo(i.x,i.y);for(var o=1;o<t.length-1;o++){var r=t[o],l=i.x-r.x;i=i.y-r.y;if(n&&o<t.length-1&&(0!=l||0!=i)){var d=Math.sqrt(l*l+i*i);l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d;e.lineTo(r.x+l,r.y+i),l=(i=t[o+1]).x-r.x,i=i.y-r.y,d=Math.max(1,Math.sqrt(l*l+i*i)),l=l*Math.min(a,d/2)/d,i=i*Math.min(a,d/2)/d,l=r.x+l,i=r.y+i,e.quadTo(r.x,r.y,l,i),r=new mxPoint(l,i)}else e.lineTo(r.x,r.y);i=r}e.lineTo(s.x,s.y),e.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.paintEdgeShape=function(e,t){var n=mxConstants.ARROW_SPACING,a=mxConstants.ARROW_WIDTH,i=mxConstants.ARROW_SIZE,s=t[0],o=t[t.length-1],r=o.x-s.x,l=o.y-s.y,d=(c=Math.sqrt(r*r+l*l))-2*n-i,c=(r=r/c,a*(l=l/c)/3),m=(a=-a*r/3,(i=s.x-c/2+n*r)+c),u=(s=s.y-a/2+n*l)+a,p=m+d*r,g=p+c,v=(d=u+d*l)+a,h=g-3*c,f=v-3*a;e.begin(),e.moveTo(i,s),e.lineTo(m,u),e.lineTo(p,d),e.lineTo(g,v),e.lineTo(o.x-n*r,o.y-n*l),e.lineTo(h,f),e.lineTo(h+c,f+a),e.close(),e.fillAndStroke()},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!(null==this.bounds||isNaN(this.bounds.x)||isNaN(this.bounds.y)||isNaN(this.bounds.width)||isNaN(this.bounds.height))},mxText.prototype.updateBoundingBox=function(){var e=this.node;8==document.documentMode&&null!=e.firstChild&&(null!=(e=e.firstChild).firstChild&&(e=e.firstChild)),this.boundingBox=this.bounds.clone();var t=this.getTextRotation();if(this.ignoreStringSize||null==e||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize)this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height;else{var n=null,a=null;if(null!=e.ownerSVGElement)if(null!=e.firstChild&&null!=e.firstChild.firstChild&&"foreignObject"==e.firstChild.firstChild.nodeName)e=e.firstChild.firstChild,n=this.wrap?this.bounds.width:parseInt(e.getAttribute("width"))*this.scale,a=parseInt(e.getAttribute("height"))*this.scale;else{if(0==(t=e.getBBox()).width&&0==t.height)return;this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),t=0}else a=this.state.view.textDiv,a=null!=this.offsetWidth&&null!=this.offsetHeight?(n=this.wrap?this.bounds.width:this.offsetWidth*this.scale,this.offsetHeight*this.scale):null!=a?(this.updateFont(a),this.updateSize(a),mxUtils.isNode(this.value)?a.innerHTML=this.value.outerHTML:(n=this.replaceLinefeeds?this.value.replace(/\n/g,"<br/>"):this.value,a.innerHTML=n),n=this.wrap?this.bounds.width:a.offsetWidth*this.scale,a.offsetHeight*this.scale):(n=this.wrap?this.bounds.width:e.offsetWidth*this.scale,e.offsetHeight*this.scale);null!=n&&null!=a&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*n,this.bounds.y+this.margin.y*a,n,a))}null!=this.boundingBox&&(0!=t&&(t=mxUtils.getBoundingBox(this.boundingBox,t),this.boundingBox.x=t.x,this.boundingBox.y=t.y,mxClient.IS_QUIRKS||(this.boundingBox.width=t.width,this.boundingBox.height=t.height)),this.boundingBox.x=Math.floor(this.boundingBox.x),this.boundingBox.y=Math.floor(this.boundingBox.y),this.boundingBox.width=Math.ceil(this.boundingBox.width),this.boundingBox.height=Math.ceil(this.boundingBox.height))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(e,t,n,a,i){mxShape.prototype.configureCanvas.apply(this,arguments),e.setFontColor(this.color),e.setFontBackgroundColor(this.background),e.setFontBorderColor(this.border),e.setFontFamily(this.family),e.setFontSize(this.size),e.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.paint=function(e){var t=this.scale,n=this.bounds.x/t,a=this.bounds.y/t,i=this.bounds.width/t;t=this.bounds.height/t;this.updateTransform(e,n,a,i,t),this.configureCanvas(e,n,a,i,t);var s=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=s||e instanceof mxVmlCanvas2D?"html":"",r=this.value;!s&&"html"==o&&(r=mxUtils.htmlEntities(r,!1)),r=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==o?r.replace(/\n/g,"<br/>"):r,e.text(n,a,i,t,r,this.align,this.valign,this.wrap,o,"fill"==this.overflow,this.clipped,this.getTextRotation())},mxText.prototype.redrawHtmlShape=function(){var e=this.node.style;e.opacity=this.opacity<1?this.opacity:"",e.overflow="",e.width="",e.height="",this.updateFont(this.node),this.updateSize(this.node),this.updateValue(),this.offsetHeight=this.offsetWidth=null,null!=mxClient.CSS_PREFIX?this.updateHtmlTransform():this.updateHtmlFilter()},mxText.prototype.updateHtmlTransform=function(){var e=this.getTextRotation(),t=this.node.style,n=this.margin.x,a=this.margin.y;0!=e?(t[mxClient.CSS_PREFIX+"TransformOrigin"]=100*-n+"% "+100*-a+"%",t[mxClient.CSS_PREFIX+"Transform"]="translate("+100*n+"%,"+100*a+"%)scale("+this.scale+") rotate("+e+"deg)"):(t[mxClient.CSS_PREFIX+"TransformOrigin"]="0% 0%",t[mxClient.CSS_PREFIX+"Transform"]="scale("+this.scale+")translate("+100*n+"%,"+100*a+"%)"),t.left=Math.round(this.bounds.x)+"px",t.top=Math.round(this.bounds.y)+"px"},mxText.prototype.updateHtmlFilter=function(){var e=this.node.style,t=this.margin.x,n=this.margin.y,a=this.scale;e.filter="";var i=0,s=0;if(null!=(r=null!=this.state?this.state.view.textDiv:null)){if(r.style.overflow="",r.style.height="",r.style.width="",this.updateFont(r),this.updateSize(r),mxUtils.isNode(this.value))r.innerHTML=this.value.outerHTML;else{var o=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(o=mxUtils.htmlEntities(o,!1)),o=this.replaceLinefeeds?o.replace(/\n/g,"<br/>"):o,r.innerHTML=o}i=r.offsetWidth+2,s=r.offsetHeight+2}else i=this.node.offsetWidth,s=this.node.offsetHeight+1;this.offsetWidth=i,this.offsetHeight=s,r=this.bounds.width/a,o=this.bounds.height/a,mxClient.IS_QUIRKS&&(this.clipped||"fill"==this.overflow)&&0<o?(o=Math.min(o,s),e.height=Math.round(o+1)+"px"):o=s,"fill"!=this.overflow&&(mxClient.IS_QUIRKS&&(this.clipped||this.wrap)&&0<r?(r=Math.min(r,i),e.width=Math.round(r)+"px"):r=i);o*=a;var r=r*a,l=(i=this.getTextRotation()*(Math.PI/180),s=parseFloat(parseFloat(Math.cos(i)).toFixed(8)),parseFloat(parseFloat(Math.sin(-i)).toFixed(8)));(i=i%(2*Math.PI))<0&&(i+=2*Math.PI),(i%=Math.PI)>Math.PI/2&&(i=Math.PI-i);var d=Math.cos(i),c=Math.sin(-i),m=(o-o*d+r*c)/2+l*(t=r*-(t+.5))-s*(n=o*-(n+.5));0!=i&&(e.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+s+", M12="+l+", M21="+-l+", M22="+s+", sizingMethod='auto expand')"),e.zoom=a,e.left=Math.round(this.bounds.x+((r-r*d+o*c)/2-s*t-l*n)-r/2)+"px",e.top=Math.round(this.bounds.y+m-o/2)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1));e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var t=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if(null!=t||null!=n)if("fill"==this.overflow)null!=t&&(this.node.style.backgroundColor=t),null!=n&&(this.node.style.border="1px solid "+n);else{var a="";null!=t&&(a+="background-color:"+t+";"),null!=n&&(a+="border:1px solid "+n+";"),e='<div style="zoom:1;'+a+"display:inline-block;_display:inline;padding-bottom:1px;padding-right:1px;line-height:"+this.node.style.lineHeight+'">'+e+"</div>",this.node.style.lineHeight=""}this.node.innerHTML=e}},mxText.prototype.updateFont=function(e){(e=e.style).lineHeight=Math.round(this.size*mxConstants.LINE_HEIGHT)+"px",e.fontSize=Math.round(this.size)+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,e.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",e.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",e.fontDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?"underline":"",e.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"},mxText.prototype.updateSize=function(e){var t=Math.round(this.bounds.width/this.scale),n=Math.round(this.bounds.height/this.scale);e=e.style,this.clipped?(e.overflow="hidden",0<n&&(e.maxHeight=n+"px"),0<t&&(e.width=t+"px")):"fill"==this.overflow&&(e.width=t+"px",0<n&&(e.maxHeight=n+"px")),this.wrap?(!this.clipped&&0<t&&(e.width=t+"px"),e.whiteSpace="normal"):e.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(0,0),e.lineTo(a,.5*i),e.lineTo(0,i),e.close()},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(e,t,n,a,i){e.moveTo(.25*a,0),e.lineTo(.75*a,0),e.lineTo(a,.5*i),e.lineTo(.75*a,i),e.lineTo(.25*a,i),e.lineTo(0,.5*i),e.close()},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(e,t,n,a,i){n+=i/2,e.begin(),e.moveTo(t,n),e.lineTo(t+a,n),e.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return mxClient.IS_IE?0:.5},mxImageShape.prototype.apply=function(e){mxShape.prototype.apply.apply(this,arguments),this.gradient=this.stroke=this.fill=null,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER),this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var e=document.createElement("div");return e.style.position="absolute",e},mxImageShape.prototype.paintVertexShape=function(e,t,n,a,i){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null==s&&null==o||(e.setFillColor(s),e.setStrokeColor(o),e.rect(t,n,a,i),e.fillAndStroke()),e.image(t,n,a,i,this.image,this.preserveImageAspect,!1,!1)}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.style.backgroundColor=this.fill||"",this.node.style.borderColor=this.stroke||"",this.node.innerHTML="",null!=this.image){var e=document.createElement(mxClient.IS_IE6||null==mxClient.CSS_PREFIX&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");e.style.position="absolute",e.src=this.image;var t=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=t,this.flipH&&this.flipV?t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?t+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(t+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),e.style.filter!=t&&(e.style.filter=t),"image"==e.nodeName?e.style.rotation=this.rotation:e.style[mxClient.CSS_PREFIX+"Transform"]="rotate("+this.rotation+"deg)",e.style.width=this.node.style.width,e.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(e)}else this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(e){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorColor&&null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.bounds=this.bounds,this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(e,t,n,a,i){this.paintImage(e,t,n,a,i),this.paintIndicator(e,t,n,a,i),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(e,t,n,a,i){null!=this.image&&(t=this.getImageBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return new mxRectangle(e=i==mxConstants.ALIGN_CENTER?e+(n-o)/2:i==mxConstants.ALIGN_RIGHT?e+(n-o-l):e+l,t=s==mxConstants.ALIGN_TOP?t+l:s==mxConstants.ALIGN_BOTTOM?t+(a-r-l):t+(a-r)/2,o,r)},mxLabel.prototype.paintIndicator=function(e,t,n,a,i){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(t,n,a,i),this.indicator.paint(e)):null!=this.indicatorImage&&(t=this.getIndicatorBounds(t,n,a,i),e.image(t.x,t.y,t.width,t.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(e,t,n,a){var i=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;return new mxRectangle(e=i==mxConstants.ALIGN_RIGHT?e+(n-o-l):i==mxConstants.ALIGN_CENTER?e+(n-o)/2:e+l,t=s==mxConstants.ALIGN_BOTTOM?t+(a-r-l):s==mxConstants.ALIGN_TOP?t+l:t+(a-r)/2,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var e=document.createElement("img");e.style.position="relative",e.setAttribute("border","0");var t=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);t.x-=this.bounds.x,t.y-=this.bounds.y,e.style.left=Math.round(t.x)+"px",e.style.top=Math.round(t.y)+"px",e.style.width=Math.round(t.width)+"px",e.style.height=Math.round(t.height)+"px",e.src=this.image,this.node.appendChild(e)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(e,t,n,a,i){e.translate(t,n),e.begin(),this.redrawPath(e,t,n,a,i,!1),e.fillAndStroke(),e.setShadow(!1),e.begin(),this.redrawPath(e,t,n,a,i,!0),e.stroke()},mxCylinder.prototype.redrawPath=function(e,t,n,a,i,s){t=Math.min(this.maxHeight,Math.round(i/5)),(s&&null!=this.fill||!s&&null==this.fill)&&(e.moveTo(0,t),e.curveTo(0,2*t,a,2*t,a,t),s||(e.stroke(),e.begin())),s||(e.moveTo(0,t),e.curveTo(0,-t/3,a,-t/3,a,t),e.lineTo(a,i-t),e.curveTo(a,i+t/3,0,i+t/3,0,i-t),e.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.paintEdgeShape=function(e,t){var n=this.createMarker(e,t,!0),a=this.createMarker(e,t,!1);null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(e,t,this.isRounded):this.paintCurvedLine(e,t),e.setFillColor(this.stroke),e.setShadow(!1),e.setDashed(!1),null!=n&&n(),null!=a&&a()},mxConnector.prototype.paintCurvedLine=function(e,t){e.begin();var n=t[0],a=t.length;for(e.moveTo(n.x,n.y),n=1;n<a-2;n++){var i=t[n],s=t[n+1];e.quadTo(i.x,i.y,(i.x+s.x)/2,(i.y+s.y)/2)}i=t[a-2],s=t[a-1],e.quadTo(i.x,i.y,s.x,s.y),e.stroke()},mxConnector.prototype.createMarker=function(e,t,n){var a=t.length,i=n?t[1]:t[a-2],s=(a=(t=n?t[0]:t[a-1]).x-i.x,t.y-i.y),o=(i=a/(o=Math.max(1,Math.sqrt(a*a+s*s))),a=s/o,s=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW));return mxMarker.createMarker(e,this,o,t,i,a,s,n,this.strokewidth,0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL])},mxConnector.prototype.augmentBoundingBox=function(e){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var t=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t=Math.max(t,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),e.grow(Math.ceil(t*this.scale))},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.getGradientBounds=function(e,t,n,a,i){return new mxRectangle(t,n,a,Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)))},mxSwimlane.prototype.getRotation=function(){var e=mxShape.prototype.getRotation.apply(this,arguments);return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(e+=mxText.prototype.verticalTextRotation),e},mxSwimlane.prototype.getTextRotation=function(){return this.getRotation()},mxSwimlane.prototype.isPaintBoundsInverted=function(){return mxShape.prototype.isPaintBoundsInverted.apply(this,arguments)||1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.getArcSize=function(e,t,n){return 3*n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)},mxSwimlane.prototype.paintVertexShape=function(e,t,n,a,i){var s=Math.min(i,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0;e.translate(t,n),this.isRounded?(l=this.getArcSize(a,i,s),this.paintRoundedSwimlane(e,t,n,a,i,s,l,o,r)):this.paintSwimlane(e,t,n,a,i,s,o,r),o=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE),this.paintSeparator(e,a,s,i,o),null!=this.image&&(i=this.getImageBounds(t,s,a,i),e.image(i.x-t,i.y-n,i.width,i.height,this.image,!1,!1,!1)),this.glass&&(e.setShadow(!1),this.paintGlassEffect(e,0,0,a,s,l))},mxSwimlane.prototype.paintSwimlane=function(e,t,n,a,i,s,o,r){o!=mxConstants.NONE&&(e.save(),e.setFillColor(o),e.rect(0,0,a,i),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(0,s),e.lineTo(0,0),e.lineTo(a,0),e.lineTo(a,s),r&&e.close(),e.fillAndStroke(),s<i&&o==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i),e.lineTo(a,i),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintRoundedSwimlane=function(e,t,n,a,i,s,o,r,l){r!=mxConstants.NONE&&(e.save(),e.setFillColor(r),e.roundrect(0,0,a,i,o,o),e.fillAndStroke(),e.restore(),e.setShadow(!1)),e.begin(),e.moveTo(a,s),e.lineTo(a,o),e.quadTo(a,0,a-Math.min(a/2,o),0),e.lineTo(Math.min(a/2,o),0),e.quadTo(0,0,0,o),e.lineTo(0,s),l&&e.close(),e.fillAndStroke(),s<i&&r==mxConstants.NONE&&(e.pointerEvents=!1,e.begin(),e.moveTo(0,s),e.lineTo(0,i-o),e.quadTo(0,i,Math.min(a/2,o),i),e.lineTo(a-Math.min(a/2,o),i),e.quadTo(a,i,a,i-o),e.lineTo(a,s),e.stroke())},mxSwimlane.prototype.paintSeparator=function(e,t,n,a,i){i!=mxConstants.NONE&&(e.setStrokeColor(i),e.setDashed(!0),e.begin(),e.moveTo(t,n),e.lineTo(t,a),e.stroke(),e.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(e,t,n,a){return new mxRectangle(e+n-this.imageSize,t,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(e,t,n){},mxGraphLayout.prototype.execute=function(e){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(e,t,n,a){return null!=(t=null!=(n=this.graph.view.getState(t))?n.style:this.graph.getCellStyle(t))?t[e]:null},mxGraphLayout.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=n(i[s]=e,a))||a)&&0<(a=this.graph.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.graph.model.getEdgeAt(e,s),r=this.graph.model.getTerminal(o,!0)==e;t&&!r||(r=this.graph.view.getVisibleTerminal(o,!r),this.traverse(r,t,n,o,i))}}},mxGraphLayout.prototype.isVertexMovable=function(e){return this.graph.isCellMovable(e)},mxGraphLayout.prototype.isVertexIgnored=function(e){return!this.graph.getModel().isVertex(e)||!this.graph.isCellVisible(e)},mxGraphLayout.prototype.isEdgeIgnored=function(e){var t=this.graph.getModel();return!t.isEdge(e)||!this.graph.isCellVisible(e)||null==t.getTerminal(e,!0)||null==t.getTerminal(e,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,t?"0":"1",[e])},mxGraphLayout.prototype.setOrthogonalEdge=function(e,t){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,t?"1":"0",[e])},mxGraphLayout.prototype.getParentOffset=function(e){var t=new mxPoint;if(null!=e&&e!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,e))for(var a=n.getGeometry(e);e!=this.parent;)t.x+=a.x,t.y+=a.y,e=n.getParent(e),a=n.getGeometry(e)}return t},mxGraphLayout.prototype.setEdgePoints=function(e,t){if(null!=e){var n=this.graph.model,a=n.getGeometry(e);if(null==a?(a=new mxGeometry).setRelative(!0):a=a.clone(),null!=this.parent&&null!=t)for(var i=n.getParent(e),s=(i=this.getParentOffset(i),0);s<t.length;s++)t[s].x-=i.x,t[s].y-=i.y;a.points=t,n.setGeometry(e,a)}},mxGraphLayout.prototype.setVertexLocation=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e),s=null;if(null!=i){if(s=new mxRectangle(t,n,i.width,i.height),this.useBoundingBox){var o=this.graph.getView().getState(e);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var r=this.graph.getView().scale,l=o.text.boundingBox;o.text.boundingBox.x<o.x&&(t+=(o.x-l.x)/r,s.width=l.width),o.text.boundingBox.y<o.y&&(n+=(o.y-l.y)/r,s.height=l.height)}}null!=this.parent&&(null!=(o=a.getParent(e))&&o!=this.parent&&(t-=(o=this.getParentOffset(o)).x,n-=o.y)),i.x==t&&i.y==n||((i=i.clone()).x=t,i.y=n,a.setGeometry(e,i))}return s},mxGraphLayout.prototype.getVertexBounds=function(e){var t=this.graph.getModel().getGeometry(e);if(this.useBoundingBox&&(null!=(r=this.graph.getView().getState(e))&&null!=r.text&&null!=r.text.boundingBox)){var n=this.graph.getView().scale,a=r.text.boundingBox,i=Math.max(r.x-a.x,0)/n,s=Math.max(r.y-a.y,0)/n,o=Math.max(a.x+a.width-(r.x+r.width),0)/n,r=Math.max(a.y+a.height-(r.y+r.height),0)/n;t=new mxRectangle(t.x-i,t.y-s,t.width+i+o,t.height+s+r)}return null!=this.parent&&(e=this.graph.getModel().getParent(e),t=t.clone(),null!=e&&e!=this.parent&&(e=this.getParentOffset(e),t.x+=e.x,t.y+=e.y)),new mxRectangle(t.x,t.y,t.width,t.height)},mxGraphLayout.prototype.arrangeGroups=function(e,t){this.graph.getModel().beginUpdate();try{for(var n=e.length-1;0<=n;n--){var a=e[n],i=this.graph.getChildVertices(a),s=this.graph.getBoundingBoxFromGeometry(i),o=this.graph.getCellGeometry(a),r=0,l=0;if(this.graph.isSwimlane(a)){var d=this.graph.getStartSize(a);r=d.width,l=d.height}null!=s&&null!=o&&((o=o.clone()).x=o.x+s.x-t-r,o.y=o.y+s.y-t-l,o.width=s.width+2*t+r,o.height=s.height+2*t+l,this.graph.getModel().setGeometry(a,o),this.graph.moveCells(i,t+r-s.x,t+l-s.y))}}finally{this.graph.getModel().endUpdate()}},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(e,t,n){var a=this.graph.getModel(),i=a.getParent(e),s=this.isHorizontal();if(null!=e&&null!=i){var o=0,r=0,l=a.getChildCount(i);for(t=s?t:n,null!=(o=this.graph.getView().getState(i))&&(t-=s?o.x:o.y),o=0;o<l;o++)if((n=a.getChildAt(i,o))!=e&&null!=(n=a.getGeometry(n))){if(n=s?n.x+n.width/2:n.y+n.height/2,r<t&&t<n)break;r=n}s=i.getIndex(e),s=Math.max(0,o-(s<o?1:0)),a.add(i,e,s)}},mxStackLayout.prototype.getParentSize=function(e){var t=this.graph.getModel(),n=t.getGeometry(e);return null!=this.graph.container&&(null==n&&t.isLayer(e)||e==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),n},mxStackLayout.prototype.execute=function(e){if(null!=e){var t=this.isHorizontal(),n=this.graph.getModel(),a=this.getParentSize(e),i=0;null!=a&&(i=t?a.height:a.width);i=i-(2*this.spacing+2*this.border);var s=this.x0+this.border,o=this.y0+this.border;if(this.graph.isSwimlane(e)){var r=this.graph.getCellStyle(e),l=mxUtils.getValue(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);t==(r=mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0))&&(i-=l),t?o+=l:s+=l}n.beginUpdate();try{l=0,r=null;for(var d=n.getChildCount(e),c=0;c<d;c++){var m=n.getChildAt(e,c);if(!this.isVertexIgnored(m)&&this.isVertexMovable(m)){var u=n.getGeometry(m);null!=u&&(u=u.clone(),null!=this.wrap&&null!=r&&(t&&r.x+r.width+u.width+2*this.spacing>this.wrap||!t&&r.y+r.height+u.height+2*this.spacing>this.wrap)&&(r=null,t?o+=l+this.spacing:s+=l+this.spacing,l=0),l=Math.max(l,t?u.height:u.width),null!=r?t?u.x=r.x+r.width+this.spacing:u.y=r.y+r.height+this.spacing:this.keepFirstLocation||(t?u.x=s:u.y=o),t?u.y=o:u.x=s,this.fill&&0<i&&(t?u.height=i:u.width=i),n.setGeometry(m,u),r=u)}}this.resizeParent&&null!=a&&null!=r&&!this.graph.isCellCollapsed(e)?(a=a.clone(),t?a.width=r.x+r.width+this.spacing:a.height=r.y+r.height+this.spacing,n.setGeometry(e,a)):this.resizeLast&&null!=a&&null!=r&&(t?r.width=a.width-r.x-this.spacing:r.height=a.height-r.y-this.spacing)}finally{n.endUpdate()}}},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(e,t,n){var a=(n=this.graph.getModel()).getParent(e);if(null!=e&&null!=a){var i=0,s=0,o=n.getChildCount(a);for(i=0;i<o;i++){var r=n.getChildAt(a,i);if(null!=(r=this.getVertexBounds(r))){if(r=r.x+r.width/2,s<t&&t<r)break;s=r}}t=a.getIndex(e),t=Math.max(0,i-(t<i?1:0)),n.add(a,e,t)}},mxPartitionLayout.prototype.execute=function(e){var t=this.isHorizontal(),n=this.graph.getModel(),a=n.getGeometry(e);if(null!=this.graph.container&&(null==a&&n.isLayer(e)||e==this.graph.getView().currentRoot)&&(a=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=a){for(var i=[],s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}if(0<(s=i.length)){var l=this.border,d=this.border,c=(c=t?a.height:a.width)-2*this.border;if(e=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle,c-=t?e.height:e.width,l+=e.width,d+=e.height,e=this.border+(s-1)*this.spacing,0<(a=t?(a.width-l-e)/s:(a.height-d-e)/s)){n.beginUpdate();try{for(o=0;o<s;o++){r=i[o];var m=n.getGeometry(r);null!=m&&((m=m.clone()).x=l,m.y=d,t?(this.resizeVertices&&(m.width=a,m.height=c),l+=a+this.spacing):(this.resizeVertices&&(m.height=a,m.width=c),d+=a+this.spacing),n.setGeometry(r,m))}}finally{n.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.getModel();if(null==t)if(0<this.graph.getEdges(e,n.getParent(e),this.invert,!this.invert,!1).length)t=e;else{if(0<(o=this.graph.findTreeRoots(e,!0,this.invert)).length)for(var a=0;a<o.length;a++)if(!this.isVertexIgnored(o[a])&&0<this.graph.getEdges(o[a],null,this.invert,!this.invert,!1).length){t=o[a];break}}if(null!=t){this.parentsChanged=this.resizeParent?{}:null,n.beginUpdate();try{var i=this.dfs(t,e);if(null!=i){this.layout(i);var s=this.graph.gridSize,o=s;if(!this.moveTree){var r=this.getVertexBounds(t);null!=r&&(s=r.x,o=r.y)}if((r=null)!=(r=this.isHorizontal()?this.horizontalLayout(i,s,o):this.verticalLayout(i,null,s,o))){var l=a=0;r.x<0&&(a=Math.abs(s-r.x)),r.y<0&&(l=Math.abs(o-r.y)),(0!=a||0!=l)&&this.moveNode(i,a,l),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(i)}}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(e,t,n){for(e.x+=t,e.y+=n,this.apply(e),e=e.child;null!=e;)this.moveNode(e,t,n),e=e.next},mxCompactTreeLayout.prototype.dfs=function(e,t,n){n=null!=n?n:[];var a=mxCellPath.create(e),i=null;if(null!=e&&null==n[a]&&!this.isVertexIgnored(e)){n[a]=e;i=this.createNode(e),a=this.graph.getModel();var s=null;e=this.graph.getEdges(e,t,this.invert,!this.invert,!1,!0);for(var o=this.graph.getView(),r=0;r<e.length;r++){var l=e[r];if(!this.isEdgeIgnored(l)){this.resetEdges&&this.setEdgePoints(l,null),this.edgeRouting&&(this.setEdgeStyleEnabled(l,!1),this.setEdgePoints(l,null));var d;l=null!=(d=o.getState(l))?d.getVisibleTerminal(this.invert):o.getVisibleTerminal(l,this.invert);null!=(d=this.dfs(l,t,n))&&null!=a.getGeometry(l)&&(null==s?i.child=d:s.next=d,s=d)}}}return i},mxCompactTreeLayout.prototype.layout=function(e){if(null!=e){for(var t=e.child;null!=t;)this.layout(t),t=t.next;null!=e.child?this.attachParent(e,this.join(e)):this.layoutLeaf(e)}},mxCompactTreeLayout.prototype.horizontalLayout=function(e,t,n,a){if(e.x+=t+e.offsetX,e.y+=n+e.offsetY,a=this.apply(e,a),null!=(t=e.child)){a=this.horizontalLayout(t,e.x,e.y,a),n=e.y+t.offsetY;for(var i=t.next;null!=i;)a=this.horizontalLayout(i,e.x+t.offsetX,n,a),n+=i.offsetY,i=i.next}return a},mxCompactTreeLayout.prototype.verticalLayout=function(e,t,n,a,i){if(e.x+=n+e.offsetY,e.y+=a+e.offsetX,i=this.apply(e,i),null!=(t=e.child))for(i=this.verticalLayout(t,e,e.x,e.y,i),n=e.x+t.offsetY,a=t.next;null!=a;)i=this.verticalLayout(a,e,n,e.y+t.offsetX,i),n+=a.offsetY,a=a.next;return i},mxCompactTreeLayout.prototype.attachParent=function(e,t){var n=this.nodeDistance+this.levelDistance,a=(t-e.width)/2-this.nodeDistance,i=a+e.width+2*this.nodeDistance-t;e.child.offsetX=n+e.height,e.child.offsetY=i,e.contour.upperHead=this.createLine(e.height,0,this.createLine(n,i,e.contour.upperHead)),e.contour.lowerHead=this.createLine(e.height,0,this.createLine(n,a,e.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(e){var t=2*this.nodeDistance;e.contour.upperTail=this.createLine(e.height+t,0),e.contour.upperHead=e.contour.upperTail,e.contour.lowerTail=this.createLine(0,-e.width-t),e.contour.lowerHead=this.createLine(e.height+t,0,e.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(e){var t=2*this.nodeDistance,n=e.child;e.contour=n.contour;var a=n.width+t,i=a;for(n=n.next;null!=n;){var s=this.merge(e.contour,n.contour);n.offsetY=s+a,n.offsetX=0,i+=s+(a=n.width+t),n=n.next}return i},mxCompactTreeLayout.prototype.merge=function(e,t){for(var n=0,a=0,i=0,s=e.lowerHead,o=t.upperHead;null!=o&&null!=s;){var r=this.offset(n,a,o.dx,o.dy,s.dx,s.dy);a=a+r,i=i+r;n+o.dx<=s.dx?(n+=o.dx,a+=o.dy,o=o.next):(n-=s.dx,a-=s.dy,s=s.next)}return null!=o?(n=this.bridge(e.upperTail,0,0,o,n,a),e.upperTail=null!=n.next?t.upperTail:n,e.lowerTail=t.lowerTail):null==(n=this.bridge(t.lowerTail,n,a,s,0,0)).next&&(e.lowerTail=n),e.lowerHead=t.lowerHead,i},mxCompactTreeLayout.prototype.offset=function(e,t,n,a,i,s){var o;return i<=e||e+n<=0?0:0<(o=0<i*a-n*s?e<0?e*a/n-t:0<e?e*s/i-t:-t:i<e+n?s-(t+(i-e)*a/n):e+n<i?(n+e)*s/i-(t+a):s-(t+a))?o:0},mxCompactTreeLayout.prototype.bridge=function(e,t,n,a,i,s){return t=i+a.dx-t,i=i=0,0==a.dx?i=a.dy:(i=t*a.dy,i/=a.dx),t=this.createLine(t,i,a.next),e.next=this.createLine(0,s+a.dy-i-n,t),t},mxCompactTreeLayout.prototype.createNode=function(e){var t={};return t.cell=e,t.x=0,t.y=0,t.width=0,t.height=0,null!=(e=this.getVertexBounds(e))&&(this.isHorizontal()?(t.width=e.height,t.height=e.width):(t.width=e.width,t.height=e.height)),t.offsetX=0,t.offsetY=0,t.contour={},t},mxCompactTreeLayout.prototype.apply=function(e,t){var n=this.graph.getModel(),a=e.cell,i=n.getGeometry(a);return null!=a&&null!=i&&(this.isVertexMovable(a)&&(i=this.setVertexLocation(a,e.x,e.y),this.resizeParent&&(n=n.getParent(a),a=mxCellPath.create(n),null==this.parentsChanged[a]&&(this.parentsChanged[a]=n))),t=null==t?new mxRectangle(i.x,i.y,i.width,i.height):new mxRectangle(Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x+t.width,i.x+i.width),Math.max(t.y+t.height,i.y+i.height))),t},mxCompactTreeLayout.prototype.createLine=function(e,t,n){var a={};return a.dx=e,a.dy=t,a.next=n,a},mxCompactTreeLayout.prototype.adjustParents=function(){var e,t=[];for(e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(e){for(this.processNodeOutgoing(e),e=e.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(e){for(var t=e.child,n=e.cell,a=0,i=[];null!=t;){a++;var s=t.x;this.horizontal&&(s=t.y),i.push(new WeightedCellSorter(t,s)),t=t.next}i.sort(WeightedCellSorter.prototype.compare),(s=e.width)>(o=(a+1)*this.prefHozEdgeSep)+2*this.prefHozEdgeSep&&(s-=2*this.prefHozEdgeSep),t=(e=s/a)/2,s>o+2*this.prefHozEdgeSep&&(t+=this.prefHozEdgeSep);s=this.minEdgeJetty-this.prefVertEdgeOff;for(var o=0,r=this.getVertexBounds(n),l=0;l<i.length;l++){for(var d=i[l].cell.cell,c=this.getVertexBounds(d),m=(d=this.graph.getEdgesBetween(n,d,!1),[]),u=0,p=0,g=0;g<d.length;g++)this.horizontal?(u=r.x+r.width,p=r.y+t,m.push(new mxPoint(u,p)),u=r.x+r.width+s,m.push(new mxPoint(u,p)),p=c.y+c.height/2):(u=r.x+t,p=r.y+r.height,m.push(new mxPoint(u,p)),p=r.y+r.height+s,m.push(new mxPoint(u,p)),u=c.x+c.width/2),m.push(new mxPoint(u,p)),this.setEdgePoints(d[g],m);l<a/2?s+=this.prefVertEdgeOff:a/2<l&&(s-=this.prefVertEdgeOff),t+=e,o=Math.max(o,s)}},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?1:t.weightedValue<e.weightedValue?-1:t.nudge?1:-1:0},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(e){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(e).length},mxFastOrganicLayout.prototype.execute=function(e){var t=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(e),a=0;a<n.length;a++)this.isVertexIgnored(n[a])||this.vertexArray.push(n[a]);var i=this.useInputOrigin?this.graph.view.getBounds(this.vertexArray):null,s=this.vertexArray.length;for(this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant,a=0;a<this.vertexArray.length;a++){var o=this.vertexArray[a];this.cellLocation[a]=[];var r=mxCellPath.create(o);this.indices[r]=a;var l=this.getVertexBounds(o),d=l.width,c=l.height,m=l.x,u=l.y;this.cellLocation[a][0]=m+d/2,this.cellLocation[a][1]=u+c/2,this.radius[a]=Math.min(d,c),this.radiusSquared[a]=this.radius[a]*this.radius[a]}t.beginUpdate();try{for(a=0;a<s;a++){this.dispX[a]=0,this.dispY[a]=0,this.isMoveable[a]=this.isVertexMovable(this.vertexArray[a]);var p=this.graph.getConnections(this.vertexArray[a],e);n=this.graph.getOpposites(p,this.vertexArray[a]);for(this.neighbours[a]=[],d=0;d<n.length;d++){this.resetEdges&&this.graph.resetEdge(p[d]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[d],!1);r=mxCellPath.create(n[d]);var g=this.indices[r];this.neighbours[a][d]=null!=g?g:a}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(e=n=null,a=0;a<this.vertexArray.length;a++)o=this.vertexArray[a],this.isVertexMovable(o)&&(null!=(l=this.getVertexBounds(o))&&(this.cellLocation[a][0]-=l.width/2,this.cellLocation[a][1]-=l.height/2,m=this.graph.snap(this.cellLocation[a][0]),u=this.graph.snap(this.cellLocation[a][1]),this.setVertexLocation(o,m,u),n=null==n?m:Math.min(n,m),e=null==e?u:Math.min(e,u)));a=1-(n||0),o=1-(e||0),null!=i&&(a+=i.x,o+=i.y),this.graph.moveCells(this.vertexArray,a,o)}finally{t.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var e=0;e<this.vertexArray.length;e++)if(this.isMoveable[e]){(n=Math.sqrt(this.dispX[e]*this.dispX[e]+this.dispY[e]*this.dispY[e]))<.001&&(n=.001);var t=this.dispX[e]/n*Math.min(n,this.temperature),n=this.dispY[e]/n*Math.min(n,this.temperature);this.dispX[e]=0,this.dispY[e]=0,this.cellLocation[e][0]+=t,this.cellLocation[e][1]+=n}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var e=0;e<this.vertexArray.length;e++)for(var t=0;t<this.neighbours[e].length;t++){var n=this.neighbours[e][t];if(e!=n&&this.isMoveable[e]&&this.isMoveable[n]){(a=(s=this.cellLocation[e][0]-this.cellLocation[n][0])*s+(o=this.cellLocation[e][1]-this.cellLocation[n][1])*o-this.radiusSquared[e]-this.radiusSquared[n])<this.minDistanceLimitSquared&&(a=this.minDistanceLimitSquared);var a,i=Math.sqrt(a),s=s/i*(a=a/this.forceConstant),o=o/i*a;this.dispX[e]-=s,this.dispY[e]-=o,this.dispX[n]+=s,this.dispY[n]+=o}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var e=this.vertexArray.length,t=0;t<e;t++)for(var n=t;n<e;n++){if(!this.allowedToRun)return;if(n!=t&&this.isMoveable[t]&&this.isMoveable[n]){var a=this.cellLocation[t][0]-this.cellLocation[n][0],i=this.cellLocation[t][1]-this.cellLocation[n][1];0==a&&(a=.01+Math.random()),0==i&&(i=.01+Math.random());var s=Math.sqrt(a*a+i*i),o=s-this.radius[t]-this.radius[n];o>this.maxDistanceLimit||(o<this.minDistanceLimit&&(o=this.minDistanceLimit),a=a/s*(o=this.forceConstantSquared/o),i=i/s*o,this.dispX[t]+=a,this.dispY[t]+=i,this.dispX[n]-=a,this.dispY[n]-=i)}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0,a=null,i=null,s=[],o=t.getChildCount(e),r=0;r<o;r++){var l=t.getChildAt(e,r);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{s.push(l);var d=this.getVertexBounds(l);a=null==a?d.y:Math.min(a,d.y),i=null==i?d.x:Math.min(i,d.x),n=Math.max(n,Math.max(d.width,d.height))}}var c=this.getRadius(s.length,n);this.moveCircle&&(i=this.x0,a=this.y0),this.circle(s,c,i,a)}finally{t.endUpdate()}},mxCircleLayout.prototype.getRadius=function(e,t){return Math.max(e*t/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(e,t,n,a){for(var i=e.length,s=2*Math.PI/i,o=0;o<i;o++)this.isVertexMovable(e[o])&&this.setVertexLocation(e[o],n+t+t*Math.sin(o*s),a+t+t*Math.cos(o*s))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(e){e=this.findParallels(e),this.graph.model.beginUpdate();try{for(var t in e){var n=e[t];1<n.length&&this.layout(n)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(e){for(var t=this.graph.getModel(),n=[],a=t.getChildCount(e),i=0;i<a;i++){var s=t.getChildAt(e,i);if(!this.isEdgeIgnored(s)){var o=this.getEdgeId(s);null!=o&&(null==n[o]&&(n[o]=[]),n[o].push(s))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(e){var t=this.graph.getView(),n=t.getState(e),a=null!=n?n.getVisibleTerminal(!0):t.getVisibleTerminal(e,!0);return e=null!=n?n.getVisibleTerminal(!1):t.getVisibleTerminal(e,!1),null!=a&&null!=e?(a=mxCellPath.create(a),(e=mxCellPath.create(e))<a?e+"-"+a:a+"-"+e):null},mxParallelEdgeLayout.prototype.layout=function(e){var t=e[0];if((o=(n=this.graph.getModel()).getGeometry(n.getTerminal(t,!0)))==(s=n.getGeometry(n.getTerminal(t,!1)))){t=o.x+o.width+this.spacing;for(var n=o.y+o.height/2,a=0;a<e.length;a++)this.route(e[a],t,n),t+=this.spacing}else if(null!=o&&null!=s){t=o.x+o.width/2,n=o.y+o.height/2,a=s.x+s.width/2-t;var i=s.y+s.height/2-n,s=Math.sqrt(a*a+i*i),o=i*this.spacing/s;for(s=a*this.spacing/s,t=t+a/2+o*(e.length-1)/2,n=n+i/2-s*(e.length-1)/2,a=0;a<e.length;a++)this.route(e[a],t,n),t-=o,n+=s}},mxParallelEdgeLayout.prototype.route=function(e,t,n){this.graph.isCellMovable(e)&&this.setEdgePoints(e,[new mxPoint(t,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(e,t,n){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{t.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(e){for(var t=this.graph.view,n=this.graph.getModel(),a=[],i=[],s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o),l=t.getState(r);null!=l&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||a.push(l):i.push(l))}this.placeLabels(i,a)},mxEdgeLabelLayout.prototype.placeLabels=function(e,t){var n=this.graph.getModel();n.beginUpdate();try{for(var a=0;a<t.length;a++){var i=t[a];if(null!=i&&null!=i.text&&null!=i.text.boundingBox)for(var s=0;s<e.length;s++){var o=e[s];null!=o&&this.avoid(i,o)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(e,t){var n=this.graph.getModel(),a=e.text.boundingBox;if(mxUtils.intersects(a,t)){var i=-a.y-a.height+t.y,s=-a.y+t.y+t.height;i=Math.abs(i)<Math.abs(s)?i:s,s=-a.x-a.width+t.x,a=-a.x+t.x+t.width,a=Math.abs(s)<Math.abs(a)?s:a;Math.abs(a)<Math.abs(i)?i=0:a=0,null!=(s=n.getGeometry(e.cell))&&(null!=(s=s.clone()).offset?(s.offset.x+=a,s.offset.y+=i):s.offset=new mxPoint(a,i),n.setGeometry(e.cell,s))}},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(e){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(e){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(e,t){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(e,t){this.isVertex()?this.x[0]=t:this.isEdge()&&(this.x[e-this.minRank-1]=t)},mxGraphAbstractHierarchyCell.prototype.getX=function(e){return this.isVertex()?this.x[0]:this.isEdge()?this.x[e-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(e,t){this.isVertex()?this.y[0]=t:this.isEdge()&&(this.y[e-this.minRank-1]=t)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.connectsAsTarget=[],mxGraphHierarchyNode.prototype.connectsAsSource=[],mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(e){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsTarget.length;t++){var n=this.connectsAsTarget[t];-1==n.maxRank||n.maxRank==e+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var t=0;t<this.connectsAsSource.length;t++){var n=this.connectsAsSource[t];-1==n.minRank||n.minRank==e-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(e){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(e,t){this.temp[0]=t},mxGraphHierarchyNode.prototype.isAncestor=function(e){if(null!=e&&null!=this.hashCode&&null!=e.hashCode&&this.hashCode.length<e.hashCode.length){if(this.hashCode==e.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var t=0;t<this.hashCode.length;t++)if(this.hashCode[t]!=e.hashCode[t])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(e){e=this.source,this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(e){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.nextLayerConnectedCells[t]=[],t==this.temp.length-1?this.nextLayerConnectedCells[t].push(this.source):this.nextLayerConnectedCells[t].push(this)}return this.nextLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(e){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var t=0;t<this.temp.length;t++)this.previousLayerConnectedCells[t]=[],0==t?this.previousLayerConnectedCells[t].push(this.target):this.previousLayerConnectedCells[t].push(this)}return this.previousLayerConnectedCells[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(e){return this.temp[e-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(e,t){this.temp[e-this.minRank-1]=t},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(e,t,n){for(var a=e.getGraph(),i=0;i<t.length;i++){n[i]=new mxGraphHierarchyNode(t[i]);var s=mxCellPath.create(t[i]);this.vertexMapper[s]=n[i],s=e.getEdges(t[i]),n[i].connectsAsSource=[];for(var o=0;o<s.length;o++){if((d=e.getVisibleTerminal(s[o],!1))!=t[i]&&d!=t[i]&&e.graph.model.isVertex(d)&&!e.isVertexIgnored(d)){var r=e.getEdgesBetween(t[i],d,!1),l=e.getEdgesBetween(t[i],d,!0),d=mxCellPath.create(r[0]);if(null!=r&&0<r.length&&null==this.edgeMapper[d]&&2*l.length>=r.length){l=new mxGraphHierarchyEdge(r);for(var c=0;c<r.length;c++){var m=r[c];d=mxCellPath.create(m);this.edgeMapper[d]=l,a.resetEdge(m),e.disableEdgeStyle&&(e.setEdgeStyleEnabled(m,!1),e.setOrthogonalEdge(m,!0))}l.source=n[i],mxUtils.indexOf(n[i].connectsAsSource,l)<0&&n[i].connectsAsSource.push(l)}}}n[i].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var e=[];if(null!=this.roots)for(var t=0;t<this.roots.length;t++){var n=mxCellPath.create(this.roots[t]);null!=(n=this.vertexMapper[n])&&e.push(n)}for(var a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]=-1;for(var i=e.slice();0<e.length;){var s,o;s=(n=e[0]).connectsAsTarget,o=n.connectsAsSource;var r=!0,l=this.SOURCESCANSTARTRANK;for(t=0;t<s.length;t++){var d=s[t];if(5270620!=d.temp[0]){r=!1;break}d=d.source,l=Math.min(l,d.temp[0]-1)}if(r){if(n.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(t=0;t<o.length;t++)(d=o[t]).temp[0]=5270620,-1==(d=d.target).temp[0]&&(e.push(d),d.temp[0]=-2);e.shift()}else if(t=e.shift(),e.push(n),t==n&&1==e.length)break}for(a in this.vertexMapper)(n=this.vertexMapper[a]).temp[0]-=this.maxRank;for(t=0;t<i.length;t++)for(e=0,s=(n=i[t]).connectsAsSource,a=0;a<s.length;a++)d=(d=s[a]).target,n.temp[0]=Math.max(e,d.temp[0]+1),e=n.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var s=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++)s[e]=[],this.ranks[e]=s[e];var t=null;if(null!=this.roots){var n=this.roots;for(t=[],e=0;e<n.length;e++){var a=mxCellPath.create(n[e]);t[e]=this.vertexMapper[a]}}this.visit(function(e,t,n,a,i){if(0==i&&t.maxRank<0&&t.minRank<0&&(s[t.temp[0]].push(t),t.maxRank=t.temp[0],t.minRank=t.temp[0],t.temp[0]=s[t.maxRank].length-1),null!=e&&null!=n&&1<e.maxRank-t.maxRank)for(n.maxRank=e.maxRank,n.minRank=t.maxRank,n.temp=[],n.x=[],n.y=[],e=n.minRank+1;e<n.maxRank;e++)s[e].push(n),n.setGeneralPurposeVariable(e,s[e].length-1)},t,!1,null)},mxGraphHierarchyModel.prototype.visit=function(e,t,n,a){if(null!=t){for(var i=0;i<t.length;i++){var s=t[i];null!=s&&(null==a&&(a={}),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=i,this.extendedDfs(null,s,null,e,a,s.hashCode,i,0)):this.dfs(null,s,null,e,a,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(e,t,n,a,i,s){if(null!=t){var o=mxCellPath.create(t.cell);if(null==i[o])for(a(e,i[o]=t,n,s,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)o=e[n],this.dfs(t,o.target,o,a,i,s+1);else a(e,t,n,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(e,t,n,a,i,s,o,r){if(null!=t)if(null==e||null!=t.hashCode&&t.hashCode[0]==e.hashCode[0]||(s=e.hashCode.length+1,t.hashCode=e.hashCode.slice(),t.hashCode[s-1]=o),null==i[o=mxCellPath.create(t.cell)])for(a(e,i[o]=t,n,r,0),e=t.connectsAsSource.slice(),n=0;n<e.length;n++)o=e[n],this.extendedDfs(t,o.target,o,a,i,t.hashCode,n,r+1);else a(e,t,n,r,1)},mxHierarchicalLayoutStage.prototype.execute=function(e){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(e){e=this.layout.getModel(),this.nestedBestRanks=[];for(var t=0;t<e.ranks.length;t++)this.nestedBestRanks[t]=e.ranks[t].slice();var n=0,a=this.calculateCrossings(e);for(t=0;t<this.maxIterations&&n<this.maxNoImprovementIterations;t++){this.weightedMedian(t,e),this.transpose(t,e);var i=this.calculateCrossings(e);if(i<a)for(a=i,i=n=0;i<this.nestedBestRanks.length;i++)for(var s=e.ranks[i],o=0;o<s.length;o++){var r=s[o];this.nestedBestRanks[i][r.getGeneralPurposeVariable(i)]=r}else for(n++,i=0;i<this.nestedBestRanks.length;i++)for(s=e.ranks[i],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(i,o);if(0==a)break}for(n=[],a=[],t=0;t<e.maxRank+1;t++)a[t]=[],n[t]=a[t];for(t=0;t<this.nestedBestRanks.length;t++)for(i=0;i<this.nestedBestRanks[t].length;i++)a[t].push(this.nestedBestRanks[t][i]);e.ranks=n},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(e){for(var t=e.ranks.length,n=0,a=1;a<t;a++)n+=this.calculateRankCrossing(a,e);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(e,t){for(var n=0,a=t.ranks[e],i=a.length,s=t.ranks[e-1].length,o=[],r=0;r<i;r++)o[r]=[];for(r=0;r<a.length;r++)for(var l=(c=a[r]).getGeneralPurposeVariable(e),d=c.getPreviousLayerConnectedCells(e),c=0;c<d.length;c++){var m=d[c].getGeneralPurposeVariable(e-1);o[l][m]=201207}for(r=0;r<i;r++)for(c=0;c<s;c++)if(201207==o[r][c]){for(a=r+1;a<i;a++)for(l=0;l<c;l++)201207==o[a][l]&&n++;for(a=0;a<r;a++)for(l=c+1;l<s;l++)201207==o[a][l]&&n++}return n/2},mxMedianHybridCrossingReduction.prototype.transpose=function(e,t){for(var n=!0,a=0;n&&a++<10;)for(var i=1==e%2&&1==a%2,s=(n=!1,0);s<t.ranks.length;s++){for(var o=t.ranks[s],r=[],l=0;l<o.length;l++){(b=(f=o[l]).getGeneralPurposeVariable(s))<0&&(b=l),r[b]=f}var d=b=f=null,c=null,m=null,u=null,p=null,g=null,v=null,h=null;for(l=0;l<o.length-1;l++){if(0==l){for(var f=(v=r[l]).getNextLayerConnectedCells(s),b=v.getPreviousLayerConnectedCells(s),E=(m=[],u=[],0);E<f.length;E++)m[E]=f[E].getGeneralPurposeVariable(s+1);for(E=0;E<b.length;E++)u[E]=b[E].getGeneralPurposeVariable(s-1)}else f=d,b=c,m=p,u=g,v=h;for(d=(h=r[l+1]).getNextLayerConnectedCells(s),c=h.getPreviousLayerConnectedCells(s),p=[],g=[],E=0;E<d.length;E++)p[E]=d[E].getGeneralPurposeVariable(s+1);for(E=0;E<c.length;E++)g[E]=c[E].getGeneralPurposeVariable(s-1);var A=0,y=0;for(E=0;E<m.length;E++)for(var S=0;S<p.length;S++)m[E]>p[S]&&A++,m[E]<p[S]&&y++;for(E=0;E<u.length;E++)for(S=0;S<g.length;S++)u[E]>g[S]&&A++,u[E]<g[S]&&y++;(y<A||y==A&&i)&&(d=v.getGeneralPurposeVariable(s),v.setGeneralPurposeVariable(s,h.getGeneralPurposeVariable(s)),h.setGeneralPurposeVariable(s,d),d=f,c=b,p=m,g=u,h=v,i||(n=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(e,t){var n=0==e%2;if(n)for(var a=t.maxRank-1;0<=a;a--)this.medianRank(a,n);else for(a=1;a<t.maxRank;a++)this.medianRank(a,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(e,t){for(var n=this.nestedBestRanks[e].length,a=[],i=[],s=0;s<n;s++){var o,r,l=this.nestedBestRanks[e][s],d=new MedianCellSorter;d.cell=l,r=t?e+1:e-1,null!=(o=t?l.getNextLayerConnectedCells(e):l.getPreviousLayerConnectedCells(e))&&0!=o.length?(d.medianValue=this.medianValue(o,r),a.push(d)):i[l.getGeneralPurposeVariable(e)]=!0}for(a.sort(MedianCellSorter.prototype.compare),s=0;s<n;s++)null==i[s]&&(l=a.shift().cell).setGeneralPurposeVariable(e,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(e,t){for(var n=[],a=0,i=0;i<e.length;i++){var s=e[i];n[a++]=s.getGeneralPurposeVariable(t)}return n.sort(function(e,t){return e-t}),1==a%2?n[Math.floor(a/2)]:2==a?(n[0]+n[1])/2:(s=n[(i=a/2)-1]-n[0],a=n[a-1]-n[i],(n[i-1]*a+n[i]*s)/(s+a))},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.medianValue>e.medianValue?-1:t.medianValue<e.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(e){var t=this.layout.getModel(),s={},o=mxUtils.clone(t.vertexMapper,null,!0),n=null;if(null!=t.roots){var a=t.roots;n=[];for(e=0;e<a.length;e++){var i=mxCellPath.create(a[e]);n[e]=t.vertexMapper[i]}}if(t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget),t.connectsAsSource.push(n)),e=mxCellPath.create(t.cell),s[e]=t,delete o[e]},n,!0,null),n=null,0<o.lenth&&(n=mxUtils.clone(o,null,!0)),e=mxUtils.clone(s,null,!0),t.visit(function(e,t,n,a,i){t.isAncestor(e)&&(n.invert(),mxUtils.remove(n,e.connectsAsSource),t.connectsAsSource.push(n),e.connectsAsTarget.push(n),mxUtils.remove(n,t.connectsAsTarget)),e=mxCellPath.create(t.cell),s[e]=t,delete o[e]},o,!0,e),a=this.layout.getGraph(),null!=n&&0<n.length)for(t=t.roots,e=0;e<n.length;e++)i=n[e].cell,0==a.getIncomingEdges(i).length&&t.push(i)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function WeightedCellSorter(e,t){this.cell=e,this.weightedValue=t}function mxHierarchicalLayout(e,t,n){mxGraphLayout.call(this,e),this.orientation=null!=t?t:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(e){this.currentEdit=this.createUndoableEdit(),null!=e?this.setRoot(e):this.clear()}function mxRootChange(e,t){this.model=e,this.previous=this.root=t}function mxChildChange(e,t,n,a){this.model=e,this.previous=this.parent=t,this.child=n,this.previousIndex=this.index=a}function mxTerminalChange(e,t,n,a){this.model=e,this.cell=t,this.previous=this.terminal=n,this.source=a}function mxValueChange(e,t,n){this.model=e,this.cell=t,this.previous=this.value=n}function mxStyleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.style=n}function mxGeometryChange(e,t,n){this.model=e,this.cell=t,this.previous=this.geometry=n}function mxCollapseChange(e,t,n){this.model=e,this.cell=t,this.previous=this.collapsed=n}function mxVisibleChange(e,t,n){this.model=e,this.cell=t,this.previous=this.visible=n}function mxCellAttributeChange(e,t,n){this.cell=e,this.attribute=t,this.previous=this.value=n}function mxCell(e,t,n){this.value=e,this.setGeometry(t),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(e,t,n,a){mxRectangle.call(this,e,t,n,a)}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var e=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var t=0;t<e.ranks.length;t++){mxLog.write("Rank ",t," : ");for(var n=e.ranks[t],a=0;a<n.length;a++)mxLog.write(n[a].getGeneralPurposeVariable(t)," ");mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(e){this.jettyPositions=[],e=this.layout.getModel(),this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var t=1e8;if(this.fineTuning)for(var n=0;n<this.maxIterations;n++){if(0!=n&&(this.medianPos(n,e),this.minNode(e)),this.currentXDelta<t){for(var a=0;a<e.ranks.length;a++)for(var i=e.ranks[a],s=0;s<i.length;s++){var o=i[s];o.setX(a,o.getGeneralPurposeVariable(a))}t=this.currentXDelta}else for(a=0;a<e.ranks.length;a++)for(i=e.ranks[a],s=0;s<i.length;s++)(o=i[s]).setGeneralPurposeVariable(a,o.getX(a));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(e){for(var t=[],n=[],a=[],i=0;i<=e.maxRank;i++){a[i]=e.ranks[i];for(var s=0;s<a[i].length;s++){var o=a[i][s];(r=new WeightedCellSorter(o,i)).rankIndex=s,r.visited=!0,t.push(r),n[o=mxCellPath.create(o.getCoreCell())]=r}}for(e=10*t.length,s=0;0<t.length&&s<=e;){i=(r=t.shift()).cell;var r,l=r.weightedValue,d=parseInt(r.rankIndex),c=(o=i.getNextLayerConnectedCells(l),i.getPreviousLayerConnectedCells(l)),m=o.length,u=c.length,p=this.medianXValue(o,l+1),g=this.medianXValue(c,l-1),v=m+u,h=i.getGeneralPurposeVariable(l),f=h;if(0<v&&(f=(p*m+g*u)/v),m=!1,f<h-1?0==d?(i.setGeneralPurposeVariable(l,f),m=!0):(h=(h=(d=a[l][d-1]).getGeneralPurposeVariable(l))+d.width/2+this.intraCellSpacing+i.width/2)<f?(i.setGeneralPurposeVariable(l,f),m=!0):h<i.getGeneralPurposeVariable(l)-1&&(i.setGeneralPurposeVariable(l,h),m=!0):h+1<f&&(d==a[l].length-1?(i.setGeneralPurposeVariable(l,f),m=!0):f<(h=(h=(d=a[l][d+1]).getGeneralPurposeVariable(l))-d.width/2-this.intraCellSpacing-i.width/2)?(i.setGeneralPurposeVariable(l,f),m=!0):h>i.getGeneralPurposeVariable(l)+1&&(i.setGeneralPurposeVariable(l,h),m=!0)),m){for(i=0;i<o.length;i++)l=o[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l));for(i=0;i<c.length;i++)l=c[i],null!=(l=n[l=mxCellPath.create(l.getCoreCell())])&&0==l.visited&&(l.visited=!0,t.push(l))}r.visited=!1,s++}},mxCoordinateAssignment.prototype.medianPos=function(e,t){if(0==e%2)for(var n=t.maxRank;0<n;n--)this.rankMedianPosition(n-1,t,n);else for(n=0;n<t.maxRank-1;n++)this.rankMedianPosition(n+1,t,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(e,t,n){t=t.ranks[e];for(var a=[],i=[],s=0;s<t.length;s++){var o=t[s];a[s]=new WeightedCellSorter,a[s].cell=o,a[s].rankIndex=s;var r=mxCellPath.create(o.getCoreCell());i[r]=a[s];var l=null;l=n<e?o.getPreviousLayerConnectedCells(e):o.getNextLayerConnectedCells(e);a[s].weightedValue=this.calculatedWeightedValue(o,l)}for(a.sort(WeightedCellSorter.prototype.compare),s=0;s<a.length;s++){r=0,o=a[s].cell,r=0,null!=(l=n<e?o.getPreviousLayerConnectedCells(e).slice():o.getNextLayerConnectedCells(e).slice())&&(r=0<(r=l.length)?this.medianXValue(l,n):o.getGeneralPurposeVariable(e));for(var d=0,c=(l=-1e8,a[s].rankIndex-1);0<=c;){var m;if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var u=m.cell;m.visited?(l=u.getGeneralPurposeVariable(e)+u.width/2+this.intraCellSpacing+d+o.width/2,c=-1):(d+=u.width+this.intraCellSpacing,c--)}}for(d=0,u=1e8,c=a[s].rankIndex+1;c<a.length;)if(null!=(m=i[m=mxCellPath.create(t[c].getCoreCell())])){var p=m.cell;m.visited?(u=p.getGeneralPurposeVariable(e)-p.width/2-this.intraCellSpacing-d-o.width/2,c=a.length):(d+=p.width+this.intraCellSpacing,c++)}l<=r&&r<=u?o.setGeneralPurposeVariable(e,r):r<l?(o.setGeneralPurposeVariable(e,l),this.currentXDelta+=l-r):u<r&&(o.setGeneralPurposeVariable(e,u),this.currentXDelta+=r-u),a[s].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(e,t){for(var n=0,a=0;a<t.length;a++){var i=t[a];e.isVertex()&&i.isVertex()?n++:n=e.isEdge()&&i.isEdge()?n+8:n+2}return n},mxCoordinateAssignment.prototype.medianXValue=function(e,t){if(0==e.length)return 0;for(var n=[],a=0;a<e.length;a++)n[a]=e[a].getGeneralPurposeVariable(t);return n.sort(function(e,t){return e-t}),1==e.length%2?n[Math.floor(e.length/2)]:(n[(a=e.length/2)-1]+n[a])/2},mxCoordinateAssignment.prototype.initialCoords=function(e,t){this.calculateWidestRank(e,t);for(var n=this.widestRank;0<=n;n--)n<t.maxRank&&this.rankCoordinates(n,e,t);for(n=this.widestRank+1;n<=t.maxRank;n++)0<n&&this.rankCoordinates(n,e,t)},mxCoordinateAssignment.prototype.rankCoordinates=function(e,t,n){t=n.ranks[e],n=0;for(var a=this.initialX+(this.widestRankValue-this.rankWidths[e])/2,i=!1,s=0;s<t.length;s++){var o=t[s];if(o.isVertex()){var r=this.layout.getVertexBounds(o.cell);null!=r?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(o.width=r.width,o.height=r.height):(o.width=r.height,o.height=r.width):i=!0,n=Math.max(n,o.height)}else o.isEdge()&&(r=1,null!=o.edges?r=o.edges.length:mxLog.warn("edge.edges is null"),o.width=(r-1)*this.parallelEdgeSpacing);a+=o.width/2,o.setX(e,a),o.setGeneralPurposeVariable(e,a),a+=o.width/2,a+=this.intraCellSpacing}1==i&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(e,t){var n=-this.interRankCellSpacing,a=0;this.rankWidths=[],this.rankY=[];for(var i=t.maxRank;0<=i;i--){for(var s=0,o=t.ranks[i],r=this.initialX,l=!1,d=0;d<o.length;d++){var c=o[d];if(c.isVertex()){var m=this.layout.getVertexBounds(c.cell);null!=m?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(c.width=m.width,c.height=m.height):(c.width=m.height,c.height=m.width):l=!0,s=Math.max(s,c.height)}else c.isEdge()&&(m=1,null!=c.edges?m=c.edges.length:mxLog.warn("edge.edges is null"),c.width=(m-1)*this.parallelEdgeSpacing);r+=c.width/2,c.setX(i,r),c.setGeneralPurposeVariable(i,r),r+=c.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=i),this.rankWidths[i]=r}for(1==l&&mxLog.warn("At least one cell has no bounds"),this.rankY[i]=n,r=s/2+a/2+this.interRankCellSpacing,a=s,n=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+r:n-r,d=0;d<o.length;d++)o[d].setY(i,n)}},mxCoordinateAssignment.prototype.minPath=function(e,t){var n,a=t.edgeMapper;for(n in a){var i=a[n];if(!(i.maxRank-i.minRank-1<1)){for(var s=i.getGeneralPurposeVariable(i.minRank+1),o=!0,r=0,l=i.minRank+2;l<i.maxRank;l++){s!=(d=i.getGeneralPurposeVariable(l))?(o=!1,s=d):r++}if(!o){o=s=0;var d=[],c=[],m=i.getGeneralPurposeVariable(i.minRank+1);for(l=i.minRank+1;l<i.maxRank-1;l++){var u=i.getX(l+1);m==u?(d[l-i.minRank-1]=m,s++):this.repositionValid(t,i,l+1,m)?(d[l-i.minRank-1]=m,s++):m=d[l-i.minRank-1]=u}for(m=i.getX(l),l=i.maxRank-1;l>i.minRank+1;l--)m==(u=i.getX(l-1))?(c[l-i.minRank-2]=m,o++):this.repositionValid(t,i,l-1,m)?(c[l-i.minRank-2]=m,o++):(c[l-i.minRank-2]=i.getX(l-1),m=u);if(r<o||r<s)if(s<=o)for(l=i.maxRank-2;l>i.minRank;l--)i.setX(l,c[l-i.minRank-1]);else if(o<s)for(l=i.minRank+2;l<i.maxRank;l++)i.setX(l,d[l-i.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(e,t,n,a){e=e.ranks[n];for(var i=-1,s=0;s<e.length;s++)if(t==e[s]){i=s;break}if(i<0)return!1;if(a<(s=t.getGeneralPurposeVariable(n))){if(0==i)return!0;if(!((n=(n=(e=e[i-1]).getGeneralPurposeVariable(n))+e.width/2+this.intraCellSpacing+t.width/2)<=a))return!1}else if(s<a){if(i==e.length-1)return!0;if(!(a<=(n=(n=(e=e[i+1]).getGeneralPurposeVariable(n))-e.width/2-this.intraCellSpacing-t.width/2)))return!1}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(e,t){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<t.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=0;n=null,this.layout.resizeParent&&(n={});var a,i=t.edgeMapper,s=t.vertexMapper;for(a in s){var o=s[a];if(this.setVertexLocation(o),this.layout.resizeParent){o=e.model.getParent(o.cell);var r=mxCellPath.create(o);null==n[r]&&(n[r]=o)}}for(a in this.layout.resizeParent&&null!=n&&this.adjustParents(n),(this.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(t),i)this.setEdgePosition(i[a])},mxCoordinateAssignment.prototype.adjustParents=function(e){var t,n=[];for(t in e)n.push(e[t]);this.layout.arrangeGroups(mxUtils.sortCells(n,!0),this.groupPadding)},mxCoordinateAssignment.prototype.localEdgeProcessing=function(e){for(var t=0;t<e.ranks.length;t++)for(var n=e.ranks[t],a=0;a<n.length;a++){var i=n[a];if(i.isVertex())for(var s=i.getPreviousLayerConnectedCells(t),o=t-1,r=0;r<2;r++){if(-1<o&&o<e.ranks.length&&null!=s&&0<s.length){for(var l=[],d=0;d<s.length;d++){var c=new WeightedCellSorter(s[d],s[d].getX(o));l.push(c)}l.sort(WeightedCellSorter.prototype.compare);var m=(c=i.x[0]-i.width/2)+i.width,u=s=0;for(o=[],d=0;d<l.length;d++){var p,g=l[d].cell;if(g.isVertex()){p=0==r?i.connectsAsSource:i.connectsAsTarget;for(var v=0;v<p.length;v++)p[v].source!=g&&p[v].target!=g||(s+=p[v].edges.length,u++,o.push(p[v]))}else s+=g.edges.length,u++,o.push(g)}for(i.width>(s+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(c+=this.prefHozEdgeSep,m-=this.prefHozEdgeSep),c+=(l=(m-c)/s)/2,m=this.minEdgeJetty-this.prefVertEdgeOff,d=u=0;d<o.length;d++){for(g=o[d].edges.length,v=mxCellPath.create(o[d].edges[0]),null==(p=this.jettyPositions[v])&&(p=[],this.jettyPositions[v]=p),d<s/2?m+=this.prefVertEdgeOff:s/2<d&&(m-=this.prefVertEdgeOff),v=0;v<g;v++)p[4*v+2*r]=c,c+=l,p[4*v+2*r+1]=m;u=Math.max(u,m)}}s=i.getNextLayerConnectedCells(t),o=t+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(e){var t=0;if(101207!=e.temp[0]){var n=e.maxRank,a=e.minRank;n==a&&(n=e.source.maxRank,a=e.target.minRank);for(var i=0,s=mxCellPath.create(e.edges[0]),o=(s=this.jettyPositions[s],e.isReversed?e.target.cell:e.source.cell),r=this.layout.graph,l=0;l<e.edges.length;l++){var d=e.edges[l],c=this.layout.getVisibleTerminal(d,!0),m=r.model.getTerminal(d,!0),u=[],p=e.isReversed;if(c!=o&&(p=!p),null!=s){var g=p?2:0,v=p?this.rankTopY[a]:this.rankBottomY[n],h=s[4*i+1+g];p&&(h=-h),v+=h,g=s[4*i+g],m=r.model.getTerminal(d,!0),this.layout.isPort(m)&&r.model.getParent(m)==c&&(g=null!=(g=r.view.getState(m))?g.x:c.geometry.x+e.source.width*m.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(g,v)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v+h))):(u.push(new mxPoint(v,g)),this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v+h,g)))}for(g=e.x.length-1,v=h=-1,c=e.maxRank-1,p&&(g=0,h=e.x.length,v=1,c=e.minRank+1);e.maxRank!=e.minRank&&g!=h;g+=v){m=e.x[g]+t;var f=(this.rankTopY[c]+this.rankBottomY[c+1])/2,b=(this.rankTopY[c-1]+this.rankBottomY[c])/2;if(p){var E=f;f=b,b=E}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.push(new mxPoint(m,f)),u.push(new mxPoint(m,b))):(u.push(new mxPoint(f,m)),u.push(new mxPoint(b,m))),this.limitX=Math.max(this.limitX,m),c+=v}null!=s&&(g=p?2:0,v=p?this.rankBottomY[n]:this.rankTopY[a],h=s[4*i+3-g],p&&(h=-h),v-=h,g=s[4*i+2-g],p=r.model.getTerminal(d,!1),c=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(p)&&r.model.getParent(p)==c&&(g=null!=(g=r.view.getState(p))?g.x:c.geometry.x+e.target.width*p.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(g,v-h)),u.push(new mxPoint(g,v))):(this.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&u.push(new mxPoint(v-h,g)),u.push(new mxPoint(v,g)))),e.isReversed&&this.processReversedEdge(e,d),this.layout.setEdgePoints(d,u),t=0==t?this.parallelEdgeSpacing:0<t?-t:-t+this.parallelEdgeSpacing,i++}e.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(e){var t=e.cell,n=e.x[0]-e.width/2,a=e.y[0]-e.height/2;this.rankTopY[e.minRank]=Math.min(this.rankTopY[e.minRank],a),this.rankBottomY[e.minRank]=Math.max(this.rankBottomY[e.minRank],a+e.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(t,n,a):this.layout.setVertexLocation(t,a,n),this.limitX=Math.max(this.limitX,n+e.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(e,t){},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(e,t){return null!=e&&null!=t?t.weightedValue>e.weightedValue?-1:t.weightedValue<e.weightedValue?1:t.nudge?-1:1:0},mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(e,t){this.parent=e;var n=this.graph.model;if(this.edgesCache={},null!=t||null!=e){if(null!=t&&null!=e){for(var a=[],i=0;i<t.length;i++)n.isAncestor(e,t[i])&&a.push(t[i]);this.roots=a}else this.roots=t;n.beginUpdate();try{this.run(e),this.resizeParent&&!this.graph.isCellCollapsed(e)&&this.graph.updateGroupBounds([e],this.parentBorder,this.moveParent)}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(e,t){var n=[];if(null!=e&&null!=t){var a,i=this.graph.model,s=null,o=-1e5;for(a in t){var r=t[a];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var l=this.getEdges(r),d=0,c=0,m=0;m<l.length;m++)this.getVisibleTerminal(l[m],!0)==r?d++:c++;0==c&&0<d&&n.push(r),o<(l=d-c)&&(o=l,s=r)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(e){var t=mxCellPath.create(e);if(null!=this.edgesCache[t])return this.edgesCache[t];for(var n=this.graph.model,a=[],i=this.graph.isCellCollapsed(e),s=n.getChildCount(e),o=0;o<s;o++){var r=n.getChildAt(e,o);this.isPort(r)?a=a.concat(n.getEdges(r,!0,!0)):!i&&this.graph.isCellVisible(r)||(a=a.concat(n.getEdges(r,!0,!0)))}for(a=a.concat(n.getEdges(e,!0,!0)),n=[],o=0;o<a.length;o++)((i=this.getVisibleTerminal(a[o],!0))==(s=this.getVisibleTerminal(a[o],!1))||i!=s&&(s==e&&(null==this.parent||this.graph.isValidAncestor(i,this.parent,this.traverseAncestors))||i==e&&(null==this.parent||this.graph.isValidAncestor(s,this.parent,this.traverseAncestors))))&&n.push(a[o]);return this.edgesCache[t]=n},mxHierarchicalLayout.prototype.getVisibleTerminal=function(e,t){var n=null!=(n=this.graph.view.getState(e))?n.getVisibleTerminal(t):this.graph.view.getVisibleTerminal(e,t);return this.isPort(n)&&(n=this.graph.model.getParent(n)),n},mxHierarchicalLayout.prototype.run=function(e){var t=[],n=[];if(null==this.roots&&null!=e){var a={};this.filterDescendants(e,a),this.roots=[];var i,s=!0;for(i in a)if(null!=a[i]){s=!1;break}for(;!s;){var o=this.findRoots(e,a);for(s=0;s<o.length;s++){var r=[];t.push(r),this.traverse(o[s],!0,null,n,r,t,a)}for(s=0;s<o.length;s++)this.roots.push(o[s]);for(i in s=!0,a)if(null!=a[i]){s=!1;break}}}else for(s=0;s<roots.length;s++)r=[],t.push(r),traverse(roots.get(s),!0,null,n,r,t,null);for(s=n=0;s<t.length;s++){for(i in a=[],r=t[s])a.push(r[i]);this.model=new mxGraphHierarchyModel(this,a,this.roots,e,this.tightenToSource),this.cycleStage(e),this.layeringStage(),this.crossingStage(e),n=this.placementStage(n,e)}},mxHierarchicalLayout.prototype.filterDescendants=function(e,t){var n=this.graph.model;if(n.isVertex(e)&&e!=this.parent&&this.graph.isCellVisible(e)&&(t[mxCellPath.create(e)]=e),this.traverseAncestors||e==this.parent&&this.graph.isCellVisible(e))for(var a=n.getChildCount(e),i=0;i<a;i++){var s=n.getChildAt(e,i);this.isPort(s)||this.filterDescendants(s,t)}},mxHierarchicalLayout.prototype.isPort=function(e){return!!e.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=this.getVisibleTerminal(a[s],!0),r=this.getVisibleTerminal(a[s],!1);(o==e&&r==t||!n&&o==t&&r==e)&&i.push(a[s])}return i},mxHierarchicalLayout.prototype.traverse=function(e,t,n,a,i,s,o){if(null!=e&&null!=a){var r=mxCellPath.create(e);if(null!=a[r]||null!=o&&null==o[r]){if(null==i[r])for(n=0;n<s.length;n++)if(null!=(e=s[n])[r]){for(l in i)e[l]=i[l];return s.pop(),e}}else{null==i[r]&&(i[r]=e),null==a[r]&&(a[r]=e),delete o[r];var l=this.getEdges(e);for(n=0;n<l.length;n++)r=this.getVisibleTerminal(l[n],!0)==e,(!t||r)&&(r=this.getVisibleTerminal(l[n],!r),i=this.traverse(r,t,l[n],a,i,s,o))}}return i},mxHierarchicalLayout.prototype.cycleStage=function(e){new mxMinimumCycleRemover(this).execute(e)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(e){new mxMedianHybridCrossingReduction(this).execute(e)},mxHierarchicalLayout.prototype.placementStage=function(e,t){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,e,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(t),n.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(e){this.createIds=e},mxGraphModel.prototype.createRoot=function(){var e=new mxCell;return e.insert(new mxCell),e},mxGraphModel.prototype.getCell=function(e){return null!=this.cells?this.cells[e]:null},mxGraphModel.prototype.filterCells=function(e,t){var n=null;if(null!=e){n=[];for(var a=0;a<e.length;a++)t(e[a])&&n.push(e[a])}return n},mxGraphModel.prototype.getDescendants=function(e){return this.filterDescendants(null,e)},mxGraphModel.prototype.filterDescendants=function(e,t){var n=[];t=t||this.getRoot(),(null==e||e(t))&&n.push(t);for(var a=this.getChildCount(t),i=0;i<a;i++){var s=this.getChildAt(t,i);n=n.concat(this.filterDescendants(e,s))}return n},mxGraphModel.prototype.getRoot=function(e){var t=e||this.root;if(null!=e)for(;null!=e;)t=e,e=this.getParent(e);return t},mxGraphModel.prototype.setRoot=function(e){return this.execute(new mxRootChange(this,e)),e},mxGraphModel.prototype.rootChanged=function(e){var t=this.root;return this.root=e,this.nextId=0,this.cells=null,this.cellAdded(e),t},mxGraphModel.prototype.isRoot=function(e){return null!=e&&this.root==e},mxGraphModel.prototype.isLayer=function(e){return this.isRoot(this.getParent(e))},mxGraphModel.prototype.isAncestor=function(e,t){for(;null!=t&&t!=e;)t=this.getParent(t);return t==e},mxGraphModel.prototype.contains=function(e){return this.isAncestor(this.root,e)},mxGraphModel.prototype.getParent=function(e){return null!=e?e.getParent():null},mxGraphModel.prototype.add=function(e,t,n){if(t!=e&&null!=e&&null!=t){null==n&&(n=this.getChildCount(e));var a=e!=this.getParent(t);this.execute(new mxChildChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParents(t)}return t},mxGraphModel.prototype.cellAdded=function(e){if(null!=e){if(null==e.getId()&&this.createIds&&e.setId(this.createId(e)),null!=e.getId())if((t=this.getCell(e.getId()))!=e){for(;null!=t;)e.setId(this.createId(e)),t=this.getCell(e.getId());null==this.cells&&(this.cells={}),this.cells[e.getId()]=e}mxUtils.isNumeric(e.getId())&&(this.nextId=Math.max(this.nextId,e.getId()));for(var t=this.getChildCount(e),n=0;n<t;n++)this.cellAdded(this.getChildAt(e,n))}},mxGraphModel.prototype.createId=function(e){return e=this.nextId,this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(e,t){t=t||this.getRoot(e);for(var n=this.getChildCount(e),a=0;a<n;a++){var i=this.getChildAt(e,a);this.updateEdgeParents(i,t)}for(i=this.getEdgeCount(e),n=[],a=0;a<i;a++)n.push(this.getEdgeAt(e,a));for(a=0;a<n.length;a++)i=n[a],this.isAncestor(t,i)&&this.updateEdgeParent(i,t)},mxGraphModel.prototype.updateEdgeParent=function(e,t){for(var n=this.getTerminal(e,!0),a=this.getTerminal(e,!1),i=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=a&&!this.isEdge(a)&&null!=a.geometry&&a.geometry.relative;)a=this.getParent(a);if(this.isAncestor(t,n)&&this.isAncestor(t,a)&&(null!=(i=n==a?this.getParent(n):this.getNearestCommonAncestor(n,a))&&(this.getParent(i)!=this.root||this.isAncestor(i,e))&&this.getParent(e)!=i)){if(null!=(n=this.getGeometry(e))){var s=this.getOrigin(this.getParent(e)),o=this.getOrigin(i);a=o.x-s.x,s=o.y-s.y;(n=n.clone()).translate(-a,-s),this.setGeometry(e,n)}this.add(i,e,this.getChildCount(i))}},mxGraphModel.prototype.getOrigin=function(e){var t=null;return null!=e?(t=this.getOrigin(this.getParent(e)),this.isEdge(e)||null!=(e=this.getGeometry(e))&&(t.x+=e.x,t.y+=e.y)):t=new mxPoint,t},mxGraphModel.prototype.getNearestCommonAncestor=function(e,t){if(null!=e&&null!=t&&(null!=(s=mxCellPath.create(t))&&0<s.length)){var n=e,a=mxCellPath.create(n);if(s.length<a.length){n=t;var i=a,s=(a=s,i)}for(;null!=n;){if(i=this.getParent(n),0==s.indexOf(a+mxCellPath.PATH_SEPARATOR)&&null!=i)return n;a=mxCellPath.getParentPath(a),n=i}}return null},mxGraphModel.prototype.remove=function(e){return e==this.root?this.setRoot(null):null!=this.getParent(e)&&this.execute(new mxChildChange(this,null,e)),e},mxGraphModel.prototype.cellRemoved=function(e){if(null!=e&&null!=this.cells){for(var t=this.getChildCount(e)-1;0<=t;t--)this.cellRemoved(this.getChildAt(e,t));null!=this.cells&&null!=e.getId()&&delete this.cells[e.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(e,t,n){var a=this.getParent(e);return null!=t?(t!=a||a.getIndex(e)!=n)&&t.insert(e,n):null!=a&&(n=a.getIndex(e),a.remove(n)),this.contains(a)||null==t?null==t&&this.cellRemoved(e):this.cellAdded(e),a},mxGraphModel.prototype.getChildCount=function(e){return null!=e?e.getChildCount():0},mxGraphModel.prototype.getChildAt=function(e,t){return null!=e?e.getChildAt(t):null},mxGraphModel.prototype.getChildren=function(e){return null!=e?e.children:null},mxGraphModel.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraphModel.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraphModel.prototype.getChildCells=function(e,t,n){t=null!=t&&t,n=null!=n&&n;for(var a=this.getChildCount(e),i=[],s=0;s<a;s++){var o=this.getChildAt(e,s);(!n&&!t||n&&this.isEdge(o)||t&&this.isVertex(o))&&i.push(o)}return i},mxGraphModel.prototype.getTerminal=function(e,t){return null!=e?e.getTerminal(t):null},mxGraphModel.prototype.setTerminal=function(e,t,n){var a=t!=this.getTerminal(e,n);return this.execute(new mxTerminalChange(this,e,t,n)),this.maintainEdgeParent&&a&&this.updateEdgeParent(e,this.getRoot()),t},mxGraphModel.prototype.setTerminals=function(e,t,n){this.beginUpdate();try{this.setTerminal(e,t,!0),this.setTerminal(e,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(e,t,n){var a=this.getTerminal(e,n);return null!=t?t.insertEdge(e,n):null!=a&&a.removeEdge(e,n),a},mxGraphModel.prototype.getEdgeCount=function(e){return null!=e?e.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(e,t){return null!=e?e.getEdgeAt(t):null},mxGraphModel.prototype.getDirectedEdgeCount=function(e,t,n){for(var a=0,i=this.getEdgeCount(e),s=0;s<i;s++){var o=this.getEdgeAt(e,s);o!=n&&this.getTerminal(o,t)==e&&a++}return a},mxGraphModel.prototype.getConnections=function(e){return this.getEdges(e,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(e){return this.getEdges(e,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(e){return this.getEdges(e,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(e,t,n,a){t=null==t||t,n=null==n||n,a=null==a||a;for(var i=this.getEdgeCount(e),s=[],o=0;o<i;o++){var r=this.getEdgeAt(e,o),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(a&&l==d||l!=d&&(t&&d==e||n&&l==e))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;var a=this.getEdgeCount(e),i=this.getEdgeCount(t),s=e,o=a;for(i<a&&(o=i,s=t),a=[],i=0;i<o;i++){var r=this.getEdgeAt(s,i),l=this.getTerminal(r,!0),d=this.getTerminal(r,!1);(l==e&&d==t||!n&&(d==e&&l==t))&&a.push(r)}return a},mxGraphModel.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[];if(null!=e)for(var s=0;s<e.length;s++){var o=this.getTerminal(e[s],!0),r=this.getTerminal(e[s],!1);o==t&&null!=r&&r!=t&&a?i.push(r):r==t&&null!=o&&o!=t&&n&&i.push(o)}return i},mxGraphModel.prototype.getTopmostCells=function(e){for(var t=[],n=0;n<e.length;n++){for(var a=e[n],i=!0,s=this.getParent(a);null!=s;){if(0<=mxUtils.indexOf(e,s)){i=!1;break}s=this.getParent(s)}i&&t.push(a)}return t},mxGraphModel.prototype.isVertex=function(e){return null!=e&&e.isVertex()},mxGraphModel.prototype.isEdge=function(e){return null!=e&&e.isEdge()},mxGraphModel.prototype.isConnectable=function(e){return null!=e&&e.isConnectable()},mxGraphModel.prototype.getValue=function(e){return null!=e?e.getValue():null},mxGraphModel.prototype.setValue=function(e,t){return this.execute(new mxValueChange(this,e,t)),t},mxGraphModel.prototype.valueForCellChanged=function(e,t){return e.valueChanged(t)},mxGraphModel.prototype.getGeometry=function(e,t){return null!=e?e.getGeometry():null},mxGraphModel.prototype.setGeometry=function(e,t){return t!=this.getGeometry(e)&&this.execute(new mxGeometryChange(this,e,t)),t},mxGraphModel.prototype.geometryForCellChanged=function(e,t){var n=this.getGeometry(e);return e.setGeometry(t),n},mxGraphModel.prototype.getStyle=function(e){return null!=e?e.getStyle():null},mxGraphModel.prototype.setStyle=function(e,t){return t!=this.getStyle(e)&&this.execute(new mxStyleChange(this,e,t)),t},mxGraphModel.prototype.styleForCellChanged=function(e,t){var n=this.getStyle(e);return e.setStyle(t),n},mxGraphModel.prototype.isCollapsed=function(e){return null!=e&&e.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(e,t){return t!=this.isCollapsed(e)&&this.execute(new mxCollapseChange(this,e,t)),t},mxGraphModel.prototype.collapsedStateForCellChanged=function(e,t){var n=this.isCollapsed(e);return e.setCollapsed(t),n},mxGraphModel.prototype.isVisible=function(e){return null!=e&&e.isVisible()},mxGraphModel.prototype.setVisible=function(e,t){return t!=this.isVisible(e)&&this.execute(new mxVisibleChange(this,e,t)),t},mxGraphModel.prototype.visibleStateForCellChanged=function(e,t){var n=this.isVisible(e);return e.setVisible(t),n},mxGraphModel.prototype.execute=function(e){e.execute(),this.beginUpdate(),this.currentEdit.add(e),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",e)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var e=this.currentEdit;this.currentEdit=this.createUndoableEdit(),e.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(){var e=new mxUndoableEdit(this,!0);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(e,t,n){n=null==n||n,this.beginUpdate();try{var a={};for(var i in this.mergeChildrenImpl(e,t,n,a),a){var s=a[i],o=this.getTerminal(s,!0);null!=o&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=a[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(e,t,n,a){this.beginUpdate();try{for(var i=e.getChildCount(),s=0;s<i;s++){var o=e.getChildAt(s);if("function"==typeof o.getId){var r=o.getId(),l=null==r||this.isEdge(o)&&n?null:this.getCell(r);if(null==l){var d=o.clone();d.setId(r),d.setTerminal(o.getTerminal(!0),!0),d.setTerminal(o.getTerminal(!1),!1),l=t.insert(d),this.cellAdded(l)}a[mxCellPath.create(o)]=l,this.mergeChildrenImpl(o,l,n,a)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(e){var t=[];if(null!=e)for(var n={},a=0;a<e.length;a++){var i=this.getParent(e[a]);if(null!=i){var s=mxCellPath.create(i);null==n[s]&&(n[s]=i,t.push(i))}}return t},mxGraphModel.prototype.cloneCell=function(e){return null!=e?this.cloneCells([e],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(e,t){for(var n={},a=[],i=0;i<e.length;i++)null!=e[i]?a.push(this.cloneCellImpl(e[i],n,t)):a.push(null);for(i=0;i<a.length;i++)null!=a[i]&&this.restoreClone(a[i],e[i],n);return a},mxGraphModel.prototype.cloneCellImpl=function(e,t,n){var a=this.cellCloned(e);if(t[mxObjectIdentity.get(e)]=a,n){n=this.getChildCount(e);for(var i=0;i<n;i++){var s=this.cloneCellImpl(this.getChildAt(e,i),t,!0);a.insert(s)}}return a},mxGraphModel.prototype.cellCloned=function(e){return e.clone()},mxGraphModel.prototype.restoreClone=function(e,t,n){null!=(a=this.getTerminal(t,!0))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!0)),null!=(a=this.getTerminal(t,!1))&&(null!=(a=n[mxObjectIdentity.get(a)])&&a.insertEdge(e,!1));for(var a=this.getChildCount(e),i=0;i<a;i++)this.restoreClone(this.getChildAt(e,i),this.getChildAt(t,i),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var e=this.model.getParent(this.child),t=null!=e?e.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),e=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=e,this.index=this.previousIndex,this.previousIndex=t},mxChildChange.prototype.connect=function(e,t){t=null==t||t;var n=e.getTerminal(!0),a=e.getTerminal(!1);for(null!=n&&(t?this.model.terminalForCellChanged(e,n,!0):this.model.terminalForCellChanged(e,null,!0)),null!=a&&(t?this.model.terminalForCellChanged(e,a,!1):this.model.terminalForCellChanged(e,null,!1)),e.setTerminal(n,!0),e.setTerminal(a,!1),n=this.model.getChildCount(e),a=0;a<n;a++)this.connect(this.model.getChildAt(e,a),t)},mxTerminalChange.prototype.execute=function(){this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)},mxValueChange.prototype.execute=function(){this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous)},mxStyleChange.prototype.execute=function(){this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous)},mxGeometryChange.prototype.execute=function(){this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous)},mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)},mxVisibleChange.prototype.execute=function(){this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)},mxCellAttributeChange.prototype.execute=function(){var e=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=e},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient="id value parent source target children edges".split(" "),mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(e){this.id=e},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(e){this.value=e},mxCell.prototype.valueChanged=function(e){var t=this.getValue();return this.setValue(e),t},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(e){this.geometry=e},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(e){this.style=e},mxCell.prototype.isVertex=function(){return this.vertex},mxCell.prototype.setVertex=function(e){this.vertex=e},mxCell.prototype.isEdge=function(){return this.edge},mxCell.prototype.setEdge=function(e){this.edge=e},mxCell.prototype.isConnectable=function(){return this.connectable},mxCell.prototype.setConnectable=function(e){this.connectable=e},mxCell.prototype.isVisible=function(){return this.visible},mxCell.prototype.setVisible=function(e){this.visible=e},mxCell.prototype.isCollapsed=function(){return this.collapsed},mxCell.prototype.setCollapsed=function(e){this.collapsed=e},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(e){this.parent=e},mxCell.prototype.getTerminal=function(e){return e?this.source:this.target},mxCell.prototype.setTerminal=function(e,t){return t?this.source=e:this.target=e,e},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(e){return mxUtils.indexOf(this.children,e)},mxCell.prototype.getChildAt=function(e){return null==this.children?null:this.children[e]},mxCell.prototype.insert=function(e,t){return null!=e&&(null==t&&(t=this.getChildCount(),e.getParent()==this&&t--),e.removeFromParent(),e.setParent(this),null==this.children?(this.children=[],this.children.push(e)):this.children.splice(t,0,e)),e},mxCell.prototype.remove=function(e){var t=null;return null!=this.children&&0<=e&&(null!=(t=this.getChildAt(e))&&(this.children.splice(e,1),t.setParent(null))),t},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var e=this.parent.getIndex(this);this.parent.remove(e)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(e){return mxUtils.indexOf(this.edges,e)},mxCell.prototype.getEdgeAt=function(e){return null==this.edges?null:this.edges[e]},mxCell.prototype.insertEdge=function(e,t){return null!=e&&(e.removeFromTerminal(t),e.setTerminal(this,t),null==this.edges||e.getTerminal(!t)!=this||mxUtils.indexOf(this.edges,e)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(e)),e},mxCell.prototype.removeEdge=function(e,t){if(null!=e){if(e.getTerminal(!t)!=this&&null!=this.edges){var n=this.getEdgeIndex(e);0<=n&&this.edges.splice(n,1)}e.setTerminal(null,t)}return e},mxCell.prototype.removeFromTerminal=function(e){var t=this.getTerminal(e);null!=t&&t.removeEdge(this,e)},mxCell.prototype.getAttribute=function(e,t){var n=this.getValue();return(null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(e):null)||t},mxCell.prototype.setAttribute=function(e,t){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(e,t)},mxCell.prototype.clone=function(){var e=mxUtils.clone(this,this.mxTransient);return e.setValue(this.cloneValue()),e},mxCell.prototype.cloneValue=function(){var e=this.getValue();return null!=e&&("function"==typeof e.clone?e=e.clone():isNaN(e.nodeType)||(e=e.cloneNode(!0))),e},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=e}},mxGeometry.prototype.getTerminalPoint=function(e){return e?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(e,t){return t?this.sourcePoint=e:this.targetPoint=e,e},mxGeometry.prototype.translate=function(e,t){if(this.clone(),this.relative||(this.x+=e,this.y+=t),null!=this.sourcePoint&&(this.sourcePoint.x+=e,this.sourcePoint.y+=t),null!=this.targetPoint&&(this.targetPoint.x+=e,this.targetPoint.y+=t),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=this.points.length,a=0;a<n;a++){var i=this.points[a];null!=i&&(i.x+=e,i.y+=t)}};var mxCellPath={PATH_SEPARATOR:".",create:function(e){var t="";if(null!=e)for(var n=e.getParent();null!=n;)t=n.getIndex(e)+mxCellPath.PATH_SEPARATOR+t,n=(e=n).getParent();return 1<(e=t.length)&&(t=t.substring(0,e-1)),t},getParentPath:function(e){if(null!=e){var t=e.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=t)return e.substring(0,t);if(0<e.length)return""}return null},resolve:function(e,t){var n=e;if(null!=t)for(var a=t.split(mxCellPath.PATH_SEPARATOR),i=0;i<a.length;i++)n=n.getChildAt(parseInt(a[i]));return n},compare:function(e,t){for(var n=Math.min(e.length,t.length),a=0,i=0;i<n;i++)if(e[i]!=t[i]){a=0==e[i].length||0==t[i].length?e[i]==t[i]?0:e[i]>t[i]?1:-1:(n=parseInt(e[i]))==(i=parseInt(t[i]))?0:i<n?1:-1;break}return 0==a&&((n=e.length)!=(i=t.length)&&(a=i<n?1:-1)),a}},mxPerimeter={RectanglePerimeter:function(e,t,n,a){t=e.getCenterX();var i=e.getCenterY(),s=Math.atan2(n.y-i,n.x-t),o=new mxPoint(0,0),r=Math.PI,l=Math.PI/2-s,d=Math.atan2(e.height,e.width);return s<-r+d||r-d<s?(o.x=e.x,o.y=i-e.width*Math.tan(s)/2):s<-d?(o.y=e.y,o.x=t-e.height*Math.tan(l)/2):s<d?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(s)/2):(o.y=e.y+e.height,o.x=t+e.height*Math.tan(l)/2),a&&(n.x>=e.x&&n.x<=e.x+e.width?o.x=n.x:n.y>=e.y&&n.y<=e.y+e.height&&(o.y=n.y),n.x<e.x?o.x=e.x:n.x>e.x+e.width&&(o.x=e.x+e.width),n.y<e.y?o.y=e.y:n.y>e.y+e.height&&(o.y=e.y+e.height)),o},EllipsePerimeter:function(e,t,n,a){var i=e.x,s=e.y,o=e.width/2,r=e.height/2,l=i+o,d=s+r;t=n.x,n=n.y;var c=parseInt(t-l),m=parseInt(n-d);if(0==c&&0!=m)return new mxPoint(l,d+r*m/Math.abs(m));if(0==c&&0==m)return new mxPoint(t,n);if(a){if(s<=n&&n<=s+e.height)return e=n-d,e=Math.sqrt(o*o*(1-e*e/(r*r)))||0,t<=i&&(e=-e),new mxPoint(l+e,n);if(i<=t&&t<=i+e.width)return e=t-l,e=Math.sqrt(r*r*(1-e*e/(o*o)))||0,n<=s&&(e=-e),new mxPoint(t,d+e)}return d-=(i=m/c)*l,l=i*(o=(-(e=-2*l*(s=o*o*i*i+r*r))+(r=Math.sqrt(e*e-4*s*(o*o*i*i*l*l+r*r*l*l-o*o*r*r))))/(2*s))+d,d=i*(r=(-e-r)/(2*s))+d,i=Math.sqrt(Math.pow(o-t,2)+Math.pow(l-n,2)),t=Math.sqrt(Math.pow(r-t,2)+Math.pow(d-n,2)),s=n=0,s=i<t?(n=o,l):(n=r,d),new mxPoint(n,s)},RhombusPerimeter:function(e,t,n,a){t=e.x;var i=e.y,s=e.width,o=t+s/2,r=i+(e=e.height)/2,l=n.x;if(n=n.y,o==l)return new mxPoint(o,n<r?i:i+e);if(r==n)return new mxPoint(l<o?t:t+s,r);var d=o,c=r;return a&&(t<=l&&l<=t+s?d=l:i<=n&&n<=i+e&&(c=n)),l<o?n<r?mxUtils.intersection(l,n,d,c,o,i,t,r):mxUtils.intersection(l,n,d,c,o,i+e,t,r):n<r?mxUtils.intersection(l,n,d,c,o,i,t+s,r):mxUtils.intersection(l,n,d,c,o,i+e,t+s,r)},TrianglePerimeter:function(e,t,n,a){var i=(t=null!=t?t.style[mxConstants.STYLE_DIRECTION]:null)==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_SOUTH,s=e.x,o=e.y,r=e.width,l=s+r/2,d=o+(e=e.height)/2,c=new mxPoint(s,o),m=new mxPoint(s+r,d),u=new mxPoint(s,o+e);t==mxConstants.DIRECTION_NORTH?(c=u,m=new mxPoint(l,o),u=new mxPoint(s+r,o+e)):t==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(l,o+e),u=new mxPoint(s+r,o)):t==mxConstants.DIRECTION_WEST&&(c=new mxPoint(s+r,o),m=new mxPoint(s,d),u=new mxPoint(s+r,o+e));var p=n.x-l,g=n.y-d,v=(p=i?Math.atan2(p,g):Math.atan2(g,p),i?Math.atan2(r,e):Math.atan2(e,r));g=!1,g=t==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_WEST?-v<p&&p<v:p<-Math.PI+v||p>Math.PI-v,v=null;return null==(v=g?a&&(i&&n.x>=c.x&&n.x<=u.x||!i&&n.y>=c.y&&n.y<=u.y)?i?new mxPoint(n.x,c.y):new mxPoint(c.x,n.y):t==mxConstants.DIRECTION_NORTH?new mxPoint(s+r/2+e*Math.tan(p)/2,o+e):t==mxConstants.DIRECTION_SOUTH?new mxPoint(s+r/2-e*Math.tan(p)/2,o):t==mxConstants.DIRECTION_WEST?new mxPoint(s+r,o+e/2+r*Math.tan(p)/2):new mxPoint(s,o+e/2-r*Math.tan(p)/2):(a&&(a=new mxPoint(l,d),n.y>=o&&n.y<=o+e?(a.x=i?l:t==mxConstants.DIRECTION_WEST?s+r:s,a.y=n.y):n.x>=s&&n.x<=s+r&&(a.x=n.x,a.y=i?t==mxConstants.DIRECTION_NORTH?o+e:o:d),l=a.x,d=a.y),i&&n.x<=s+r/2||!i&&n.y<=o+e/2?mxUtils.intersection(n.x,n.y,l,d,c.x,c.y,m.x,m.y):mxUtils.intersection(n.x,n.y,l,d,m.x,m.y,u.x,u.y)))&&(v=new mxPoint(l,d)),v}};function mxPrintPreview(e,t,n,a,i,s,o,r,l){this.graph=e,this.scale=null!=t?t:1/e.pageScale,this.border=null!=a?a:0,this.pageFormat=null!=n?n:e.pageFormat,this.title=null!=r?r:"Printer-friendly version",this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==l||l}function mxStylesheet(){this.styles={},this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(e,t,n){this.view=e,this.cell=t,this.style=n,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(e){this.graph=e,this.cells=[]}function mxSelectionChange(e,t,n){this.selectionModel=e,this.added=null!=t?t.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(e){this.graph=e}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var e="";return 8==document.documentMode&&(e='<meta http-equiv="X-UA-Compatible" content="IE=8">'),e},mxPrintPreview.prototype.open=function(e){var t=this.graph.cellRenderer.initializeOverlay,n=null;try{if(this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(e,t){t.init(e.view.getDrawPane())}),null==this.wnd){this.wnd=window.open();var a=this.wnd.document,i=this.getDoctype();null!=i&&0<i.length&&a.writeln(i),a.writeln("<html>"),a.writeln("<head>"),this.writeHead(a,e),a.writeln("</head>"),a.writeln('<body class="mxPage">'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a),mxClient.IS_VML&&(a.namespaces.add("v","urn:schemas-microsoft-com:vml"),a.namespaces.add("o","urn:schemas-microsoft-com:office:office"),a.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}",mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css",a));var s=this.graph.getGraphBounds().clone(),o=this.graph.getView().getScale(),r=o/this.scale,l=this.graph.getView().getTranslate();this.autoOrigin||(this.x0=-l.x*this.scale,this.y0=-l.y*this.scale,s.width+=s.x,s.height+=s.y,s.x=0,this.border=s.y=0),s.width/=r,s.height/=r;var d=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border,m=Math.max(1,Math.ceil((s.width+this.x0)/d)),u=Math.max(1,Math.ceil((s.height+this.y0)/c));this.pageCount=m*u;var p=mxUtils.bind(this,function(){if(this.pageSelector&&(1<u||1<m)){var e=this.createPageSelector(u,m);if(a.body.appendChild(e),mxClient.IS_IE){e.style.position="absolute";var t=function(){e.style.top=a.body.scrollTop+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(e){t()}),mxEvent.addListener(this.wnd,"resize",function(e){t()})}}});if(e=function(e,t){if(null!=this.borderColor&&(e.style.borderColor=this.borderColor,e.style.borderStyle="solid",e.style.borderWidth="1px"),e.style.background="white",t&&(e.style.pageBreakAfter="always"),mxClient.IS_IE?(a.writeln(e.outerHTML),e.parentNode.removeChild(e)):(e.parentNode.removeChild(e),a.body.appendChild(e)),t){var n=a.createElement("hr");n.className="mxPageBreak",a.body.appendChild(n)}},null!=(f=this.getCoverPages(this.pageFormat.width,this.pageFormat.height)))for(var g=0;g<f.length;g++)e(f[g],!0);var v=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(g=0;g<u;g++)for(var h=g*c/this.scale-this.y0/this.scale+(s.y-l.y*o)/o,f=0;f<m;f++){if(null==this.wnd)return null;var b=f*d/this.scale-this.x0/this.scale+(s.x-l.x*o)/o,E=g*m+f+1;(n=this.renderPage(this.pageFormat.width,this.pageFormat.height,mxUtils.bind(this,function(e){this.addGraphFragment(-b,-h,this.scale,E,e)}))).setAttribute("id","mxPage-"+E),e(n,null!=v||g<u-1||f<m-1)}if(null!=v)for(g=0;g<v.length;g++)e(v[g],g<v.length);a.writeln("</body>"),a.writeln("</html>"),a.close(),p(),mxEvent.release(a.body)}this.wnd.focus()}catch(e){null!=n&&null!=n.parentNode&&n.parentNode.removeChild(n)}finally{this.graph.cellRenderer.initializeOverlay=t}return this.wnd},mxPrintPreview.prototype.writeHead=function(e,t){null!=this.title&&e.writeln("<title>"+this.title+"</title>"),e.writeln('<style type="text/css">'),e.writeln("@media print {"),e.writeln(" table.mxPageSelector { display: none; }"),e.writeln(" hr.mxPageBreak { display: none; }"),e.writeln("}"),e.writeln("@media screen {"),e.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),e.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),e.writeln(" body.mxPage { background: gray; }"),e.writeln("}"),null!=t&&e.writeln(t),e.writeln("</style>")},mxPrintPreview.prototype.createPageSelector=function(e,t){var n=this.wnd.document,a=n.createElement("table");a.className="mxPageSelector",a.setAttribute("border","0");for(var i=n.createElement("tbody"),s=0;s<e;s++){for(var o=n.createElement("tr"),r=0;r<t;r++){var l=s*t+r+1,d=n.createElement("td");if(!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC){var c=n.createElement("a");c.setAttribute("href","#mxPage-"+l),mxUtils.write(c,l,n),d.appendChild(c)}else mxUtils.write(d,l,n);o.appendChild(d)}i.appendChild(o)}return a.appendChild(i),a},mxPrintPreview.prototype.renderPage=function(e,t,n){var a=document.createElement("div");try{a.style.width=e+"px",a.style.height=t+"px",a.style.overflow="hidden",a.style.pageBreakInside="avoid",a.style.position="relative";var i=document.createElement("div");i.style.top=this.border+"px",i.style.left=this.border+"px",i.style.width=e-2*this.border+"px",i.style.height=t-2*this.border+"px",i.style.overflow="hidden",this.graph.dialect==mxConstants.DIALECT_VML&&(i.style.position="absolute"),a.appendChild(i),document.body.appendChild(a),n(i)}catch(e){throw a.parentNode.removeChild(a),e}return a},mxPrintPreview.prototype.addGraphFragment=function(e,t,n,a,i){a=this.graph.getView();var s=this.graph.container;this.graph.container=i;var o=a.getCanvas(),r=a.getBackgroundPane(),l=a.getDrawPane(),d=a.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?a.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?a.createVml():a.createHtml();var c=a.isEventsEnabled();a.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var u=a.getTranslate();a.translate=new mxPoint(e,t),e=null;try{var p=[this.graph.getModel().getRoot()];e=new mxTemporaryCellStates(a,n,p)}finally{if(mxClient.IS_IE)a.overlayPane.innerHTML="";else for(n=i.firstChild;null!=n;)p=n.nextSibling,"svg"==(t=n.nodeName.toLowerCase())?(n.setAttribute("width",parseInt(i.style.width)),n.setAttribute("height",parseInt(i.style.height))):"default"!=n.style.cursor&&"table"!=t&&n.parentNode.removeChild(n),n=p;a.overlayPane.parentNode.removeChild(a.overlayPane),this.graph.setEnabled(m),this.graph.container=s,a.canvas=o,a.backgroundPane=r,a.drawPane=l,a.overlayPane=d,a.translate=u,e.destroy(),a.setEventsEnabled(c)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(){var e=this.open();null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.createDefaultVertexStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#774400",e},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var e={};return e[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,e[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,e[mxConstants.STYLE_STROKECOLOR]="#6482B9",e[mxConstants.STYLE_FONTCOLOR]="#446299",e},mxStylesheet.prototype.putDefaultVertexStyle=function(e){this.putCellStyle("defaultVertex",e)},mxStylesheet.prototype.putDefaultEdgeStyle=function(e){this.putCellStyle("defaultEdge",e)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(e,t){this.styles[e]=t},mxStylesheet.prototype.getCellStyle=function(e,t){var n=t;if(null!=e&&0<e.length)for(var a=e.split(";"),i=(n=null!=n&&";"!=e.charAt(0)?mxUtils.clone(n):{},0);i<a.length;i++){var s=(o=a[i]).indexOf("=");if(0<=s){var o,r=o.substring(0,s);(o=o.substring(s+1))==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(o)?n[r]=parseFloat(o):n[r]=o}else if(null!=(o=this.styles[o]))for(r in o)n[r]=o[r]}return n},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalid=!0,mxCellState.prototype.invalidOrder=!1,mxCellState.prototype.orderChanged=!1,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.getPerimeterBounds=function(e,t){if(e=e||0,t=null!=t?t:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil){var n=this.shape.stencil.computeAspect(this.style,t.x,t.y,t.width,t.height);t.x=n.x,t.y=n.y,t.width=this.shape.stencil.w0*n.width,t.height=this.shape.stencil.h0*n.height}return 0!=e&&t.grow(e),t},mxCellState.prototype.setAbsoluteTerminalPoint=function(e,t){t?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[0]=e):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(e)):1==this.absolutePoints.length?this.absolutePoints.push(e):this.absolutePoints[this.absolutePoints.length-1]=e},mxCellState.prototype.setCursor=function(e){null!=this.shape&&this.shape.setCursor(e),null!=this.text&&this.text.setCursor(e)},mxCellState.prototype.getVisibleTerminal=function(e){return null!=(e=this.getVisibleTerminalState(e))?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(e){return e?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(e,t){t?this.visibleSourceState=e:this.visibleTargetState=e},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxCellState.prototype.clone=function(){var e=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){e.absolutePoints=[];for(var t=0;t<this.absolutePoints.length;t++)e.absolutePoints[t]=this.absolutePoints[t].clone()}return null!=this.origin&&(e.origin=this.origin.clone()),null!=this.absoluteOffset&&(e.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(e.boundingBox=this.boundingBox.clone()),e.terminalDistance=this.terminalDistance,e.segments=this.segments,e.length=this.length,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(e){this.singleSelection=e},mxGraphSelectionModel.prototype.isSelected=function(e){return null!=e&&0<=mxUtils.indexOf(this.cells,e)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(e){null!=e&&this.setCells([e])},mxGraphSelectionModel.prototype.setCells=function(e){if(null!=e){this.singleSelection&&(e=[this.getFirstSelectableCell(e)]);for(var t=[],n=0;n<e.length;n++)this.graph.isCellSelectable(e[n])&&t.push(e[n]);this.changeSelection(t,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(e){if(null!=e)for(var t=0;t<e.length;t++)if(this.graph.isCellSelectable(e[t]))return e[t];return null},mxGraphSelectionModel.prototype.addCell=function(e){null!=e&&this.addCells([e])},mxGraphSelectionModel.prototype.addCells=function(e){if(null!=e){var t=null;this.singleSelection&&(t=this.cells,e=[this.getFirstSelectableCell(e)]);for(var n=[],a=0;a<e.length;a++)!this.isSelected(e[a])&&this.graph.isCellSelectable(e[a])&&n.push(e[a]);this.changeSelection(n,t)}},mxGraphSelectionModel.prototype.removeCell=function(e){null!=e&&this.removeCells([e])},mxGraphSelectionModel.prototype.removeCells=function(e){if(null!=e){for(var t=[],n=0;n<e.length;n++)this.isSelected(e[n])&&t.push(e[n]);this.changeSelection(null,t)}},mxGraphSelectionModel.prototype.changeSelection=function(e,t){if(null!=e&&0<e.length&&null!=e[0]||null!=t&&0<t.length&&null!=t[0]){var n=new mxSelectionChange(this,e,t);n.execute();var a=new mxUndoableEdit(this,!1);a.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a))}},mxGraphSelectionModel.prototype.cellAdded=function(e){null!=e&&!this.isSelected(e)&&this.cells.push(e)},mxGraphSelectionModel.prototype.cellRemoved=function(e){null!=e&&(0<=(e=mxUtils.indexOf(this.cells,e))&&this.cells.splice(e,1))},mxSelectionChange.prototype.execute=function(){var e=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var t=0;t<this.removed.length;t++)this.selectionModel.cellRemoved(this.removed[t]);if(null!=this.added)for(t=0;t<this.added.length;t++)this.selectionModel.cellAdded(this.added[t]);t=this.added,this.added=this.removed,this.removed=t,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",e),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.emptyLabelText="",mxCellEditor.prototype.textNode="",mxCellEditor.prototype.init=function(){this.textarea=document.createElement("textarea"),this.textarea.className="mxCellEditor",this.textarea.style.position="absolute",this.textarea.style.overflow="visible",this.textarea.setAttribute("cols","20"),this.textarea.setAttribute("rows","4"),mxClient.IS_NS&&(this.textarea.style.resize="none"),mxEvent.addListener(this.textarea,"blur",mxUtils.bind(this,function(e){this.focusLost()})),mxEvent.addListener(this.textarea,"keydown",mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(113==e.keyCode||this.graph.isEnterStopsCellEditing()&&13==e.keyCode&&!mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e)?(this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode?(this.graph.stopEditing(!0),mxEvent.consume(e)):(this.clearOnChange&&(this.clearOnChange=!1,this.textarea.value=""),this.setModified(!0)))})),mxEvent.addListener(this.textarea,"keypress",mxUtils.bind(this,function(e){this.autoSize&&!mxEvent.isConsumed(e)&&setTimeout(mxUtils.bind(this,function(){this.resize()}),0)}))},mxCellEditor.prototype.resize=function(){if(null!=this.textDiv){var e=this.graph.getView().getState(this.editingCell),t=this.graph.isLabelClipped(e.cell),n=this.graph.isWrapping(e.cell);if(this.graph.getModel().isEdge(e.cell))this.bounds.x=e.absoluteOffset.x,this.bounds.y=e.absoluteOffset.y,this.bounds.width=0,this.bounds.height=0;else if(null!=this.bounds){this.bounds.x=e.x,this.bounds.y=e.y,this.bounds.width=e.width,this.bounds.height=e.height,(a=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?this.bounds.x-=e.width:a==mxConstants.ALIGN_RIGHT&&(this.bounds.x+=e.width),(a=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?this.bounds.y-=e.height:a==mxConstants.ALIGN_BOTTOM&&(this.bounds.y+=e.height)}"\n"!=(a=this.textarea.value).charAt(a.length-1)&&""!=a||(a+=" "),a=mxUtils.htmlEntities(a,!1),n?(this.textDiv.style.whiteSpace="normal",this.textDiv.style.width=this.bounds.width+"px"):a=a.replace(/ /g," "),a=a.replace(/\n/g,"<br/>"),this.textDiv.innerHTML=a;var a=this.textDiv.offsetWidth+30,i=this.textDiv.offsetHeight+16;a=Math.max(a,40),i=Math.max(i,20);t&&(a=Math.min(this.bounds.width-4,a),i=Math.min(this.bounds.height,i));var s=null!=e.text?e.text.margin:null;null==s&&(s=mxUtils.getValue(e.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),s=mxUtils.getAlignmentAsPoint(s,e)),null!=s&&(!t&&n||(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-s.x*this.bounds.width+s.x*a)-3)+"px"),this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-s.y*this.bounds.height+s.y*i)+4)+"px"),!t&&n||(this.textarea.style.width=a+"px"),this.textarea.style.height=i+"px"}},mxCellEditor.prototype.isModified=function(){return this.modified},mxCellEditor.prototype.setModified=function(e){this.modified=e},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.startEditing=function(e,t){null==this.textarea&&this.init(),this.stopEditing(!0);var n=this.graph.getView().getState(e);if(null!=n){this.editingCell=e,this.trigger=t,(this.textNode=null)!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden");var a=this.graph.getView().scale,i=(a=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)*a,mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,d=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.lineHeight=Math.round(a*mxConstants.LINE_HEIGHT)+"px",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.color=s,this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.textDecoration=d?"underline":"",this.textarea.style.overflow="auto",this.textarea.style.outline="none",this.bounds=a=this.getEditorBounds(n),this.textarea.style.left=a.x+"px",this.textarea.style.top=a.y+"px",this.textarea.style.width=a.width+"px",this.textarea.style.height=a.height+"px",this.textarea.style.zIndex=5,null==(n=this.getInitialValue(n,t))||0==n.length?(n=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=!1,this.setModified(!1),this.textarea.value=n,this.graph.container.appendChild(this.textarea),"none"!=this.textarea.style.display&&(this.autoSize&&(this.textDiv=this.createTextDiv(),document.body.appendChild(this.textDiv),this.resize()),this.textarea.focus(),this.textarea.select())}},mxCellEditor.prototype.createTextDiv=function(){var e=document.createElement("div"),t=e.style;return t.position="absolute",t.whiteSpace="nowrap",t.visibility="hidden",t.display=mxClient.IS_QUIRKS?"inline":"inline-block",t.zoom="1",t.verticalAlign="top",t.lineHeight=this.textarea.style.lineHeight,t.fontSize=this.textarea.style.fontSize,t.fontFamily=this.textarea.style.fontFamily,t.fontWeight=this.textarea.style.fontWeight,t.textAlign=this.textarea.style.textAlign,t.fontStyle=this.textarea.style.fontStyle,t.textDecoration=this.textarea.style.textDecoration,e},mxCellEditor.prototype.stopEditing=function(e){null!=this.editingCell&&(null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null),!e&&this.isModified()&&this.graph.labelChanged(this.editingCell,this.getCurrentValue(),this.trigger),null!=this.textDiv&&(document.body.removeChild(this.textDiv),this.textDiv=null),this.bounds=this.trigger=this.editingCell=null,this.textarea.blur(),this.textarea.parentNode.removeChild(this.textarea))},mxCellEditor.prototype.getInitialValue=function(e,t){return this.graph.getEditingValue(e.cell,t)},mxCellEditor.prototype.getCurrentValue=function(){return this.textarea.value.replace(/\r/g,"")},mxCellEditor.prototype.isHideLabel=function(e){return!0},mxCellEditor.prototype.getMinimumSize=function(e){var t=this.graph.getView().scale;return new mxRectangle(0,0,null==e.text?30:e.text.size*t+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(e){var t=this.graph.getModel().isEdge(e.cell),n=this.graph.getView().scale,a=(i=this.getMinimumSize(e)).width,i=i.height,s=parseInt(e.style[mxConstants.STYLE_SPACING]||2)*n,o=parseInt(e.style[mxConstants.STYLE_SPACING_TOP]||0)*n+s,r=parseInt(e.style[mxConstants.STYLE_SPACING_RIGHT]||0)*n+s,l=parseInt(e.style[mxConstants.STYLE_SPACING_BOTTOM]||0)*n+s;n=parseInt(e.style[mxConstants.STYLE_SPACING_LEFT]||0)*n+s,r=new mxRectangle(e.x,e.y,Math.max(a,e.width-n-r),Math.max(i,e.height-o-l));return t?(r.x=e.absoluteOffset.x,r.y=e.absoluteOffset.y,null!=e.text&&null!=e.text.boundingBox&&(0<e.text.boundingBox.x&&(r.x=e.text.boundingBox.x),0<e.text.boundingBox.y&&(r.y=e.text.boundingBox.y))):null!=e.text&&null!=e.text.boundingBox&&(r.x=Math.min(r.x,e.text.boundingBox.x),r.y=Math.min(r.y,e.text.boundingBox.y)),r.x+=n,r.y+=o,null!=e.text&&null!=e.text.boundingBox&&(t?(r.width=Math.max(a,e.text.boundingBox.width),r.height=Math.max(i,e.text.boundingBox.height)):(r.width=Math.max(r.width,e.text.boundingBox.width),r.height=Math.max(r.height,e.text.boundingBox.height))),this.graph.getModel().isVertex(e.cell)&&((t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?r.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(r.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?r.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(r.y+=e.height)),r},mxCellEditor.prototype.getEmptyLabelText=function(e){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null)},mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.defaultShapes={},mxCellRenderer.registerShape=function(e,t){mxCellRenderer.prototype.defaultShapes[e]=t},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initialize=function(e,t){var n=e.view.graph.getModel();null!=e.view.graph.container&&null==e.shape&&e.cell!=e.view.currentRoot&&(n.isVertex(e.cell)||n.isEdge(e.cell))&&(this.createShape(e),null==e.shape||null!=t&&!t||(this.initializeShape(e),e.view.graph.ordered||n.isEdge(e.cell)?e.invalidOrder=!0:e.view.graph.keepEdgesInForeground&&null!=this.firstEdge&&(this.firstEdge.parentNode==e.shape.node.parentNode?this.insertState(e,this.firstEdge):this.firstEdge=null),e.shape.scale=e.view.scale,this.createCellOverlays(e),this.installListeners(e)))},mxCellRenderer.prototype.initializeShape=function(e){e.shape.init(e.view.getDrawPane())},mxCellRenderer.prototype.getPreviousStateInContainer=function(e,t){for(var n=null,a=e.view.graph,i=a.getModel(),s=e.cell,o=i.getParent(s);null!=o&&null==n;)n=this.findPreviousStateInContainer(a,o,s,t),s=o,o=i.getParent(s);return n},mxCellRenderer.prototype.findPreviousStateInContainer=function(e,t,n,a){var i=null,s=e.getModel();for(n=null!=n?t.getIndex(n)-1:s.getChildCount(t)-1;0<=n&&null==i;n--)i=this.findPreviousStateInContainer(e,s.getChildAt(t,n),null,a);return null!=i||(null==(i=e.view.getState(t))||null!=i.shape&&null!=i.shape.node&&i.shape.node.parentNode==a)||(i=null),i},mxCellRenderer.prototype.order=function(e){var t=e.shape.node.parentNode,n=this.getPreviousStateInContainer(e,t),a=t.firstChild;null!=n&&(a=n.shape.node,null!=n.text&&null!=n.text.node&&n.text.node.parentNode==t&&(a=n.text.node),a=a.nextSibling),this.insertState(e,a)},mxCellRenderer.prototype.orderEdge=function(e){var t=(n=e.view).graph.getModel();if(n.graph.keepEdgesInForeground)null!=this.firstEdge&&null!=this.firstEdge.parentNode&&this.firstEdge.parentNode==e.shape.node.parentNode||(this.firstEdge=e.shape.node);else if(n.graph.keepEdgesInBackground){var n,a=e.shape.node,i=a.parentNode;t=t.getParent(e.cell);null!=(i=null!=(n=n.getState(t))&&null!=n.shape&&null!=n.shape.node?n.shape.node.nextSibling:i.firstChild)&&i!=a&&this.insertState(e,i)}},mxCellRenderer.prototype.insertState=function(e,t){e.shape.node.parentNode.insertBefore(e.shape.node,t),null!=e.text&&null!=e.text.node&&e.text.node.parentNode==e.shape.node.parentNode&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling)},mxCellRenderer.prototype.createShape=function(e){if(null!=e.style){var t=mxStencilRegistry.getStencil(e.style[mxConstants.STYLE_SHAPE]);null!=t?e.shape=new mxShape(t):(t=this.getShapeConstructor(e),e.shape=new t),e.shape.points=e.absolutePoints,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.dialect=e.view.graph.dialect,this.configureShape(e)}},mxCellRenderer.prototype.getShape=function(e){return null!=e?mxCellRenderer.prototype.defaultShapes[e]:null},mxCellRenderer.prototype.getShapeConstructor=function(e){var t=this.getShape(e.style[mxConstants.STYLE_SHAPE]);return null==t&&(t=e.view.graph.getModel().isEdge(e.cell)?this.defaultEdgeShape:this.defaultVertexShape),t},mxCellRenderer.prototype.configureShape=function(e){e.shape.apply(e),e.shape.image=e.view.graph.getImage(e),e.shape.indicatorShape=this.getShape(e.view.graph.getIndicatorShape(e)),e.shape.indicatorColor=e.view.graph.getIndicatorColor(e),e.shape.indicatorGradientColor=e.view.graph.getIndicatorGradientColor(e),e.shape.indicatorDirection=e.style[mxConstants.STYLE_INDICATOR_DIRECTION],e.shape.indicatorImage=e.view.graph.getIndicatorImage(e),this.postConfigureShape(e)},mxCellRenderer.prototype.postConfigureShape=function(e){null!=e.shape&&(this.resolveColor(e,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(e,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(e,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(e,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.resolveColor=function(e,t,n){var a=e.shape[t],i=e.view.graph,s=null;"inherit"==a?s=i.model.getParent(e.cell):"swimlane"==a?(s=null!=i.model.getTerminal(e.cell,!1)?i.model.getTerminal(e.cell,!1):e.cell,s=i.getSwimlane(s),n=i.swimlaneIndicatorColorAttribute):"indicated"==a&&(e.shape[t]=e.shape.indicatorColor),null!=s&&(a=i.getView().getState(s),(e.shape[t]=null)!=a&&(e.shape[t]=null!=a.shape&&"indicatorColor"!=t?a.shape[t]:a.style[n]))},mxCellRenderer.prototype.getLabelValue=function(e){return e.view.graph.getLabel(e.cell)},mxCellRenderer.prototype.createLabel=function(n,e){var a=n.view.graph;if(a.getModel().isEdge(n.cell),0<n.style[mxConstants.STYLE_FONTSIZE]||null==n.style[mxConstants.STYLE_FONTSIZE]){var t=a.isHtmlLabel(n.cell)||null!=e&&mxUtils.isNode(e);n.text=new this.defaultTextShape(e,new mxRectangle,n.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,a.getVerticalAlign(n),n.style[mxConstants.STYLE_FONTCOLOR],n.style[mxConstants.STYLE_FONTFAMILY],n.style[mxConstants.STYLE_FONTSIZE],n.style[mxConstants.STYLE_FONTSTYLE],n.style[mxConstants.STYLE_SPACING],n.style[mxConstants.STYLE_SPACING_TOP],n.style[mxConstants.STYLE_SPACING_RIGHT],n.style[mxConstants.STYLE_SPACING_BOTTOM],n.style[mxConstants.STYLE_SPACING_LEFT],n.style[mxConstants.STYLE_HORIZONTAL],n.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],n.style[mxConstants.STYLE_LABEL_BORDERCOLOR],a.isWrapping(n.cell)&&a.isHtmlLabel(n.cell),a.isLabelClipped(n.cell),n.style[mxConstants.STYLE_OVERFLOW],n.style[mxConstants.STYLE_LABEL_PADDING]),n.text.opacity=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_OPACITY,100),n.text.dialect=t?mxConstants.DIALECT_STRICTHTML:n.view.graph.dialect,n.text.state=n,this.initializeLabel(n);var i=!1,s=function(e){var t=n;return(mxClient.IS_TOUCH||i)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t};mxEvent.addGestureListeners(n.text.node,mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,n)),i=a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,s(e)))}),mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,s(e))),i=!1)})),mxEvent.addListener(n.text.node,"dblclick",mxUtils.bind(this,function(e){this.isLabelEvent(n,e)&&(a.dblClick(e,n.cell),mxEvent.consume(e))}))}},mxCellRenderer.prototype.initializeLabel=function(e){var t=e.view.graph;e.text.dialect!=mxConstants.DIALECT_SVG&&(mxClient.IS_SVG&&mxClient.NO_FO?e.text.init(t.container):mxUtils.isVml(e.view.getDrawPane())&&(null!=e.shape.label?e.text.init(e.shape.label):e.text.init(e.shape.node))),null==e.text.node&&(e.text.init(e.view.getDrawPane()),null!=e.shape&&null!=e.text&&e.shape.node.parentNode.insertBefore(e.text.node,e.shape.node.nextSibling))},mxCellRenderer.prototype.createCellOverlays=function(e){var t=e.view.graph.getCellOverlays(e.cell),n=null;if(null!=t){n=new mxDictionary;for(var a=0;a<t.length;a++){var i=null!=e.overlays?e.overlays.remove(t[a]):null;null==i&&((i=new mxImageShape(new mxRectangle,t[a].image.src)).dialect=e.view.graph.dialect,i.preserveImageAspect=!1,i.overlay=t[a],this.initializeOverlay(e,i),this.installCellOverlayListeners(e,t[a],i),null!=t[a].cursor&&(i.node.style.cursor=t[a].cursor)),n.put(t[a],i)}}null!=e.overlays&&e.overlays.visit(function(e,t){t.destroy()}),e.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(e,t){t.init(e.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(t,n,e){var a=t.view.graph;mxEvent.addListener(e.node,"click",function(e){a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))}),mxEvent.addGestureListeners(e.node,function(e){mxEvent.consume(e)},function(e){a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),mxClient.IS_TOUCH&&mxEvent.addListener(e.node,"touchend",function(e){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",t.cell))})},mxCellRenderer.prototype.createControl=function(n){var a=n.view.graph,e=a.getFoldingImage(n);if(a.foldingEnabled&&null!=e){if(null==n.control){var t=new mxRectangle(0,0,e.width,e.height);n.control=new mxImageShape(t,e.src),n.control.preserveImageAspect=!1,n.control.dialect=a.dialect,this.initControl(n,n.control,!0,function(e){if(a.isEnabled()){var t=!a.isCellCollapsed(n.cell);a.foldCells(t,!1,[n.cell]),mxEvent.consume(e)}})}}else null!=n.control&&(n.control.destroy(),n.control=null)},mxCellRenderer.prototype.initControl=function(t,e,n,a){var i=t.view.graph;return i.isHtmlLabel(t.cell)&&mxClient.NO_FO&&i.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(i.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane()),e=e.innerNode||e.node,a&&(i.isEnabled()&&(e.style.cursor="pointer"),mxEvent.addListener(e,"click",a)),n&&mxEvent.addGestureListeners(e,function(e){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)},function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),e},mxCellRenderer.prototype.isShapeEvent=function(e,t){return!0},mxCellRenderer.prototype.isLabelEvent=function(e,t){return!0},mxCellRenderer.prototype.installListeners=function(n){var a=n.view.graph,t=function(e){var t=n;return(a.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName||mxClient.IS_TOUCH)&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(a.container,t,e),t=a.view.getState(a.getCellAt(e.x,e.y))),t},i=!1;mxEvent.addListener(n.shape.node,"gesturestart",mxUtils.bind(this,function(e){a.lastTouchTime=0,i=!0,mxEvent.consume(e)})),mxEvent.addGestureListeners(n.shape.node,mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n)):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}),mxUtils.bind(this,function(e){this.isShapeEvent(n,e)&&!i?a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:t(e))):i&&mxEvent.consume(e)}));var s=mxClient.IS_TOUCH?"gestureend":"dblclick";mxEvent.addListener(n.shape.node,s,mxUtils.bind(this,function(e){i=!1,"gestureend"==s?(a.lastTouchTime=0,a.gestureEnabled&&(a.handleGesture(n,e),mxEvent.consume(e))):this.isShapeEvent(n,e)&&(a.dblClick(e,null!=n.shape&&mxEvent.getSource(e)==n.shape.content?null:n.cell),mxEvent.consume(e))}))},mxCellRenderer.prototype.redrawLabel=function(e,t){var n=this.getLabelValue(e);if(null==e.text&&null!=n&&(mxUtils.isNode(n)||0<n.length)?this.createLabel(e,n):null==e.text||null!=n&&0!=n.length||(e.text.destroy(),e.text=null),null!=e.text){var a=(i=e.view.graph).isWrapping(e.cell),i=i.isLabelClipped(e.cell),s=this.getLabelBounds(e);!t&&e.text.value==n&&e.text.isWrapping==a&&e.text.isClipping==i&&e.text.scale==e.view.scale&&e.text.bounds.equals(s)||(e.text.value=n,e.text.bounds=s,e.text.scale=this.getTextScale(e),e.text.isWrapping=a,e.text.isClipping=i,e.text.redraw())}},mxCellRenderer.prototype.getTextScale=function(e){return e.view.scale},mxCellRenderer.prototype.getLabelBounds=function(e){var t=e.view.graph,n=e.view.scale,a=t.getModel().isEdge(e.cell),i=new mxRectangle(e.absoluteOffset.x,e.absoluteOffset.y);return e.text.updateMargin(),a?(a=e.text.getSpacing(),i.x+=a.x*n,i.y+=a.y*n,null!=(t=t.getCellGeometry(e.cell))&&(i.width=Math.max(0,e.text.margin.x*t.width*n-e.text.spacingLeft*n-e.text.spacingRight*n),i.height=Math.max(0,e.text.margin.y*t.height*n-e.text.spacingTop*n-e.text.spacingBottom*n))):(e.text.isPaintBoundsInverted()&&(a=i.x,i.x=i.y,i.y=a),i.x+=e.x,i.y+=e.y,i.width=Math.max(1,e.width),i.height=Math.max(1,e.height),t.isSwimlane(e.cell)&&(0<(t=t.getStartSize(e.cell)).width?(a=Math.min(i.width,t.width*n),e.shape.flipH&&(i.x+=i.width-a),i.width=a):0<t.height&&(a=Math.min(i.height,t.height*n),e.shape.flipV&&(i.y+=i.height-a),i.height=a)),this.rotateLabelBounds(e,i)),i},mxCellRenderer.prototype.rotateLabelBounds=function(e,t){if(e.text.isPaintBoundsInverted()){var n=(e.width-e.height)/2;t.x+=n,t.y-=n,n=t.width,t.width=t.height,t.height=n}if(t.x-=e.text.margin.x*t.width,t.y-=e.text.margin.y*t.height,"fill"!=e.style[mxConstants.STYLE_OVERFLOW]){n=e.view.scale;var a=e.text.getSpacing();t.x+=a.x*n,t.y+=a.y*n,t.width=Math.max(0,t.width-e.text.spacingLeft*n-e.text.spacingRight*n),t.height=Math.max(0,t.height-e.text.spacingTop*n-e.text.spacingBottom*n)}var i=e.text.getTextRotation();0!=i&&null!=e&&e.view.graph.model.isVertex(e.cell)&&(n=e.getCenterX(),a=e.getCenterY(),t.x!=n||t.y!=a)&&(i*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(i),Math.sin(i),new mxPoint(n,a)),t.x=pt.x,t.y=pt.y)},mxCellRenderer.prototype.redrawCellOverlays=function(s,o){if(this.createCellOverlays(s),null!=s.overlays){var r=mxUtils.mod(mxUtils.getValue(s.style,mxConstants.STYLE_ROTATION,0),90),e=mxUtils.toRadians(r),l=Math.cos(e),d=Math.sin(e);s.overlays.visit(function(e,t){var n=t.overlay.getBounds(s);if(!s.view.graph.getModel().isEdge(s.cell)&&null!=s.shape&&0!=r){var a=n.getCenterX(),i=n.getCenterY();a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),l,d,new mxPoint(s.getCenterX(),s.getCenterY()))).x,i=i.y;n.x=Math.round(a-n.width/2),n.y=Math.round(i-n.height/2)}!o&&null!=t.bounds&&t.scale==s.view.scale&&t.bounds.equals(n)||(t.bounds=n,t.scale=s.view.scale,t.redraw())})}},mxCellRenderer.prototype.redrawControl=function(e,t){if(null!=e.control){var n=this.getControlBounds(e),a=this.legacyControlPosition?mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0):e.shape.getTextRotation(),i=e.view.scale;!t&&e.control.scale==i&&e.control.bounds.equals(n)&&e.control.rotation==a||(e.control.rotation=a,e.control.bounds=n,e.control.scale=i,e.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(e){if(null==e.control)return null;var t=e.control.scale,n=e.control.bounds.width/t,a=(t=e.control.bounds.height/t,e.view.scale),i=e.getCenterX(),s=e.getCenterY();if(!e.view.graph.getModel().isEdge(e.cell)&&(i=e.x+n*a,s=e.y+t*a,null!=e.shape)){var o=e.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0);else if(e.shape.isPaintBoundsInverted()){var r=(e.width-e.height)/2;i=i+r,s=s-r}0!=o&&(r=mxUtils.toRadians(o),o=Math.cos(r),r=Math.sin(r),i=(s=mxUtils.getRotatedPoint(new mxPoint(i,s),o,r,new mxPoint(e.getCenterX(),e.getCenterY()))).x,s=s.y)}return e.view.graph.getModel().isEdge(e.cell),new mxRectangle(Math.round(i-n/2*a),Math.round(s-t/2*a),Math.round(n*a),Math.round(t*a))},mxCellRenderer.prototype.redraw=function(e,t,n){if(null!=e.shape){var a=!1;e.view.graph.getModel().isEdge(e.cell),reconfigure=null!=t&&t,this.createControl(e),(e.orderChanged||e.invalidOrder)&&(e.view.graph.ordered?this.order(e):this.orderEdge(e)),!e.orderChanged&&mxUtils.equalEntries(e.shape.style,e.style)||(this.configureShape(e),t=!0),delete e.invalidOrder,delete e.orderChanged,!t&&null!=e.shape.bounds&&e.shape.scale==e.view.scale&&e.shape.bounds.equals(e)&&mxUtils.equalPoints(e.shape.points,e.absolutePoints)||(a=!0,e.shape.points=null!=e.absolutePoints?e.absolutePoints.slice():null,e.shape.bounds=new mxRectangle(e.x,e.y,e.width,e.height),e.shape.scale=e.view.scale,null==n||n?e.shape.redraw():e.shape.updateBoundingBox()),(null==n||n)&&(this.redrawLabel(e,a),this.redrawCellOverlays(e,a),this.redrawControl(e,a))}},mxCellRenderer.prototype.destroy=function(e){null!=e.shape&&(null!=e.text&&(e.text.destroy(),e.text=null),null!=e.overlays&&(e.overlays.visit(function(e,t){t.destroy()}),e.overlays=null),null!=e.control&&(e.control.destroy(),e.control=null),e.shape.destroy(),e.shape=null)};var mxEdgeStyle={EntityRelation:function(e,t,n,a,i){var s=e.view,o=s.graph;a=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var r=(d=e.absolutePoints)[0],l=d[d.length-1],d=!1;if(null!=r)(t=new mxCellState).x=r.x,t.y=r.y;else{if(null==t)return;var c=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_NONE);c!=mxConstants.DIRECTION_MASK_NONE?d=c==mxConstants.DIRECTION_MASK_WEST:(r=o.getCellGeometry(t.cell)).relative?d=r.x<=.5:null!=n&&(d=n.x+n.width<t.x)}r=!0,null!=l?((n=new mxCellState).x=l.x,n.y=l.y):null!=n&&((c=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE?r=c==mxConstants.DIRECTION_MASK_WEST:(e=o.getCellGeometry(n.cell)).relative?r=e.x<=.5:null!=t&&(r=t.x+t.width<n.x)),null!=t&&null!=n&&(e=d?t.x:t.x+t.width,t=s.getRoutingCenterY(t),o=r?n.x:n.x+n.width,n=s.getRoutingCenterY(n),s=new mxPoint(e+(d?-a:a),t),l=new mxPoint(o+(r?-a:a),n),d==r?(a=d?Math.min(e,o)-a:Math.max(e,o)+a,i.push(new mxPoint(a,t)),i.push(new mxPoint(a,n))):(s.x<l.x==d?(a=t+(n-t)/2,i.push(s),i.push(new mxPoint(s.x,a)),i.push(new mxPoint(l.x,a))):i.push(s),i.push(l)))},Loop:function(e,t,n,a,i){if(null!=t){var s=(n=e.view).graph;null!=(a=null!=a&&0<a.length?a[0]:null)&&(a=n.transformControlPoint(e,a),mxUtils.contains(t,a.x,a.y)&&(a=null));var o=0,r=0,l=0,d=0;s=mxUtils.getValue(e.style,mxConstants.STYLE_SEGMENT,s.gridSize)*n.scale;(e=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(o=n.getRoutingCenterX(t),r=s):(l=n.getRoutingCenterY(t),d=s),null==a||a.x<t.x||a.x>t.x+t.width?null!=a?(o=a.x,d=Math.max(Math.abs(l-a.y),d)):e==mxConstants.DIRECTION_NORTH?l=t.y-2*r:e==mxConstants.DIRECTION_SOUTH?l=t.y+t.height+2*r:o=e==mxConstants.DIRECTION_EAST?t.x-2*d:t.x+t.width+2*d:null!=a&&(o=n.getRoutingCenterX(t),r=Math.max(Math.abs(o-a.x),d),l=a.y,d=0),i.push(new mxPoint(o-r,l-d)),i.push(new mxPoint(o+r,l+d))}},ElbowConnector:function(e,t,n,a,i){var s=null!=a&&0<a.length?a[0]:null,o=!1,r=!1;if(null!=t&&null!=n)if(null!=s){var l=Math.min(t.x,n.x),d=Math.max(t.x+t.width,n.x+n.width),c=(r=Math.min(t.y,n.y),Math.max(t.y+t.height,n.y+n.height));o=(s=e.view.transformControlPoint(e,s)).y<r||s.y>c,r=s.x<l||s.x>d}else(o=(l=Math.max(t.x,n.x))==(d=Math.min(t.x+t.width,n.x+n.width)))||(r=(r=Math.max(t.y,n.y))==(c=Math.min(t.y+t.height,n.y+n.height)));r||!o&&e.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(e,t,n,a,i):mxEdgeStyle.TopToBottom(e,t,n,a,i)},SideToSide:function(e,t,n,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((t=new mxCellState).x=o.x,t.y=o.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(e=Math.max(t.x,n.x),o=Math.min(t.x+t.width,n.x+n.width),e=null!=a?a.x:o+(e-o)/2,o=s.getRoutingCenterY(t),s=s.getRoutingCenterY(n),null!=a&&(a.y>=t.y&&a.y<=t.y+t.height&&(o=a.y),a.y>=n.y&&a.y<=n.y+n.height&&(s=a.y)),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),!mxUtils.contains(n,e,s)&&!mxUtils.contains(t,e,s)&&i.push(new mxPoint(e,s)),1==i.length&&(null!=a?!mxUtils.contains(n,e,a.y)&&!mxUtils.contains(t,e,a.y)&&i.push(new mxPoint(e,a.y)):(s=Math.max(t.y,n.y),t=Math.min(t.y+t.height,n.y+n.height),i.push(new mxPoint(e,s+(t-s)/2)))))},TopToBottom:function(e,t,n,a,i){var s=e.view;a=null!=a&&0<a.length?a[0]:null;var o=(r=e.absolutePoints)[0],r=r[r.length-1];null!=a&&(a=s.transformControlPoint(e,a)),null!=o&&((t=new mxCellState).x=o.x,t.y=o.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=t&&null!=n&&(o=Math.max(t.y,n.y),r=Math.min(t.y+t.height,n.y+n.height),e=s.getRoutingCenterX(t),null!=a&&a.x>=t.x&&a.x<=t.x+t.width&&(e=a.x),o=null!=a?a.y:r+(o-r)/2,!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),e=null!=a&&a.x>=n.x&&a.x<=n.x+n.width?a.x:s.getRoutingCenterX(n),!mxUtils.contains(n,e,o)&&!mxUtils.contains(t,e,o)&&i.push(new mxPoint(e,o)),1==i.length&&(null!=a&&1==i.length?!mxUtils.contains(n,a.x,o)&&!mxUtils.contains(t,a.x,o)&&i.push(new mxPoint(a.x,o)):(s=Math.max(t.x,n.x),t=Math.min(t.x+t.width,n.x+n.width),i.push(new mxPoint(s+(t-s)/2,o)))))},SegmentConnector:function(e,t,n,a,i){var s=e.absolutePoints,o=!0,r=null,l=s[0];null==l&&null!=t?l=new mxPoint(e.view.getRoutingCenterX(t),e.view.getRoutingCenterY(t)):null!=l&&(l=l.clone());var d=s.length-1;if(null!=a&&0<a.length){r=e.view.transformControlPoint(e,a[0]);for(var c=t,m=s[0],u=!1,p=!1,g=(u=r,a.length),v=0;v<2;v++){var h=null!=m&&m.x==u.x,f=null!=m&&m.y==u.y,b=null!=c&&u.y>=c.y&&u.y<=c.y+c.height;c=null!=c&&u.x>=c.x&&u.x<=c.x+c.width,u=f||null==m&&b,p=h||null==m&&c;if(null!=m&&!f&&!h&&(b||c)){o=!b;break}if(p||u){o=u,1==v&&(o=0==a.length%2?u:p);break}c=n,m=s[d],u=e.view.transformControlPoint(e,a[g-1])}for(o&&(null!=s[0]&&s[0].y!=r.y||null==s[0]&&null!=t&&(r.y<t.y||r.y>t.y+t.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[0]&&s[0].x!=r.x||null==s[0]&&null!=t&&(r.x<t.x||r.x>t.x+t.width))&&i.push(new mxPoint(r.x,l.y)),o?l.y=r.y:l.x=r.x,v=0;v<a.length;v++)o=!o,r=e.view.transformControlPoint(e,a[v]),o?l.y=r.y:l.x=r.x,i.push(l.clone())}else r=l,o=!0;if(null==(l=s[d])&&null!=n&&(l=new mxPoint(e.view.getRoutingCenterX(n),e.view.getRoutingCenterY(n))),o&&(null!=s[d]&&s[d].y!=r.y||null==s[d]&&null!=n&&(r.y<n.y||r.y>n.y+n.height))?i.push(new mxPoint(l.x,r.y)):!o&&(null!=s[d]&&s[d].x!=r.x||null==s[d]&&null!=n&&(r.x<n.x||r.x>n.x+n.width))&&i.push(new mxPoint(r.x,l.y)),null==s[0]&&null!=t)for(;1<i.length&&mxUtils.contains(t,i[1].x,i[1].y);)i=i.splice(1,1);if(null==s[d]&&null!=n)for(;1<i.length&&mxUtils.contains(n,i[i.length-1].x,i[i.length-1].y);)i=i.splice(i.length-1,1)},orthBuffer:10,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,OrthConnector:function(e,t,n,a,i){var s=e.view.graph,o=null!=t&&s.getModel().isEdge(t.cell);s=null!=n&&s.getModel().isEdge(n.cell);if(null!=a&&0<a.length||o||s)mxEdgeStyle.SegmentConnector(e,t,n,a,i);else{var r=(a=e.absolutePoints)[0],l=a[a.length-1];a=null!=t?t.x:r.x;o=null!=t?t.y:r.y;var d=null!=t?t.width:1,c=null!=t?t.height:1,m=null!=n?n.x:l.x,u=null!=n?n.y:l.y,p=null!=n?n.width:1,g=null!=n?n.height:1,v=(s=e.view.scale*mxEdgeStyle.orthBuffer,[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL]);for(null!=t&&(v[0]=mxUtils.getPortConstraints(t,e,!0,mxConstants.DIRECTION_MASK_ALL)),null!=n&&(v[1]=mxUtils.getPortConstraints(n,e,!1,mxConstants.DIRECTION_MASK_ALL)),e=[0,0],a=[[a,o,d,c],[m,u,p,g]],d=0;d<2;d++)mxEdgeStyle.limits[d][1]=a[d][0]-s,mxEdgeStyle.limits[d][2]=a[d][1]-s,mxEdgeStyle.limits[d][4]=a[d][0]+a[d][2]+s,mxEdgeStyle.limits[d][8]=a[d][1]+a[d][3]+s;for(d=a[0][0]+a[0][2]/2-(a[1][0]+a[1][2]/2),c=a[0][1]+a[0][3]/2-(a[1][1]+a[1][3]/2),d<(o=0)?o=c<0?2:1:c<=0&&(o=3,0==d&&(o=2)),(c=null)!=t&&(c=r),t=[[.5,.5],[.5,.5]],d=0;d<2;d++)null!=c&&(t[d][0]=(c.x-a[d][0])/a[d][2],t[d][0]<.01?e[d]=mxConstants.DIRECTION_MASK_WEST:.99<t[d][0]&&(e[d]=mxConstants.DIRECTION_MASK_EAST),t[d][1]=(c.y-a[d][1])/a[d][3],t[d][1]<.01?e[d]=mxConstants.DIRECTION_MASK_NORTH:.99<t[d][1]&&(e[d]=mxConstants.DIRECTION_MASK_SOUTH)),(c=null)!=n&&(c=l);for(d=a[0][1]-(a[1][1]+a[1][3]),c=a[0][0]-(a[1][0]+a[1][2]),m=a[1][1]-(a[0][1]+a[0][3]),u=a[1][0]-(a[0][0]+a[0][2]),mxEdgeStyle.vertexSeperations[1]=Math.max(c-2*s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(d-2*s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(m-2*s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-2*s,0),n=[],l=[],(r=[])[0]=u<=c?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,l[0]=m<=d?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,r[1]=mxUtils.reversePortConstraints(r[0]),l[1]=mxUtils.reversePortConstraints(l[0]),c=u<=c?c:u,m=m<=d?d:m,p=!(u=[[0,0],[0,0]]),d=0;d<2;d++)0==e[d]&&(0==(r[d]&v[d])&&(r[d]=mxUtils.reversePortConstraints(r[d])),0==(l[d]&v[d])&&(l[d]=mxUtils.reversePortConstraints(l[d])),u[d][0]=l[d],u[d][1]=r[d]);for(2*s<m&&2*s<c&&(0<(r[0]&v[0])&&0<(l[1]&v[1])?(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=l[1],u[1][1]=r[1],p=!0):0<(l[0]&v[0])&&0<(r[1]&v[1])&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=r[1],u[1][1]=l[1],p=!0)),2*s<m&&!p&&(u[0][0]=l[0],u[0][1]=r[0],u[1][0]=l[1],u[1][1]=r[1],p=!0),2*s<c&&!p&&(u[0][0]=r[0],u[0][1]=l[0],u[1][0]=r[1],u[1][1]=l[1]),d=0;d<2;d++)0==e[d]&&(0==(u[d][0]&v[d])&&(u[d][0]=u[d][1]),n[d]=u[d][0]&v[d],n[d]|=(u[d][1]&v[d])<<8,n[d]|=(u[1-d][d]&v[d])<<16,n[d]|=(u[1-d][1-d]&v[d])<<24,0==(15&n[d])&&(n[d]<<=8),0==(3840&n[d])&&(n[d]=15&n[d]|n[d]>>8),0==(983040&n[d])&&(n[d]=65535&n[d]|(251658240&n[d])>>8),e[d]=15&n[d],v[d]==mxConstants.DIRECTION_MASK_WEST||v[d]==mxConstants.DIRECTION_MASK_NORTH||v[d]==mxConstants.DIRECTION_MASK_EAST||v[d]==mxConstants.DIRECTION_MASK_SOUTH)&&(e[d]=v[d]);switch(d=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0],v=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(d-=o)<1&&(d+=4),(v-=o)<1&&(v+=4),v=mxEdgeStyle.routePatterns[d-1][v-1],mxEdgeStyle.wayPoints1[0][0]=a[0][0],mxEdgeStyle.wayPoints1[0][1]=a[0][1],e[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=s,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]+=a[0][3]+s;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=a[0][2]+s,mxEdgeStyle.wayPoints1[0][1]+=t[0][1]*a[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=t[0][0]*a[0][2],mxEdgeStyle.wayPoints1[0][1]-=s}for(r=n=(s=0)<(e[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,d=l=0;d<v.length;d++){g=(l=15&v[d])==mxConstants.DIRECTION_MASK_EAST?3:l,4<(g+=o)&&(g-=4),c=mxEdgeStyle.dirVectors[g-1],(l=0<g%2?0:1)!=n&&(s++,mxEdgeStyle.wayPoints1[s][0]=mxEdgeStyle.wayPoints1[s-1][0],mxEdgeStyle.wayPoints1[s][1]=mxEdgeStyle.wayPoints1[s-1][1]);var h=0<(v[d]&mxEdgeStyle.TARGET_MASK);p=0<(v[d]&mxEdgeStyle.SOURCE_MASK);15<(m=(m=(v[d]&mxEdgeStyle.SIDE_MASK)>>5)<<o)&&(m>>=4),u=0<(v[d]&mxEdgeStyle.CENTER_MASK),(p||h)&&m<9?(g=0,p=p?0:1,g=u&&0==l?a[p][0]+t[p][0]*a[p][2]:u?a[p][1]+t[p][1]*a[p][3]:mxEdgeStyle.limits[p][m],0==l?0<(m=(g-mxEdgeStyle.wayPoints1[s][0])*c[0])&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*m):0<(m=(g-mxEdgeStyle.wayPoints1[s][1])*c[1])&&(mxEdgeStyle.wayPoints1[s][1]+=c[1]*m)):u&&(mxEdgeStyle.wayPoints1[s][0]+=c[0]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2),mxEdgeStyle.wayPoints1[s][1]+=c[1]*Math.abs(mxEdgeStyle.vertexSeperations[g]/2)),0<s&&mxEdgeStyle.wayPoints1[s][l]==mxEdgeStyle.wayPoints1[s-1][l]?s--:n=l}for(d=0;d<=s&&(d!=s||((0<(e[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==r?0:1)==(s+1)%2);d++)i.push(new mxPoint(mxEdgeStyle.wayPoints1[d][0],mxEdgeStyle.wayPoints1[d][1]))}},getRoutePattern:function(e,t,n,a){var i=e[0]==mxConstants.DIRECTION_MASK_EAST?3:e[0];return e=e[1]==mxConstants.DIRECTION_MASK_EAST?3:e[1],(i-=t)<1&&(i+=4),(e-=t)<1&&(e+=4),t=routePatterns[i-1][e-1],0!=n&&0!=a||null!=inlineRoutePatterns[i-1][e-1]&&(t=inlineRoutePatterns[i-1][e-1]),t}},mxStyleRegistry={values:[],putValue:function(e,t){mxStyleRegistry.values[e]=t},getValue:function(e){return mxStyleRegistry.values[e]},getName:function(e){for(var t in mxStyleRegistry.values)if(mxStyleRegistry.values[t]==e)return t;return null}};function mxGraphView(e){this.graph=e,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(e,t){if(this.view=e,this.previous=this.root=t,this.isUp=null==t,!this.isUp)for(var n=this.view.currentRoot,a=this.view.graph.getModel();null!=n;){if(n==t){this.isUp=!0;break}n=a.getParent(n)}}function mxGraph(e,t,n,a){this.mouseListeners=null,this.renderHint=n,this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML,this.model=null!=t?t:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=a?a:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(e,t){this.graphModelChanged(t.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=e&&this.init(e),this.view.revalidate()}function mxCellOverlay(e,t,n,a,i,s){this.image=e,this.tooltip=t,this.align=null!=n?n:this.align,this.verticalAlign=null!=a?a:this.verticalAlign,this.offset=null!=i?i:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(e,t){this.source=e,null!=t&&this.init(t)}function mxMultiplicity(e,t,n,a,i,s,o,r,l,d){this.source=e,this.type=t,this.attr=n,this.value=a,this.min=null!=i?i:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(l)||l,this.validNeighborsAllowed=null==d||d}function mxLayoutManager(e){this.undoHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.beforeUndo(t.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsMoved(t.getProperty("cells"),t.getProperty("event"))}),this.setGraph(e)}function mxSpaceManager(e,t,n,a){this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.foldHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.shiftRightwards=null==t||t,this.shiftDownwards=null==n||n,this.extendParents=null==a||a,this.setGraph(e)}function mxSwimlaneManager(e,t,n,a){this.horizontal=null==t||t,this.addEnabled=null==n||n,this.resizeEnabled=null==a||a,this.addHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(t.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(t.getProperty("cells"))}),this.setGraph(e)}function mxTemporaryCellStates(e,t,n){if(this.view=e,t=null!=t?t:1,this.oldBounds=e.getGraphBounds(),this.oldStates=e.getStates(),this.oldScale=e.getScale(),e.setStates(new mxDictionary),e.setScale(t),null!=n){t=e.createState(new mxCell);for(var a=0;a<n.length;a++)e.validateBounds(t,n[a]);var i=null;for(a=0;a<n.length;a++){var s=e.validatePoints(t,n[a]);null==i?i=s:i.add(s)}null==i&&(i=new mxRectangle),e.setGraphBounds(i)}}function mxCellStatePreview(e){this.graph=e,this.deltas={}}function mxConnectionConstraint(e,t){this.point=e,this.perimeter=null==t||t}function mxGraphHandler(e){this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape()}),this.graph.addListener(mxEvent.PAN,this.panHandler)}function mxPanningHandler(e,t){null!=e&&(this.graph=e,this.factoryMethod=t,this.graph.addMouseListener(this),this.init())}function mxCellMarker(e,t,n,a){mxEventSource.call(this),null!=e&&(this.graph=e,this.validColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=t?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=a?a:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(e))}function mxSelectionCellsHandler(e){mxEventSource.call(this),this.graph=e,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,t){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(e,t){mxEventSource.call(this),null!=e&&(this.graph=e,this.factoryMethod=t,this.init())}function mxConstraintHandler(e){this.graph=e}function mxRubberband(e){null!=e&&(this.graph=e,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxVertexHandler(e){null!=e&&(this.state=e,this.init())}function mxEdgeHandler(e){null!=e&&(this.state=e,this.init())}function mxElbowEdgeHandler(e){mxEdgeHandler.call(this,e)}function mxEdgeSegmentHandler(e){mxEdgeHandler.call(this,e)}function mxKeyHandler(e,t){null!=e&&(this.graph=e,this.target=t||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],mxEvent.addListener(this.target,"keydown",mxUtils.bind(this,function(e){this.keyDown(e)})),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(e,t){null!=e&&(this.graph=e,this.delay=t||500,this.graph.addMouseListener(this))}function mxCellTracker(e,t,n){mxCellMarker.call(this,e,t),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(e,t,n,a){null!=e&&(this.graph=e,this.highlightColor=null!=t?t:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=a&&a,this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var n=this.handler.escape;this.handler.escape=function(e){n.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",e))}}}function mxDefaultPopupMenu(e){this.config=e}function mxDefaultToolbar(e,t){this.editor=t,null!=e&&null!=t&&this.init(e)}function mxEditor(e){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(e),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,!mxClient.IS_LOCAL&&null!=this.urlInit&&(this.session=this.createSession()),null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(e){this.graphBounds=e},mxGraphView.prototype.getBounds=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.getState(e[a]);null!=i&&(null==t?t=new mxRectangle(i.x,i.y,i.width,i.height):t.add(i))}return t},mxGraphView.prototype.setCurrentRoot=function(e){if(this.currentRoot!=e){var t=new mxCurrentRootChange(this,e);t.execute();var n=new mxUndoableEdit(this,!1);n.add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return e},mxGraphView.prototype.scaleAndTranslate=function(e,t,n){var a=this.scale,i=new mxPoint(this.translate.x,this.translate.y);this.scale==e&&this.translate.x==t&&this.translate.y==n||(this.scale=e,this.translate.x=t,this.translate.y=n,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",e,"previousScale",a,"translate",this.translate,"previousTranslate",i))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(e){var t=this.scale;this.scale!=e&&(this.scale=e,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",e,"previousScale",t))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(e,t){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==e&&this.translate.y==t||(this.translate.x=e,this.translate.y=t,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange())),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(e,t,n){var a=this.graph.getModel();if(e=e||a.getRoot(),t=null!=t&&t,n=null==n||n,this.removeState(e),n&&(t||e!=this.currentRoot)){n=a.getChildCount(e);for(var i=0;i<n;i++)this.clear(a.getChildAt(e,i),t)}else this.invalidate(e)},mxGraphView.prototype.invalidate=function(e,t,n,a){var i=this.graph.getModel();if(e=e||i.getRoot(),t=null==t||t,n=null==n||n,a=null!=a&&a,null!=(o=this.getState(e))&&(o.invalid=!0,a&&(o.orderChanged=!0)),t)for(var s=i.getChildCount(e),o=0;o<s;o++){var r=i.getChildAt(e,o);this.invalidate(r,t,n,a)}if(n)for(a=i.getEdgeCount(e),o=0;o<a;o++)this.invalidate(i.getEdgeAt(e,o),t,n)},mxGraphView.prototype.validate=function(e){var t=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;var n=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode||mxClient.IS_QUIRKS)){n=this.canvas.style.display,this.canvas.style.display="none";var a=document.createElement("div");a.style.position="absolute",a.style.whiteSpace="nowrap",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",document.body.appendChild(a),this.textDiv=a}e=e||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()),this.validateBounds(null,e),null==(e=this.validatePoints(null,e))&&(e=new mxRectangle),this.setGraphBounds(e),this.validateBackground(),null!=n&&(this.canvas.style.display=n,document.body.removeChild(this.textDiv),this.textDiv=null),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",t)},mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,"white","black")},mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);this.graph.pageVisible?(t=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.graph.pageFormat,t=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,e.width*t,e.height*t)},mxGraphView.prototype.redrawBackgroundImage=function(e,t){e.scale=this.scale,e.bounds.x=this.scale*this.translate.x,e.bounds.y=this.scale*this.translate.y,e.bounds.width=this.scale*t.width,e.bounds.height=this.scale*t.height,e.redraw()},mxGraphView.prototype.validateBounds=function(e,t){var n=this.graph.getModel(),a=this.getState(t,!0);if(null!=a&&a.invalid){if(this.graph.isCellVisible(t)){if(t!=this.currentRoot&&null!=e)if(a.absoluteOffset.x=0,a.absoluteOffset.y=0,a.origin.x=e.origin.x,a.origin.y=e.origin.y,null!=(s=this.graph.getCellGeometry(t))){if(!n.isEdge(t)){var i=s.offset||this.EMPTY_POINT;s.relative?(a.origin.x+=s.x*e.width/this.scale+i.x,a.origin.y+=s.y*e.height/this.scale+i.y):(a.absoluteOffset.x=this.scale*i.x,a.absoluteOffset.y=this.scale*i.y,a.origin.x+=s.x,a.origin.y+=s.y)}if(a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*s.width,a.height=this.scale*s.height,n.isVertex(t)){if(s.relative&&0!=(i=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"))){var s=Math.cos(i),o=(i=Math.sin(i),new mxPoint(a.getCenterX(),a.getCenterY())),r=new mxPoint(e.getCenterX(),e.getCenterY());s=mxUtils.getRotatedPoint(o,s,i,r);a.x=s.x-a.width/2,a.y=s.y-a.height/2}this.updateVertexLabelOffset(a)}}}else this.removeState(t);null!=(i=this.graph.getChildOffsetForCell(t))&&(a.origin.x+=i.x,a.origin.y+=i.y)}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(s=n.getChildCount(t),i=0;i<s;i++)o=n.getChildAt(t,i),this.validateBounds(a,o)},mxGraphView.prototype.updateVertexLabelOffset=function(e){var t=mxUtils.getValue(e.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);t==mxConstants.ALIGN_LEFT?e.absoluteOffset.x-=e.width:t==mxConstants.ALIGN_RIGHT&&(e.absoluteOffset.x+=e.width),(t=mxUtils.getValue(e.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?e.absoluteOffset.y-=e.height:t==mxConstants.ALIGN_BOTTOM&&(e.absoluteOffset.y+=e.height)},mxGraphView.prototype.validatePoints=function(e,t){var n=this.graph.getModel(),a=this.getState(t),i=null;if(null!=a){if(a.invalid){var s=this.graph.getCellGeometry(t);if(null!=s&&n.isEdge(t)){var o=this.getState(this.getVisibleTerminal(t,!0));if(a.setVisibleTerminalState(o,!0),null!=o&&n.isEdge(o.cell)&&!n.isAncestor(o.cell,t)){var r=this.getState(n.getParent(o.cell));this.validatePoints(r,o.cell)}var l=this.getState(this.getVisibleTerminal(t,!1));a.setVisibleTerminalState(l,!1),null!=l&&n.isEdge(l.cell)&&!n.isAncestor(l.cell,t)&&(r=this.getState(n.getParent(l.cell)),this.validatePoints(r,l.cell)),this.updateFixedTerminalPoints(a,o,l),this.updatePoints(a,s.points,o,l),this.updateFloatingTerminalPoints(a,o,l),this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)}else null!=s&&s.relative&&null!=e&&n.isEdge(e.cell)&&(null!=(s=this.getPoint(e,s))&&(a.x=s.x,a.y=s.y,s.x=s.x/this.scale-this.translate.x,s.y=s.y/this.scale-this.translate.y,a.origin=s,this.childMoved(e,a)));a.invalid=!1,t!=this.currentRoot&&this.graph.cellRenderer.redraw(a,!1,this.isRendering())}(n.isEdge(t)||n.isVertex(t))&&(null!=a.shape&&null!=a.shape.boundingBox&&(i=a.shape.boundingBox.clone()),null!=a.text&&!this.graph.isLabelClipped(a.cell)&&null!=a.text.boundingBox&&(null!=i?i.add(a.text.boundingBox):i=a.text.boundingBox.clone()))}if(null!=a&&(!this.graph.isCellCollapsed(t)||t==this.currentRoot))for(s=n.getChildCount(t),o=0;o<s;o++)r=n.getChildAt(t,o),null!=(r=this.validatePoints(a,r))&&(null==i?i=r:i.add(r));return i},mxGraphView.prototype.childMoved=function(e,t){var n=t.cell;if(!this.graph.isCellCollapsed(n)||n==this.currentRoot)for(var a=this.graph.getModel(),i=a.getChildCount(n),s=0;s<i;s++)this.validateBounds(t,a.getChildAt(n,s))},mxGraphView.prototype.updateFixedTerminalPoints=function(e,t,n){this.updateFixedTerminalPoint(e,t,!0,this.graph.getConnectionConstraint(e,t,!0)),this.updateFixedTerminalPoint(e,n,!1,this.graph.getConnectionConstraint(e,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(e,t,n,a){var i=null;if(null!=a&&(i=this.graph.getConnectionPoint(t,a)),null==i&&null==t){t=this.scale,a=this.translate;var s=e.origin;null!=(i=this.graph.getCellGeometry(e.cell).getTerminalPoint(n))&&(i=new mxPoint(t*(a.x+i.x+s.x),t*(a.y+i.y+s.y)))}e.setAbsoluteTerminalPoint(i,n)},mxGraphView.prototype.updatePoints=function(e,t,n,a){if(null!=e){var i=[];i.push(e.absolutePoints[0]);var s=this.getEdgeStyle(e,t,n,a);if(null!=s)s(e,n=this.getTerminalPort(e,n,!0),a=this.getTerminalPort(e,a,!1),t,i);else if(null!=t)for(s=0;s<t.length;s++)null!=t[s]&&(a=mxUtils.clone(t[s]),i.push(this.transformControlPoint(e,a)));t=e.absolutePoints,i.push(t[t.length-1]),e.absolutePoints=i}},mxGraphView.prototype.transformControlPoint=function(e,t){var n=e.origin;return new mxPoint(this.scale*(t.x+this.translate.x+n.x),this.scale*(t.y+this.translate.y+n.y))},mxGraphView.prototype.getEdgeStyle=function(e,t,n,a){return"string"==typeof(e=null!=n&&n==a?mxUtils.getValue(e.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(e.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:e.style[mxConstants.STYLE_EDGE])&&(null==(t=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t),"function"==typeof e?e:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(e,t,n){var a=e.absolutePoints,i=a[0];null==a[a.length-1]&&null!=n&&this.updateFloatingTerminalPoint(e,n,t,!1),null==i&&null!=t&&this.updateFloatingTerminalPoint(e,t,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(e,t,n,a){t=this.getTerminalPort(e,t,a);var i=this.getNextPoint(e,n,a),s=this.graph.isOrthogonal(e);n=mxUtils.toRadians(Number(t.style[mxConstants.STYLE_ROTATION]||"0"));var o=new mxPoint(t.getCenterX(),t.getCenterY());if(0!=n){var r=Math.cos(-n),l=Math.sin(-n);i=mxUtils.getRotatedPoint(i,r,l,o)}r=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0),r+=parseFloat(e.style[a?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),t=this.getPerimeterPoint(t,i,0==n&&s,r),0!=n&&(r=Math.cos(n),l=Math.sin(n),t=mxUtils.getRotatedPoint(t,r,l,o)),e.setAbsoluteTerminalPoint(t,a)},mxGraphView.prototype.getTerminalPort=function(e,t,n){return null!=(e=mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT))&&(null!=(e=this.getState(this.graph.getModel().getCell(e)))&&(t=e)),t},mxGraphView.prototype.getPerimeterPoint=function(e,t,n,a){var i=null;if(null!=e){var s=this.getPerimeterFunction(e);null!=s&&null!=t&&(0<(a=this.getPerimeterBounds(e,a)).width||0<a.height)&&(i=s(a,e,t,n)),null==i&&(i=this.getPoint(e))}return i},mxGraphView.prototype.getRoutingCenterX=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return e.getCenterX()+t*e.width},mxGraphView.prototype.getRoutingCenterY=function(e){var t=null!=e.style&&parseFloat(e.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return e.getCenterY()+t*e.height},mxGraphView.prototype.getPerimeterBounds=function(e,t){return t=null!=t?t:0,null!=e&&(t+=parseFloat(e.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),e.getPerimeterBounds(t*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(e){if("string"==typeof(e=e.style[mxConstants.STYLE_PERIMETER])){var t=mxStyleRegistry.getValue(e);null==t&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(e,t,n){var a=null;return null!=(e=e.absolutePoints)&&(n||2<e.length||null==t)&&(a=e.length,a=e[n?Math.min(1,a-1):Math.max(0,a-2)]),null==a&&null!=t&&(a=new mxPoint(t.getCenterX(),t.getCenterY())),a},mxGraphView.prototype.getVisibleTerminal=function(e,t){for(var n=this.graph.getModel(),a=n.getTerminal(e,t),i=a;null!=a&&a!=this.currentRoot;)this.graph.isCellVisible(i)&&!this.graph.isCellCollapsed(a)||(i=a),a=n.getParent(a);return n.getParent(i)==n.getRoot()&&(i=null),i},mxGraphView.prototype.updateEdgeBounds=function(e){var t=e.absolutePoints;if(e.length=0,null!=t&&0<t.length){var n=t[0],a=t[t.length-1];if(null==n||null==a)e.cell!=this.currentRoot&&this.clear(e.cell,!0);else{if(n.x!=a.x||n.y!=a.y){var i=a.x-n.x,s=a.y-n.y;e.terminalDistance=Math.sqrt(i*i+s*s)}else e.terminalDistance=0;a=0;var o=[];if(null!=(s=n)){n=s.x;for(var r=s.y,l=n,d=r,c=1;c<t.length;c++){var m=t[c];null!=m&&(i=s.x-m.x,s=s.y-m.y,i=Math.sqrt(i*i+s*s),o.push(i),a+=i,s=m,n=Math.min(s.x,n),r=Math.min(s.y,r),l=Math.max(s.x,l),d=Math.max(s.y,d))}e.length=a,e.segments=o,e.x=n,e.y=r,e.width=Math.max(1,l-n),e.height=Math.max(1,d-r)}}}},mxGraphView.prototype.getPoint=function(e,t){var n=e.getCenterX(),a=e.getCenterY();if(null==e.segments||null!=t&&!t.relative)null!=t&&(null!=(d=t.offset)&&(n+=d.x,a+=d.y));else{for(var i=e.absolutePoints.length,s=(.5+(null!=t?t.x/2:0))*e.length,o=e.segments[0],r=0,l=1;r+o<s&&l<i-1;)r+=o,o=e.segments[l++];if(i=0==o?0:(s-r)/o,s=e.absolutePoints[l-1],l=e.absolutePoints[l],null!=s&&null!=l){if(r=n=a=0,null!=t){a=t.y;var d=t.offset;null!=d&&(n=d.x,r=d.y)}d=l.x-s.x,l=l.y-s.y,n=s.x+d*i+((0==o?0:l/o)*a+n)*this.scale,a=s.y+l*i-((0==o?0:d/o)*a-r)*this.scale}}return new mxPoint(n,a)},mxGraphView.prototype.getRelativePoint=function(e,t,n){if(null!=(i=this.graph.getModel().getGeometry(e.cell))){var a=e.absolutePoints.length;if(i.relative&&1<a){for(var i=e.length,s=e.segments,o=e.absolutePoints[0],r=e.absolutePoints[1],l=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n),d=0,c=0,m=0,u=2;u<a;u++)c+=s[u-2],r=e.absolutePoints[u],(o=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n))<=l&&(l=o,d=u-1,m=c),o=r;return a=s[d],o=e.absolutePoints[d],l=(r=e.absolutePoints[d+1]).x,s=r.y,s=(l=(e=o.x-l)-(l=t-l))*e+(s=(d=o.y-s)-(s=n-s))*d,a<(e=Math.sqrt(s<=0?0:s*s/(e*e+d*d)))&&(e=a),a=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,t,n)),-1==mxUtils.relativeCcw(o.x,o.y,r.x,r.y,t,n)&&(a=-a),new mxPoint((i/2-m-e)/i*-2,a/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(e){var t=e.absolutePoints;if(e.absoluteOffset.x=e.getCenterX(),e.absoluteOffset.y=e.getCenterY(),null!=t&&0<t.length&&null!=e.segments)if((i=this.graph.getCellGeometry(e.cell)).relative){null!=(n=this.getPoint(e,i))&&(e.absoluteOffset=n)}else{var n=t[0],a=t[t.length-1];if(null!=n&&null!=a){t=a.x-n.x;var i,s=a.y-n.y,o=a=0;null!=(i=i.offset)&&(a=i.x,o=i.y),i=n.y+s/2+o*this.scale,e.absoluteOffset.x=n.x+t/2+a*this.scale,e.absoluteOffset.y=i}}},mxGraphView.prototype.getState=function(e,t){t=t||!1;var n=null;return null!=e&&(n=this.states.get(e),this.graph.isCellVisible(e)&&(null==n&&t&&this.graph.isCellVisible(e)?(n=this.createState(e),this.states.put(e,n)):t&&null!=n&&this.updateStyle&&(n.style=this.graph.getCellStyle(e)))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(e){this.rendering=e},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(e){this.allowEval=e},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(e){this.states=e},mxGraphView.prototype.getCellStates=function(e){if(null==e)return this.states;for(var t=[],n=0;n<e.length;n++){var a=this.getState(e[n]);null!=a&&t.push(a)}return t},mxGraphView.prototype.removeState=function(e){var t=null;return null!=e&&(null!=(t=this.states.remove(e))&&(this.graph.cellRenderer.destroy(t),t.destroy())),t},mxGraphView.prototype.createState=function(e){var t=this.graph.getCellStyle(e);return e=new mxCellState(this,e,t),this.graph.cellRenderer.initialize(e,this.isRendering()),e},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.isContainerEvent=function(e){return(e=mxEvent.getSource(e))==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane},mxGraphView.prototype.isScrollEvent=function(e){var t=mxUtils.getOffset(this.graph.container);e=new mxPoint(e.clientX-t.x,e.clientY-t.y);t=this.graph.container.offsetWidth;var n=this.graph.container.clientWidth;return n<t&&e.x>n+2&&e.x<=t||(t=this.graph.container.offsetHeight,(n=this.graph.container.clientHeight)<t&&e.y>n+2&&e.y<=t)},mxGraphView.prototype.init=function(){this.installListeners();var e=this.graph;e.dialect==mxConstants.DIALECT_SVG?this.createSvg():e.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var a=this.graph,i=a.container;if(null!=i){mxEvent.addGestureListeners(i,mxUtils.bind(this,function(e){mxClient.IS_TOUCH&&a.isEditing()&&a.stopEditing(!a.isInvokesStopCellEditing()),this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.isContainerEvent(e)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addListener(i,"dblclick",mxUtils.bind(this,function(e){a.dblClick(e)}));a.addMouseListener({mouseDown:function(e,t){a.panningHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(e){var t,n;null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide(),this.captureDocumentGesture&&a.isMouseDown&&!mxEvent.isConsumed(e)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,(t=e,n=null,mxClient.IS_TOUCH&&(n=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(i,n,t),n=a.view.getState(a.getCellAt(t.x,t.y))),n)))}),this.endHandler=mxUtils.bind(this,function(e){this.captureDocumentGesture&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var e=this.graph.container;null!=e&&(this.canvas=this.createHtmlPane("100%","100%"),this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas),mxClient.IS_QUIRKS&&(e=mxUtils.bind(this,function(e){e=this.getGraphBounds(),this.updateHtmlCanvasSize(e.x+e.width+this.graph.border,e.y+e.height+this.graph.border)}),mxEvent.addListener(window,"resize",e)))},mxGraphView.prototype.updateHtmlCanvasSize=function(e,t){if(null!=this.graph.container){var n=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<e?e+"px":"100%",this.canvas.style.height=n<t?t+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(e,t){var n=document.createElement("DIV");return null!=e&&null!=t?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e,n.style.height=t):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var e=this.graph.container;if(null!=e){var t=e.offsetWidth,n=e.offsetHeight;this.canvas=this.createVmlPane(t,n),this.backgroundPane=this.createVmlPane(t,n),this.drawPane=this.createVmlPane(t,n),this.overlayPane=this.createVmlPane(t,n),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),e.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(e,t){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=e+"px",n.style.height=t+"px",n.setAttribute("coordsize",e+","+t),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var e=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane);var t=document.createElementNS(mxConstants.NS_SVG,"svg");t.style.width="100%",t.style.height="100%",t.style.display="block",t.appendChild(this.canvas),null!=e&&(e.appendChild(t),"static"==mxUtils.getCurrentStyle(e).position&&(e.style.position="relative"))},mxGraphView.prototype.destroy=function(){var e=null!=this.canvas?this.canvas.ownerSVGElement:null;null==e&&(e=this.canvas),null!=e&&null!=e.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),e.parentNode.removeChild(e),this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)},mxCurrentRootChange.prototype.execute=function(){var e=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=e,null!=(e=this.view.graph.getTranslateForRoot(this.view.currentRoot))&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh(),this.isUp=!this.isUp},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.EMPTY_ARRAY=[],mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=700,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.gestureEnabled=!0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.ordered=!0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!0,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage("/assets/plugins/mxgraph/images/warning.gif",16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(e){this.container=e,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(e,"selectstart",mxUtils.bind(this,function(){return this.isEditing()}))),8==document.documentMode&&e.insertAdjacentHTML("beforeend",'<v:group style="DISPLAY: none;"></v:group>')},mxGraph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(e){this.stylesheet=e},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(e){this.selectionModel=e},mxGraph.prototype.getSelectionCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a.constructor!=mxRootChange){var i=null;a instanceof mxChildChange&&null==a.previous?i=a.child:null!=a.cell&&a.cell instanceof mxCell&&(i=a.cell),null!=i&&mxUtils.indexOf(t,i)<0&&t.push(i)}}return this.getModel().getTopmostCells(t)},mxGraph.prototype.graphModelChanged=function(e){for(var t=0;t<e.length;t++)this.processChange(e[t]);this.removeSelectionCells(this.getRemovedCellsForChanges(e)),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.getRemovedCellsForChanges=function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n];if(a instanceof mxRootChange)break;a instanceof mxChildChange?null!=a.previous&&null==a.parent&&(t=t.concat(this.model.getDescendants(a.child))):a instanceof mxVisibleChange&&(t=t.concat(this.model.getDescendants(a.cell)))}return t},mxGraph.prototype.processChange=function(e){if(e instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(e.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(e instanceof mxChildChange){var t=this.model.getParent(e.child);null!=t?this.view.invalidate(e.child,!0,!1,null!=e.previous):(this.removeStateForCell(e.child),this.view.currentRoot==e.child&&this.home()),t!=e.previous&&(null!=t&&this.view.invalidate(t,!1,!1),null!=e.previous&&this.view.invalidate(e.previous,!1,!1))}else e instanceof mxTerminalChange||e instanceof mxGeometryChange?this.view.invalidate(e.cell):e instanceof mxValueChange?this.view.invalidate(e.cell,!1,!1):e instanceof mxStyleChange?(this.view.invalidate(e.cell,!0,!0,!1),this.view.removeState(e.cell)):null!=e.cell&&e.cell instanceof mxCell&&this.removeStateForCell(e.cell)},mxGraph.prototype.removeStateForCell=function(e){for(var t=this.model.getChildCount(e),n=0;n<t;n++)this.removeStateForCell(this.model.getChildAt(e,n));this.view.removeState(e)},mxGraph.prototype.addCellOverlay=function(e,t){null==e.overlays&&(e.overlays=[]),e.overlays.push(t);var n=this.view.getState(e);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",e,"overlay",t)),t},mxGraph.prototype.getCellOverlays=function(e){return e.overlays},mxGraph.prototype.removeCellOverlay=function(e,t){if(null==t)this.removeCellOverlays(e);else{var n=mxUtils.indexOf(e.overlays,t);0<=n?(e.overlays.splice(n,1),0==e.overlays.length&&(e.overlays=null),null!=(n=this.view.getState(e))&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t))):t=null}return t},mxGraph.prototype.removeCellOverlays=function(e){var t=e.overlays;if(null!=t){e.overlays=null;var n=this.view.getState(e);for(null!=n&&this.cellRenderer.redraw(n),n=0;n<t.length;n++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",e,"overlay",t[n]))}return t},mxGraph.prototype.clearCellOverlays=function(e){e=null!=e?e:this.model.getRoot(),this.removeCellOverlays(e);for(var t=this.model.getChildCount(e),n=0;n<t;n++){var a=this.model.getChildAt(e,n);this.clearCellOverlays(a)}},mxGraph.prototype.setCellWarning=function(n,e,t,a){return null!=e&&0<e.length?(e=new mxCellOverlay(t=null!=t?t:this.warningImage,"<font color=red>"+e+"</font>"),a&&e.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,t){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,e)):(this.removeCellOverlays(n),null)},mxGraph.prototype.startEditing=function(e){this.startEditingAtCell(null,e)},mxGraph.prototype.startEditingAtCell=function(e,t){null==e&&(null!=(e=this.getSelectionCell())&&!this.isCellEditable(e)&&(e=null)),null!=e&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",e,"event",t)),this.cellEditor.startEditing(e,t))},mxGraph.prototype.getEditingValue=function(e,t){return this.convertValueToString(e)},mxGraph.prototype.stopEditing=function(e){this.cellEditor.stopEditing(e)},mxGraph.prototype.labelChanged=function(e,t,n){this.model.beginUpdate();try{this.cellLabelChanged(e,t,this.isAutoSizeCell(e)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",e,"value",t,"event",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellLabelChanged=function(e,t,n){this.model.beginUpdate();try{this.model.setValue(e,t),n&&this.cellSizeUpdated(e,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(e){this.stopEditing(!0),this.connectionHandler.reset(),this.graphHandler.reset(),e=this.getSelectionCells();for(var t=0;t<e.length;t++){var n=this.view.getState(e[t]);null!=n&&null!=n.handler&&n.handler.reset()}},mxGraph.prototype.click=function(e){var t=e.getEvent(),n=e.getCell(),a=new mxEventObject(mxEvent.CLICK,"event",t,"cell",n);e.isConsumed()&&a.consume(),this.fireEvent(a),this.isEnabled()&&!mxEvent.isConsumed(t)&&!a.isConsumed()&&(null!=n?this.selectCellForEvent(n,t):(n=null,this.isSwimlaneSelectionEnabled()&&(n=this.getSwimlaneAt(e.getGraphX(),e.getGraphY())),null!=n?this.selectCellForEvent(n,t):this.isToggleEvent(t)||this.clearSelection()))},mxGraph.prototype.dblClick=function(e,t){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",t);this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&null!=t&&this.isCellEditable(t)&&this.startEditingAtCell(t,e)},mxGraph.prototype.scrollPointToVisible=function(e,t,n,a){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.active&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(e+this.panDx,t+this.panDy));else{var i=this.container;if(a=null!=a?a:20,e>=i.scrollLeft&&t>=i.scrollTop&&e<=i.scrollLeft+i.clientWidth&&t<=i.scrollTop+i.clientHeight){var s=i.scrollLeft+i.clientWidth-e;if(s<a){if(e=i.scrollLeft,i.scrollLeft+=a-s,n&&e==i.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){e=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+a-s}else o=Math.max(i.clientWidth,i.scrollWidth)+a-s,e=this.view.getCanvas();e.style.width=o+"px",i.scrollLeft+=a-s}}else(s=e-i.scrollLeft)<a&&(i.scrollLeft-=a-s);(s=i.scrollTop+i.clientHeight-t)<a?(e=i.scrollTop,i.scrollTop+=a-s,e==i.scrollTop&&n&&(this.dialect==mxConstants.DIALECT_SVG?(e=this.view.getDrawPane().ownerSVGElement,t=this.container.scrollHeight+a-s):(t=Math.max(i.clientHeight,i.scrollHeight)+a-s,e=this.view.getCanvas()),e.style.height=t+"px",i.scrollTop+=a-s)):(s=t-i.scrollTop)<a&&(i.scrollTop-=a-s)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){function e(e){var t=0;t="thin"==e?2:"medium"==e?4:"thick"==e?6:parseInt(e);return isNaN(t)&&(t=0),t}var t=mxUtils.getCurrentStyle(this.container),n=new mxRectangle;return n.x=e(t.borderLeftWidth)+parseInt(t.paddingLeft||0),n.y=e(t.borderTopWidth)+parseInt(t.paddingTop||0),n.width=e(t.borderRightWidth)+parseInt(t.paddingRight||0),n.height=e(t.borderBottomWidth)+parseInt(t.paddingBottom||0),n},mxGraph.prototype.getPreferredPageSize=function(e,t,n){e=this.view.scale;var a=this.view.translate,i=this.pageFormat,s=e*this.pageScale;i=new mxRectangle(0,0,i.width*s,i.height*s);return t=this.pageBreaksVisible?Math.ceil(t/i.width):1,n=this.pageBreaksVisible?Math.ceil(n/i.height):1,new mxRectangle(0,0,t*i.width+2+a.x/e,n*i.height+2+a.y/e)},mxGraph.prototype.sizeDidChange=function(){var e=this.getGraphBounds();if(null!=this.container){var t=this.getBorder(),n=Math.max(0,e.x+e.width+1+t);t=Math.max(0,e.y+e.height+1+t);if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),t=Math.max(t,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,t),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var a=this.getPreferredPageSize(e,n,t);null!=a&&(n=a.width,t=a.height)}null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),t=Math.max(t,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n-1),t=Math.ceil(t-1),this.dialect==mxConstants.DIALECT_SVG?((a=this.view.getDrawPane().ownerSVGElement).style.minWidth=Math.max(1,n)+"px",a.style.minHeight=Math.max(1,t)+"px",a.style.width="100%",a.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,t)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,t)+"px"),this.updatePageBreaks(this.pageBreaksVisible,n-1,t-1)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(e,t){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var n=this.getBorderSizes();e+=Math.max(2,n.x+n.width+1),t+=Math.max(2,n.y+n.height+1)}else 9<=document.documentMode?(e+=3,t+=5):(e+=1,t+=1);else t+=1;null!=this.maximumContainerSize&&(e=Math.min(this.maximumContainerSize.width,e),t=Math.min(this.maximumContainerSize.height,t)),this.container.style.width=Math.ceil(e)+"px",this.container.style.height=Math.ceil(t)+"px"},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale;i=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o);if(e=e&&Math.min(i.width,i.height)>this.minPageBreakDist,i.x=mxUtils.mod(i.x,i.width),i.y=mxUtils.mod(i.y,i.height),s=e?Math.ceil((t-i.x)/i.width):0,e=e?Math.ceil((n-i.y)/i.height):0,null==this.horizontalPageBreaks&&0<s&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(o=0;o<=s;o++){var r=[new mxPoint(i.x+o*i.width,1),new mxPoint(i.x+o*i.width,n)];null!=this.horizontalPageBreaks[o]?(this.horizontalPageBreaks[o].scale=1,this.horizontalPageBreaks[o].points=r,this.horizontalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,this.scale)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.horizontalPageBreaks[o]=r)}for(o=s;o<this.horizontalPageBreaks.length;o++)this.horizontalPageBreaks[o].destroy();this.horizontalPageBreaks.splice(s,this.horizontalPageBreaks.length-s)}if(null==this.verticalPageBreaks&&0<e&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(o=0;o<=e;o++)r=[new mxPoint(1,i.y+o*i.height),new mxPoint(t,i.y+o*i.height)],null!=this.verticalPageBreaks[o]?(this.verticalPageBreaks[o].scale=1,this.verticalPageBreaks[o].points=r,this.verticalPageBreaks[o].redraw()):((r=new mxPolyline(r,this.pageBreakColor,a)).dialect=this.dialect,r.isDashed=this.pageBreakDashed,r.scale=a,r.init(this.view.backgroundPane),r.redraw(),this.verticalPageBreaks[o]=r);for(o=e;o<this.verticalPageBreaks.length;o++)this.verticalPageBreaks[o].destroy();this.verticalPageBreaks.splice(e,this.verticalPageBreaks.length-e)}},mxGraph.prototype.getCellStyle=function(e){var t=this.model.getStyle(e),n=null;n=this.model.isEdge(e)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=t&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(t,n))),null==n&&(n=mxGraph.prototype.EMPTY_ARRAY),n},mxGraph.prototype.postProcessCellStyle=function(e){if(null!=e){var t=e[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(t);null!=n?e[mxConstants.STYLE_IMAGE]=n:n=t,null!=n&&"data:image/"==n.substring(0,11)&&(0<(t=n.indexOf(","))&&(n=n.substring(0,t)+";base64,"+n.substring(t+1)),e[mxConstants.STYLE_IMAGE]=n)}return e},mxGraph.prototype.setCellStyle=function(e,t){if(null!=(t=t||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setStyle(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(e,t,n){n=n||this.getSelectionCell(),this.toggleCellStyles(e,t,[n])},mxGraph.prototype.toggleCellStyles=function(e,t,n){var a;(t=null!=t&&t,null!=(n=n||this.getSelectionCells())&&0<n.length)&&(null!=(a=null!=(a=this.view.getState(n[0]))?a.style:this.getCellStyle(n[0]))&&(t=mxUtils.getValue(a,e,t)?0:1,this.setCellStyles(e,t,n)))},mxGraph.prototype.setCellStyles=function(e,t,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,e,t)},mxGraph.prototype.toggleCellStyleFlags=function(e,t,n){this.setCellStyleFlags(e,t,null,n)},mxGraph.prototype.setCellStyleFlags=function(e,t,n,a){if(null!=(a=a||this.getSelectionCells())&&0<a.length){var i;if(null==n)null!=(i=null!=(i=this.view.getState(a[0]))?i.style:this.getCellStyle(a[0]))&&(n=(parseInt(i[e]||0)&t)!=t);mxUtils.setCellStyleFlags(this.model,a,e,t,n)}},mxGraph.prototype.alignCells=function(e,t,n){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){if(null==n)for(var a=0;a<t.length;a++){var i=this.getCellGeometry(t[a]);if(null!=i&&!this.model.isEdge(t[a]))if(null==n){if(e==mxConstants.ALIGN_CENTER){n=i.x+i.width/2;break}if(e==mxConstants.ALIGN_RIGHT)n=i.x+i.width;else if(e==mxConstants.ALIGN_TOP)n=i.y;else{if(e==mxConstants.ALIGN_MIDDLE){n=i.y+i.height/2;break}n=e==mxConstants.ALIGN_BOTTOM?i.y+i.height:i.x}}else n=e==mxConstants.ALIGN_RIGHT?Math.max(n,i.x+i.width):e==mxConstants.ALIGN_TOP?Math.min(n,i.y):e==mxConstants.ALIGN_BOTTOM?Math.max(n,i.y+i.height):Math.min(n,i.x)}if(null!=n){this.model.beginUpdate();try{for(a=0;a<t.length;a++)null!=(i=this.getCellGeometry(t[a]))&&!this.model.isEdge(t[a])&&(i=i.clone(),e==mxConstants.ALIGN_CENTER?i.x=n-i.width/2:e==mxConstants.ALIGN_RIGHT?i.x=n-i.width:e==mxConstants.ALIGN_TOP?i.y=n:e==mxConstants.ALIGN_MIDDLE?i.y=n-i.height/2:e==mxConstants.ALIGN_BOTTOM?i.y=n-i.height:i.x=n,this.model.setGeometry(t[a],i));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",e,"cells",t))}finally{this.model.endUpdate()}}}return t},mxGraph.prototype.flipEdge=function(e){if(null!=e&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var t=this.model.getStyle(e);null==t||0==t.length?this.model.setStyle(e,this.alternateEdgeStyle):this.model.setStyle(e,null),this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",e))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.addImageBundle=function(e){this.imageBundles.push(e)},mxGraph.prototype.removeImageBundle=function(e){for(var t=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=e&&t.push(this.imageBundles[n]);this.imageBundles=t},mxGraph.prototype.getImageFromBundles=function(e){if(null!=e)for(var t=0;t<this.imageBundles.length;t++){var n=this.imageBundles[t].getImage(e);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(e,t){null==t&&(t=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(t,e),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",e,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsOrdered=function(e,t){if(null!=e){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=this.model.getParent(e[n]);t?this.model.add(a,e[n],n):this.model.add(a,e[n],this.model.getChildCount(a)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",t,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(e,t,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==e&&(e=this.createGroupCell(n));var a=this.getBoundsForGroup(e,n,t);if(0<n.length&&null!=a){var i=this.model.getParent(e);null==i&&(i=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(e)&&this.model.setGeometry(e,new mxGeometry);var s=this.model.getChildCount(i);this.cellsAdded([e],i,s,null,null,!1),s=this.model.getChildCount(e),this.cellsAdded(n,e,s,null,null,!1,!1),this.cellsMoved(n,-a.x,-a.y,!1,!0),this.cellsResized([e],[a]),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",e,"border",t,"cells",n))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForGroup=function(e){var t=[];if(null!=e&&0<e.length){var n=this.model.getParent(e[0]);t.push(e[0]);for(var a=1;a<e.length;a++)this.model.getParent(e[a])==n&&t.push(e[a])}return t},mxGraph.prototype.getBoundsForGroup=function(e,t,n){return null!=(t=this.getBoundingBoxFromGeometry(t))&&(this.isSwimlane(e)&&(e=this.getStartSize(e),t.x-=e.width,t.y-=e.height,t.width+=e.width,t.height+=e.height),t.x-=n,t.y-=n,t.width+=2*n,t.height+=2*n),t},mxGraph.prototype.createGroupCell=function(e){return(e=new mxCell("")).setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(e){var t=[];if(null==e){e=this.getSelectionCells();for(var n=[],a=0;a<e.length;a++)0<this.model.getChildCount(e[a])&&n.push(e[a]);e=n}if(null!=e&&0<e.length){this.model.beginUpdate();try{for(a=0;a<e.length;a++){if(null!=(i=this.model.getChildren(e[a]))&&0<i.length){var i=i.slice(),s=this.model.getParent(e[a]),o=this.model.getChildCount(s);this.cellsAdded(i,s,o,null,null,!0),t=t.concat(i)}}this.cellsRemoved(this.addAllEdges(e)),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",e))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.removeCellsFromParent=function(e){null==e&&(e=this.getSelectionCells()),this.model.beginUpdate();try{var t=this.getDefaultParent(),n=this.model.getChildCount(t);this.cellsAdded(e,t,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.updateGroupBounds=function(e,t,n){null==e&&(e=this.getSelectionCells()),t=null!=t?t:0,n=null!=n&&n,this.model.beginUpdate();try{for(var a=0;a<e.length;a++){if(null!=(r=this.getCellGeometry(e[a]))){var i=this.getChildCells(e[a]);if(null!=i&&0<i.length){var s=this.getBoundingBoxFromGeometry(i);if(0<s.width&&0<s.height){var o=this.isSwimlane(e[a])?this.getStartSize(e[a]):new mxRectangle,r=r.clone();n&&(r.x+=s.x-o.width-t,r.y+=s.y-o.height-t),r.width=s.width+o.width+2*t,r.height=s.height+o.height+2*t,this.model.setGeometry(e[a],r),this.moveCells(i,-s.x+o.width+t,-s.y+o.height+t)}}}}}finally{this.model.endUpdate()}return e},mxGraph.prototype.cloneCells=function(e,t){t=null==t||t;var n=null;if(null!=e){for(var a={},i=(n=[],0);i<e.length;i++){a[s=mxCellPath.create(e[i])]=e[i],n.push(e[i])}if(0<n.length){var s=this.view.scale,o=this.view.translate;for(n=this.model.cloneCells(e,!0),i=0;i<e.length;i++)if(!t&&this.model.isEdge(n[i])&&null!=this.getEdgeValidationError(n[i],this.model.getTerminal(n[i],!0),this.model.getTerminal(n[i],!1)))n[i]=null;else{var r=this.model.getGeometry(n[i]);if(null!=r){var l=this.view.getState(e[i]),d=this.view.getState(this.model.getParent(e[i]));if(null!=l&&null!=d){var c=d.origin.x;d=d.origin.y;if(this.model.isEdge(n[i])){l=l.absolutePoints;for(var m=this.model.getTerminal(e[i],!0),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);for(null==m&&r.setTerminalPoint(new mxPoint(l[0].x/s-o.x,l[0].y/s-o.y),!0),m=this.model.getTerminal(e[i],!1),u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);if(null==m&&(m=l.length-1,r.setTerminalPoint(new mxPoint(l[m].x/s-o.x,l[m].y/s-o.y),!1)),null!=(r=r.points))for(l=0;l<r.length;l++)r[l].x+=c,r[l].y+=d}else r.x+=c,r.y+=d}}}}else n=[]}return n},mxGraph.prototype.insertVertex=function(e,t,n,a,i,s,o,r,l){return t=this.createVertex(e,t,n,a,i,s,o,r,l),this.addCell(t,e)},mxGraph.prototype.createVertex=function(e,t,n,a,i,s,o,r,l){return(e=new mxGeometry(a,i,s,o)).relative=null!=l&&l,(n=new mxCell(n,e,r)).setId(t),n.setVertex(!0),n.setConnectable(!0),n},mxGraph.prototype.insertEdge=function(e,t,n,a,i,s){return t=this.createEdge(e,t,n,a,i,s),this.addEdge(t,e,a,i)},mxGraph.prototype.createEdge=function(e,t,n,a,i,s){return(e=new mxCell(n,new mxGeometry,s)).setId(t),e.setEdge(!0),e.geometry.relative=!0,e},mxGraph.prototype.addEdge=function(e,t,n,a,i){return this.addCell(e,t,i,n,a)},mxGraph.prototype.addCell=function(e,t,n,a,i){return this.addCells([e],t,n,a,i)[0]},mxGraph.prototype.addCells=function(e,t,n,a,i){null==t&&(t=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(t)),this.model.beginUpdate();try{this.cellsAdded(e,t,n,a,i,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",e,"parent",t,"index",n,"source",a,"target",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsAdded=function(e,t,n,a,i,s,o){if(null!=e&&null!=t&&null!=n){this.model.beginUpdate();try{for(var r=null!=(d=s?this.view.getState(t):null)?d.origin:null,l=new mxPoint(0,0),d=0;d<e.length;d++)if(null==e[d])n--;else{var c=this.model.getParent(e[d]);if(null!=r&&e[d]!=t&&t!=c){var m=this.view.getState(c),u=null!=m?m.origin:l;if(null!=(p=this.model.getGeometry(e[d]))){var p,g=u.x-r.x,v=u.y-r.y;(p=p.clone()).translate(g,v),!p.relative&&this.model.isVertex(e[d])&&!this.isAllowNegativeCoordinates()&&(p.x=Math.max(0,p.x),p.y=Math.max(0,p.y)),this.model.setGeometry(e[d],p)}}t==c&&n+d>this.model.getChildCount(t)&&n--,this.model.add(t,e[d],n+d),this.isExtendParentsOnAdd()&&this.isExtendParent(e[d])&&this.extendParent(e[d]),(null==o||o)&&this.constrainChild(e[d]),null!=a&&this.cellConnected(e[d],a,!0),null!=i&&this.cellConnected(e[d],i,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",e,"parent",t,"index",n,"source",a,"target",i,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.removeCells=function(e,t){t=null==t||t,null==e&&(e=this.getDeletableCells(this.getSelectionCells())),t&&(e=this.getDeletableCells(this.addAllEdges(e))),this.model.beginUpdate();try{this.cellsRemoved(e),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",e,"includeEdges",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsRemoved=function(e){if(null!=e&&0<e.length){var t=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var a={},i=0;i<e.length;i++){var s=mxCellPath.create(e[i]);a[s]=e[i]}for(i=0;i<e.length;i++){for(var o=this.getConnections(e[i]),r=0;r<o.length;r++)if(null==a[s=mxCellPath.create(o[r])]){if(null!=(d=this.model.getGeometry(o[r]))){var l=this.view.getState(o[r]);if(null!=l){var d=d.clone(),c=l.getVisibleTerminal(!0)==e[i],m=l.absolutePoints,u=c?0:m.length-1;d.setTerminalPoint(new mxPoint(m[u].x/t-n.x,m[u].y/t-n.y),c),this.model.setTerminal(o[r],null,c),this.model.setGeometry(o[r],d)}}}this.model.remove(e[i])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(e,t,n,a,i){a=a||0,i=i||0,null==n&&(n=this.cloneCells([e])[0]);var s=this.model.getParent(e),o=this.model.getTerminal(e,!0);this.model.beginUpdate();try{this.cellsMoved(t,a,i,!1,!1),this.cellsAdded(t,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([n],s,this.model.getChildCount(s),o,t[0],!1),this.cellConnected(e,t[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",e,"cells",t,"newEdge",n,"dx",a,"dy",i))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(e,t,n){null==t&&(t=this.getSelectionCells()),n&&(t=this.addAllEdges(t)),this.model.beginUpdate();try{this.cellsToggled(t,e),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",e,"cells",t,"includeEdges",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsToggled=function(e,t){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setVisible(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(e,t,n,a){t=null!=t&&t,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),e)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,e,t,a),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",e,"recurse",t,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(e,t,n,a){if(null!=e&&0<e.length){this.model.beginUpdate();try{for(var i=0;i<e.length;i++)if((!a||this.isCellFoldable(e[i],t))&&t!=this.isCellCollapsed(e[i])&&(this.model.setCollapsed(e[i],t),this.swapBounds(e[i],t),this.isExtendParent(e[i])&&this.extendParent(e[i]),n)){var s=this.model.getChildren(e[i]);this.foldCells(s,t,n)}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",e,"collapse",t,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(e,t){if(null!=e){var n=this.model.getGeometry(e);null!=n&&(n=n.clone(),this.updateAlternateBounds(e,n,t),n.swap(),this.model.setGeometry(e,n))}},mxGraph.prototype.updateAlternateBounds=function(e,t,n){if(null!=e&&null!=t){if(n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e),null==t.alternateBounds){var a=t;this.collapseToPreferredSize&&(null!=(e=this.getPreferredSizeForCell(e))&&(a=e,0<(e=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE))&&(a.height=Math.max(a.height,e)))),t.alternateBounds=new mxRectangle(0,0,a.width,a.height)}if(null!=t.alternateBounds){t.alternateBounds.x=t.x,t.alternateBounds.y=t.y;var i=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||"0");0!=i&&(e=t.alternateBounds.getCenterX()-t.getCenterX(),n=t.alternateBounds.getCenterY()-t.getCenterY(),a=Math.cos(i),i=Math.sin(i),t.alternateBounds.x+=a*e-i*n-e,t.alternateBounds.y+=i*e+a*n-n)}}},mxGraph.prototype.addAllEdges=function(e){var t=e.slice();return t.concat(this.getAllEdges(e))},mxGraph.prototype.getAllEdges=function(e){var t=[];if(null!=e)for(var n=0;n<e.length;n++){for(var a=this.model.getEdgeCount(e[n]),i=0;i<a;i++)t.push(this.model.getEdgeAt(e[n],i));a=this.model.getChildren(e[n]),t=t.concat(this.getAllEdges(a))}return t},mxGraph.prototype.updateCellSize=function(e,t){t=null!=t&&t,this.model.beginUpdate();try{this.cellSizeUpdated(e,t),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",e,"ignoreChildren",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellSizeUpdated=function(e,t){if(null!=e){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(e),a=this.model.getGeometry(e);if(null!=n&&null!=a){var i=this.isCellCollapsed(e);a=a.clone();if(this.isSwimlane(e)){var s=this.view.getState(e),o=null!=s?s.style:this.getCellStyle(e),r=this.model.getStyle(e);null==r&&(r=""),mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.height+8),i&&(a.height=n.height+8),a.width=n.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.width+8),i&&(a.width=n.width+8),a.height=n.height),this.model.setStyle(e,r)}else a.width=n.width,a.height=n.height;if(!t&&!i){var l=this.view.getBounds(this.model.getChildren(e));if(null!=l){var d=this.view.translate,c=this.view.scale,m=(l.y+l.height)/c-a.y-d.y;a.width=Math.max(a.width,(l.x+l.width)/c-a.x-d.x),a.height=Math.max(a.height,m)}}this.cellsResized([e],[a])}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(e){var t=null;if(null!=e){var n=this.view.getState(e),a=null!=n?n.style:this.getCellStyle(e);if(null!=a&&!this.model.isEdge(e)){var i=a[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0;t=0;null==this.getImage(n)&&null==a[mxConstants.STYLE_IMAGE]||a[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(a[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(a[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),a[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(t+=parseFloat(a[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(a[mxConstants.STYLE_SPACING]||0),s+=a[mxConstants.STYLE_SPACING_LEFT]||0,s+=a[mxConstants.STYLE_SPACING_RIGHT]||0,t+=2*(a[mxConstants.STYLE_SPACING]||0),t+=a[mxConstants.STYLE_SPACING_TOP]||0,t+=a[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(n=this.getFoldingImage(n))&&(s+=n.width+8),t=null!=(n=this.getLabel(e))&&0<n.length?(this.isHtmlLabel(e)||(n=n.replace(/\n/g,"<br>")),e=(i=mxUtils.getSizeForString(n,i,a[mxConstants.STYLE_FONTFAMILY])).width+s,t=i.height+t,mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)||(a=t,t=e,e=a),this.gridEnabled&&(e=this.snap(e+this.gridSize/2),t=this.snap(t+this.gridSize/2)),new mxRectangle(0,0,e,t)):new mxRectangle(0,0,a=4*this.gridSize,a)}}return t},mxGraph.prototype.handleGesture=function(e,t){if(.2<Math.abs(1-t.scale)){var n=this.view.scale,a=this.view.translate,i=e.width*t.scale,s=e.height*t.scale,o=e.y-(s-e.height)/2;n=new mxRectangle(this.snap((e.x-(i-e.width)/2)/n)-a.x,this.snap(o/n)-a.y,this.snap(i/n),this.snap(s/n));this.resizeCell(e.cell,n)}},mxGraph.prototype.resizeCell=function(e,t){return this.resizeCells([e],[t])[0]},mxGraph.prototype.resizeCells=function(e,t){this.model.beginUpdate();try{this.cellsResized(e,t),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",e,"bounds",t))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsResized=function(e,t){if(null!=e&&null!=t&&e.length==t.length){this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var a=t[n],i=this.model.getGeometry(e[n]);if(null!=i&&(i.x!=a.x||i.y!=a.y||i.width!=a.width||i.height!=a.height)){if((i=i.clone()).relative){var s=i.offset;null!=s&&(s.x+=a.x-i.x,s.y+=a.y-i.y)}else i.x=a.x,i.y=a.y;i.width=a.width,i.height=a.height,!i.relative&&this.model.isVertex(e[n])&&!this.isAllowNegativeCoordinates()&&(i.x=Math.max(0,i.x),i.y=Math.max(0,i.y)),this.model.setGeometry(e[n],i),this.isExtendParent(e[n])&&this.extendParent(e[n])}}this.resetEdgesOnResize&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",e,"bounds",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.extendParent=function(e){if(null!=e){var t=this.model.getParent(e),n=this.model.getGeometry(t);null!=t&&null!=n&&!this.isCellCollapsed(t)&&(null!=(e=this.model.getGeometry(e))&&(n.width<e.x+e.width||n.height<e.y+e.height))&&((n=n.clone()).width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height),this.cellsResized([t],[n]))}},mxGraph.prototype.importCells=function(e,t,n,a,i){return this.moveCells(e,t,n,!0,a,i)},mxGraph.prototype.moveCells=function(e,t,n,a,i,s){if(t=null!=t?t:0,n=null!=n?n:0,a=null!=a&&a,null!=e&&(0!=t||0!=n||a||null!=i)){this.model.beginUpdate();try{a&&(e=this.cloneCells(e,this.isCloneInvalidEdges()),null==i&&(i=this.getDefaultParent()));var o=this.isAllowNegativeCoordinates();if(null!=i&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(e,t,n,!a&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==i),this.setAllowNegativeCoordinates(o),null!=i){var r=this.model.getChildCount(i);this.cellsAdded(e,i,r,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",e,"dx",t,"dy",n,"clone",a,"target",i,"event",s))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.cellsMoved=function(e,t,n,a,i){if(null!=e&&(0!=t||0!=n)){this.model.beginUpdate();try{a&&this.disconnectGraph(e);for(var s=0;s<e.length;s++)this.translateCell(e[s],t,n),i&&this.constrainChild(e[s]);this.resetEdgesOnMove&&this.resetEdges(e),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",e,"dx",n,"dy",n,"disconnect",a))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(e,t,n){var a=this.model.getGeometry(e);null!=a&&((a=a.clone()).translate(t,n),!a.relative&&this.model.isVertex(e)&&!this.isAllowNegativeCoordinates()&&(a.x=Math.max(0,a.x),a.y=Math.max(0,a.y)),a.relative&&!this.model.isEdge(e)&&(null==a.offset?a.offset=new mxPoint(t,n):(a.offset.x+=t,a.offset.y+=n)),this.model.setGeometry(e,a))},mxGraph.prototype.getCellContainmentArea=function(e){if(null!=e&&!this.model.isEdge(e)){var t=this.model.getParent(e);if(t==this.getDefaultParent()||t==this.getCurrentRoot())return this.getMaximumGraphBounds();if(null!=t&&t!=this.getDefaultParent())if(null!=(i=this.model.getGeometry(t))){var n=e=0,a=i.width,i=i.height;return this.isSwimlane(t)&&(e=(t=this.getStartSize(t)).width,a-=t.width,n=t.height,i-=t.height),new mxRectangle(e,n,a,i)}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(e){if(null!=e){var t=this.model.getGeometry(e),n=this.isConstrainChild(e)?this.getCellContainmentArea(e):this.getMaximumGraphBounds();null!=t&&null!=n&&!t.relative&&(t.x<n.x||t.y<n.y||n.width<t.x+t.width||n.height<t.y+t.height)&&(e=this.getOverlap(e),0<n.width&&(t.x=Math.min(t.x,n.x+n.width-(1-e)*t.width)),0<n.height&&(t.y=Math.min(t.y,n.y+n.height-(1-e)*t.height)),t.x=Math.max(t.x,n.x-t.width*e),t.y=Math.max(t.y,n.y-t.height*e))}},mxGraph.prototype.resetEdges=function(e){if(null!=e){for(var t={},n=0;n<e.length;n++){var a=mxCellPath.create(e[n]);t[a]=e[n]}this.model.beginUpdate();try{for(n=0;n<e.length;n++){var i=this.model.getEdges(e[n]);if(null!=i)for(a=0;a<i.length;a++){var s=this.view.getState(i[a]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[a],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[a],!1),l=mxCellPath.create(o),d=mxCellPath.create(r);(null==t[l]||null==t[d])&&this.resetEdge(i[a])}this.resetEdges(this.model.getChildren(e[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(e){var t=this.model.getGeometry(e);return null!=t&&null!=t.points&&0<t.points.length&&((t=t.clone()).points=[],this.model.setGeometry(e,t)),e},mxGraph.prototype.getAllConnectionConstraints=function(e,t){return null!=e&&null!=e.shape&&null!=e.shape.stencil?e.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(e,t,n){t=null;var a=e.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=a){var i=e.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=i&&(t=new mxPoint(parseFloat(a),parseFloat(i)))}return a=!1,null!=t&&(a=mxUtils.getValue(e.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(t,a)},mxGraph.prototype.setConnectionConstraint=function(e,t,n,a){if(null!=a){this.model.beginUpdate();try{null==a||null==a.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e])):null!=a.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,a.point.x,[e]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,a.point.y,[e]),a.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[e]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[e]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(e,t){var n=null;if(null!=e){var a=this.view.getPerimeterBounds(e),i=new mxPoint(a.getCenterX(),a.getCenterY()),s=e.style[mxConstants.STYLE_DIRECTION],o=0;if(null!=s&&("north"==s?o+=270:"west"==s?o+=180:"south"==s&&(o+=90),"north"==s||"south"==s)){a.x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var r=a.width;a.width=a.height,a.height=r}if(null!=t.point){var l=n=1,d=0,c=0;if(this.getModel().isVertex(e.cell)){var m=e.style[mxConstants.STYLE_FLIPH],u=e.style[mxConstants.STYLE_FLIPV];null!=e.shape.stencil&&(m=1==mxUtils.getValue(e.style,"stencilFlipH",0)||m,u=1==mxUtils.getValue(e.style,"stencilFlipV",0)||u),"north"!=s&&"south"!=s||(r=m,m=u,u=r),m&&(n=-1,d=-a.width),u&&(l=-1,c=-a.height)}n=new mxPoint(a.x+t.point.x*a.width*n-d,a.y+t.point.y*a.height*l-c)}s=e.style[mxConstants.STYLE_ROTATION]||0,t.perimeter?(0!=o&&null!=n&&(r=a=0,90==o?r=1:180==o?a=-1:270==s&&(r=-1),n=mxUtils.getRotatedPoint(n,a,r,i)),null!=n&&t.perimeter&&(n=this.view.getPerimeterPoint(e,n,!1))):s+=o,0!=s&&null!=n&&(o=mxUtils.toRadians(s),a=Math.cos(o),r=Math.sin(o),n=mxUtils.getRotatedPoint(n,a,r,i))}return n},mxGraph.prototype.connectCell=function(e,t,n,a){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.cellConnected(e,t,n,a),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellConnected=function(e,t,n,a){if(null!=e){this.model.beginUpdate();try{var i=this.model.getTerminal(e,n);this.setConnectionConstraint(e,t,n,a),this.isPortsEnabled()&&(a=null,this.isPort(t)&&(a=t.getId(),t=this.getTerminalForPort(t,n)),this.setCellStyles(n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,a,[e])),this.model.setTerminal(e,t,n),this.resetEdgesOnConnect&&this.resetEdge(e),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",e,"terminal",t,"source",n,"previous",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(e){if(null!=e){this.model.beginUpdate();try{for(var t=this.view.scale,n=this.view.translate,a={},i=0;i<e.length;i++){a[mxCellPath.create(e[i])]=e[i]}for(i=0;i<e.length;i++)if(this.model.isEdge(e[i])){if(null!=(r=this.model.getGeometry(e[i]))){var s=this.view.getState(e[i]),o=this.view.getState(this.model.getParent(e[i]));if(null!=s&&null!=o){var r=r.clone(),l=-o.origin.x,d=-o.origin.y,c=s.absolutePoints,m=this.model.getTerminal(e[i],!0);if(null!=m&&this.isCellDisconnectable(e[i],m,!0)){for(var u=mxCellPath.create(m);null!=m&&null==a[u];)m=this.model.getParent(m),u=mxCellPath.create(m);null==m&&(r.setTerminalPoint(new mxPoint(c[0].x/t-n.x+l,c[0].y/t-n.y+d),!0),this.model.setTerminal(e[i],null,!0))}var p=this.model.getTerminal(e[i],!1);if(null!=p&&this.isCellDisconnectable(e[i],p,!1)){for(var g=mxCellPath.create(p);null!=p&&null==a[g];)p=this.model.getParent(p),g=mxCellPath.create(p);if(null==p){var v=c.length-1;r.setTerminalPoint(new mxPoint(c[v].x/t-n.x+l,c[v].y/t-n.y+d),!1),this.model.setTerminal(e[i],null,!1)}}this.model.setGeometry(e[i],r)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(e){return null},mxGraph.prototype.isPort=function(e){return!1},mxGraph.prototype.getTerminalForPort=function(e,t){return this.model.getParent(e)},mxGraph.prototype.getChildOffsetForCell=function(e){return null},mxGraph.prototype.enterGroup=function(e){null!=(e=e||this.getSelectionCell())&&this.isValidRoot(e)&&(this.view.setCurrentRoot(e),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var e=this.model.getRoot(),t=this.getCurrentRoot();if(null!=t){for(var n=this.model.getParent(t);n!=e&&!this.isValidRoot(n)&&this.model.getParent(n)!=e;)n=this.model.getParent(n);n==e||this.model.getParent(n)==e?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(t)&&this.setSelectionCell(t)}},mxGraph.prototype.home=function(){var e=this.getCurrentRoot();null!=e&&(this.view.setCurrentRoot(null),null!=this.view.getState(e)&&this.setSelectionCell(e))},mxGraph.prototype.isValidRoot=function(e){return null!=e},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(e,t,n){var a=[e];if(t&&(a=a.concat(this.model.getEdges(e))),a=this.view.getBounds(a),n){n=this.model.getChildCount(e);for(var i=0;i<n;i++){var s=this.getCellBounds(this.model.getChildAt(e,i),t,!0);null!=a?a.add(s):a=s}}return a},mxGraph.prototype.getBoundingBoxFromGeometry=function(e,t){t=null!=t&&t;var n=null;if(null!=e)for(var a=0;a<e.length;a++)if(t||this.model.isVertex(e[a])){var i=this.getCellGeometry(e[a]);if(null!=i){var s=i.points;if(null!=s&&0<s.length){for(var o=new mxRectangle(s[0].x,s[0].y,0,0),r=function(e){null!=e&&o.add(new mxRectangle(e.x,e.y,0,0))},l=1;l<s.length;l++)r(s[l]);r(i.getTerminalPoint(!0)),r(i.getTerminalPoint(!1))}null==n?n=new mxRectangle(i.x,i.y,i.width,i.height):n.add(i)}}return n},mxGraph.prototype.refresh=function(e){this.view.clear(e,null==e),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(e){return this.gridEnabled&&(e=Math.round(e/this.gridSize)*this.gridSize),e},mxGraph.prototype.panGraph=function(e,t){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-e,this.container.scrollTop=-t;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==e&&0==t){if(mxClient.IS_IE?n.setAttribute("transform","translate("+e+","+t+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var a=this.shiftPreview1.firstChild;null!=a;){var i=a.nextSibling;this.container.appendChild(a),a=i}for(this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),a=this.shiftPreview2.firstChild;null!=a;)i=a.nextSibling,this.container.appendChild(a),a=i;this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+e+","+t+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(a=this.container.firstChild;null!=a;)i=a.nextSibling,a!=n.parentNode?s.appendChild(a):s=this.shiftPreview2,a=i;this.container.insertBefore(this.shiftPreview1,n.parentNode),this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=e+"px",this.shiftPreview1.style.top=t+"px",this.shiftPreview2.style.left=e+"px",this.shiftPreview2.style.top=t+"px"}else n.style.left=e+"px",n.style.top=t+"px";this.panDx=e,this.panDy=t,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(e,t){this.zoom(e/this.view.scale,t)},mxGraph.prototype.zoom=function(e,t){t=null!=t?t:this.centerZoom;var n=this.view.scale*e,a=this.view.getState(this.getSelectionCell());if(this.keepSelectionVisibleOnZoom&&null!=a)a=new mxRectangle(a.x*e,a.y*e,a.width*e,a.height*e),this.view.scale=n,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(n));else if(t&&!mxUtils.hasScrollbars(this.container)){a=this.container.offsetWidth;var i=this.container.offsetHeight;if(1<e){var s=(e-1)/(2*n);a=a*-s,i=i*-s}else a*=s=(1/e-1)/(2*this.view.scale),i*=s;this.view.scaleAndTranslate(n,this.view.translate.x+a,this.view.translate.y+i)}else this.view.setScale(n),mxUtils.hasScrollbars(this.container)&&(i=a=0,t&&(a=this.container.offsetWidth*(e-1)/2,i=this.container.offsetHeight*(e-1)/2),this.container.scrollLeft=Math.round(this.container.scrollLeft*e+a),this.container.scrollTop=Math.round(this.container.scrollTop*e+i))},mxGraph.prototype.zoomToRect=function(e){var t=this.container.clientWidth/e.width/(this.container.clientHeight/e.height);e.x=Math.max(0,e.x),e.y=Math.max(0,e.y);var n=Math.min(this.container.scrollWidth,e.x+e.width),a=Math.min(this.container.scrollHeight,e.y+e.height);e.width=n-e.x,e.height=a-e.y,t<1?(n=((t=e.height/t)-e.height)/2,e.height=t,t=Math.min(e.y,n),e.y-=t,a=Math.min(this.container.scrollHeight,e.y+e.height),e.height=a-e.y):(n=((t*=e.width)-e.width)/2,e.width=t,t=Math.min(e.x,n),e.x-=t,n=Math.min(this.container.scrollWidth,e.x+e.width),e.width=n-e.x),t=this.container.clientWidth/e.width,n=this.view.scale*t,mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),this.container.scrollLeft=Math.round(e.x*t),this.container.scrollTop=Math.round(e.y*t)):this.view.scaleAndTranslate(n,this.view.translate.x-e.x/this.view.scale,this.view.translate.y-e.y/this.view.scale)},mxGraph.prototype.fit=function(e,t){if(null!=this.container){e=null!=e?e:0,t=null!=t&&t;var n=this.container.clientWidth,a=this.container.clientHeight,i=this.view.getGraphBounds();t&&null!=i.x&&null!=i.y&&(i.width+=i.x,i.height+=i.y,i.x=0,i.y=0);var s=this.view.scale,o=i.width/s,r=i.height/s;null!=this.backgroundImage&&(o=Math.max(o,this.backgroundImage.width-i.x/s),r=Math.max(r,this.backgroundImage.height-i.y/s));var l=t?e:2*e;n=Math.floor(100*Math.min(n/(o+l),a/(r+l)))/100;null!=this.minFitScale&&(n=Math.max(n,this.minFitScale)),null!=this.maxFitScale&&(n=Math.min(n,this.maxFitScale)),t?this.view.scale!=n&&this.view.setScale(n):mxUtils.hasScrollbars(this.container)?(this.view.setScale(n),null!=i.x&&(this.container.scrollLeft=Math.round(i.x/s)*n-e-Math.max(0,(this.container.clientWidth-o*n)/2)),null!=i.y&&(this.container.scrollTop=Math.round(i.y/s)*n-e-Math.max(0,(this.container.clientHeight-r*n)/2))):this.view.scaleAndTranslate(n,null!=i.x?Math.floor(this.view.translate.x-i.x/s+e+1):e,null!=i.y?Math.floor(this.view.translate.y-i.y/s+e+1):e)}return this.view.scale},mxGraph.prototype.scrollCellToVisible=function(e,t){var n=-this.view.translate.x,a=-this.view.translate.y,i=this.view.getState(e);null!=i&&(n=new mxRectangle(n+i.x,a+i.y,i.width,i.height),t&&null!=this.container&&(a=this.container.clientWidth,i=this.container.clientHeight,n.x=n.getCenterX()-a/2,n.width=a,n.y=n.getCenterY()-i/2,n.height=i),this.scrollRectToVisible(n)&&this.view.setTranslate(this.view.translate.x,this.view.translate.y))},mxGraph.prototype.scrollRectToVisible=function(e){var t=!1;if(null!=e){var n=this.container.offsetWidth,a=this.container.offsetHeight,i=Math.min(n,e.width),s=Math.min(a,e.height);if(mxUtils.hasScrollbars(this.container)){n=this.container,e.x+=this.view.translate.x,e.y+=this.view.translate.y;var o=n.scrollLeft-e.x;a=Math.max(o-n.scrollLeft,0);0<o?n.scrollLeft-=o+2:0<(o=e.x+i-n.scrollLeft-n.clientWidth)&&(n.scrollLeft+=o+2),i=n.scrollTop-e.y,o=Math.max(0,i-n.scrollTop),0<i?n.scrollTop-=i+2:0<(i=e.y+s-n.scrollTop-n.clientHeight)&&(n.scrollTop+=i+2),!this.useScrollbarsForPanning&&(0!=a||0!=o)&&this.view.setTranslate(a,o)}else{o=-this.view.translate.x;var r=-this.view.translate.y,l=this.view.scale;e.x+i>o+n&&(this.view.translate.x-=(e.x+i-n-o)/l,t=!0),e.y+s>r+a&&(this.view.translate.y-=(e.y+s-a-r)/l,t=!0),e.x<o&&(this.view.translate.x+=(o-e.x)/l,t=!0),e.y<r&&(this.view.translate.y+=(r-e.y)/l,t=!0),t&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return t},mxGraph.prototype.getCellGeometry=function(e){return this.model.getGeometry(e)},mxGraph.prototype.isCellVisible=function(e){return this.model.isVisible(e)},mxGraph.prototype.isCellCollapsed=function(e){return this.model.isCollapsed(e)},mxGraph.prototype.isCellConnectable=function(e){return this.model.isConnectable(e)},mxGraph.prototype.isOrthogonal=function(e){var t=e.style[mxConstants.STYLE_ORTHOGONAL];return null!=t?t:(e=this.view.getEdgeStyle(e))==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom||e==mxEdgeStyle.EntityRelation||e==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(e){var t=e.getVisibleTerminalState(!0);return e=e.getVisibleTerminalState(!1),null!=t&&t==e},mxGraph.prototype.isCloneEvent=function(e){return mxEvent.isControlDown(e)},mxGraph.prototype.isToggleEvent=function(e){return mxClient.IS_MAC?mxEvent.isMetaDown(e):mxEvent.isControlDown(e)},mxGraph.prototype.isGridEnabledEvent=function(e){return null!=e&&!mxEvent.isAltDown(e)},mxGraph.prototype.isConstrainedEvent=function(e){return mxEvent.isShiftDown(e)},mxGraph.prototype.isForceMarqueeEvent=function(e){return mxEvent.isAltDown(e)},mxGraph.prototype.validationAlert=function(e){mxUtils.alert(e)},mxGraph.prototype.isEdgeValid=function(e,t,n){return null==this.getEdgeValidationError(e,t,n)},mxGraph.prototype.getEdgeValidationError=function(e,t,n){if(null!=e&&!this.isAllowDanglingEdges()&&(null==t||null==n))return"";if(null!=e&&null==this.model.getTerminal(e,!0)&&null==this.model.getTerminal(e,!1))return null;if(!this.allowLoops&&t==n&&null!=t||!this.isValidConnection(t,n))return"";if(null==t||null==n)return this.allowDanglingEdges?null:"";var a="";this.multigraph||(1<(i=this.model.getEdgesBetween(t,n,!0)).length||1==i.length&&i[0]!=e)&&(a+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var i=this.model.getDirectedEdgeCount(t,!0,e),s=this.model.getDirectedEdgeCount(n,!1,e);if(null!=this.multiplicities)for(var o=0;o<this.multiplicities.length;o++){var r=this.multiplicities[o].check(this,e,t,n,i,s);null!=r&&(a+=r)}return null!=(r=this.validateEdge(e,t,n))&&(a+=r),0<a.length?a:null},mxGraph.prototype.validateEdge=function(e,t,n){return null},mxGraph.prototype.validateGraph=function(e,t){e=null!=e?e:this.model.getRoot(),t=null!=t?t:{};for(var n=!0,a=this.model.getChildCount(e),i=0;i<a;i++){var s=this.model.getChildAt(e,i),o=t;this.isValidRoot(s)&&(o={}),null!=(o=this.validateGraph(s,o))?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),n=n&&null==o}return a="",this.isCellCollapsed(e)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),a=this.model.isEdge(e)?a+(this.getEdgeValidationError(e,this.model.getTerminal(e,!0),this.model.getTerminal(e,!1))||""):a+(this.getCellValidationError(e)||""),null!=(i=this.validateCell(e,t))&&(a+=i),null==this.model.getParent(e)&&this.view.validate(),0<a.length||!n?a:null},mxGraph.prototype.getCellValidationError=function(e){var t=this.model.getDirectedEdgeCount(e,!0),n=this.model.getDirectedEdgeCount(e,!1);e=this.model.getValue(e);var a="";if(null!=this.multiplicities)for(var i=0;i<this.multiplicities.length;i++){var s=this.multiplicities[i];s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<t||1==s.min&&0==t||1==s.max&&1<t)?a+=s.countError+"\n":!s.source&&mxUtils.isNode(e,s.type,s.attr,s.value)&&(0==s.max&&0<n||1==s.min&&0==n||1==s.max&&1<n)&&(a+=s.countError+"\n")}return 0<a.length?a:null},mxGraph.prototype.validateCell=function(e,t){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(e){this.backgroundImage=e},mxGraph.prototype.getFoldingImage=function(e){if(null!=e&&this.foldingEnabled&&!this.getModel().isEdge(e.cell)){var t=this.isCellCollapsed(e.cell);if(this.isCellFoldable(e.cell,!t))return t?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(e){if(null!=(e=this.model.getValue(e))){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(e){var t="";if(this.labelsVisible&&null!=e){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(t=this.convertValueToString(e))}return t},mxGraph.prototype.isHtmlLabel=function(e){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(e){this.htmlLabels=e},mxGraph.prototype.isWrapping=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"wrap"==e[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(e){var t=this.view.getState(e);return null!=(e=null!=t?t.style:this.getCellStyle(e))&&"hidden"==e[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(e,n,t,a){var i=null;return null!=e&&(null==e.control||n!=e.control.node&&n.parentNode!=e.control.node||(i=this.collapseExpandResource,i=mxResources.get(i)||i),null==i&&null!=e.overlays&&e.overlays.visit(function(e,t){null!=i||n!=t.node&&n.parentNode!=t.node||(i=t.overlay.toString())}),null==i&&(null!=(t=this.selectionCellsHandler.getHandler(e.cell))&&"function"==typeof t.getTooltipForNode&&(i=t.getTooltipForNode(n))),null==i&&(i=this.getTooltipForCell(e.cell))),i},mxGraph.prototype.getTooltipForCell=function(e){return null!=e&&null!=e.getTooltip?e.getTooltip():this.convertValueToString(e)},mxGraph.prototype.getCursorForCell=function(e){return null},mxGraph.prototype.getStartSize=function(e){var t=new mxRectangle,n=this.view.getState(e);return null!=(e=null!=n?n.style:this.getCellStyle(e))&&(n=parseInt(mxUtils.getValue(e,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,!0)?t.height=n:t.width=n),t},mxGraph.prototype.getImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(e){return null!=e&&null!=e.style?e.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(e){this.border=e},mxGraph.prototype.isSwimlane=function(e){var t;if(null!=e&&this.model.getParent(e)!=this.model.getRoot()&&(null!=(t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e))&&!this.model.isEdge(e)))return t[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE;return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(e){this.resizeContainer=e},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(e){this.enabled=e},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(e){this.escapeEnabled=e},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(e){this.invokesStopCellEditing=e},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(e){this.enterStopsCellEditing=e},mxGraph.prototype.isCellLocked=function(e){var t=this.model.getGeometry(e);return this.isCellsLocked()||null!=t&&this.model.isVertex(e)&&t.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(e){this.cellsLocked=e},mxGraph.prototype.getCloneableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(e){this.cellsCloneable=e},mxGraph.prototype.getExportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(e){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},mxGraph.prototype.canImportCell=function(e){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(e){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(e){this.cellsSelectable=e},mxGraph.prototype.getDeletableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(e){this.cellsDeletable=e},mxGraph.prototype.isLabelMovable=function(e){return!this.isCellLocked(e)&&(this.model.isEdge(e)&&this.edgeLabelsMovable||this.model.isVertex(e)&&this.vertexLabelsMovable)},mxGraph.prototype.getMovableCells=function(e){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsMovable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(e){this.cellsMovable=e},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(e){this.gridEnabled=e},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(e){this.portsEnabled=e},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(e){this.gridSize=e},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(e){this.tolerance=e},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(e){this.vertexLabelsMovable=e},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(e){this.edgeLabelsMovable=e},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(e){this.swimlaneNesting=e},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(e){this.swimlaneSelectionEnabled=e},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(e){this.multigraph=e},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(e){this.allowDanglingEdges=e},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(e){this.connectableEdges=e},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(e){this.cloneInvalidEdges=e},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(e){this.allowLoops=e},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(e){this.disconnectOnMove=e},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(e){this.dropEnabled=e},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(e){this.splitEnabled=e},mxGraph.prototype.isCellResizable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsResizable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_RESIZABLE]},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(e){this.cellsResizable=e},mxGraph.prototype.isTerminalPointMovable=function(e,t){return!0},mxGraph.prototype.isCellBendable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsBendable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(e){this.cellsBendable=e},mxGraph.prototype.isCellEditable=function(e){var t=null!=(t=this.view.getState(e))?t.style:this.getCellStyle(e);return this.isCellsEditable()&&!this.isCellLocked(e)&&0!=t[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(e){this.cellsEditable=e},mxGraph.prototype.isCellDisconnectable=function(e,t,n){return this.isCellsDisconnectable()&&!this.isCellLocked(e)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(e){this.cellsDisconnectable=e},mxGraph.prototype.isValidSource=function(e){return null==e&&this.allowDanglingEdges||null!=e&&(!this.model.isEdge(e)||this.connectableEdges)&&this.isCellConnectable(e)},mxGraph.prototype.isValidTarget=function(e){return this.isValidSource(e)},mxGraph.prototype.isValidConnection=function(e,t){return this.isValidSource(e)&&this.isValidTarget(t)},mxGraph.prototype.setConnectable=function(e){this.connectionHandler.setEnabled(e)},mxGraph.prototype.isConnectable=function(e){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(e){this.tooltipHandler.setEnabled(e)},mxGraph.prototype.setPanning=function(e){this.panningHandler.panningEnabled=e},mxGraph.prototype.isEditing=function(e){if(null==this.cellEditor)return!1;var t=this.cellEditor.getEditingCell();return null==e?null!=t:e==t},mxGraph.prototype.isAutoSizeCell=function(e){var t=this.view.getState(e);return e=null!=t?t.style:this.getCellStyle(e),this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(e){this.autoSizeCells=e},mxGraph.prototype.isExtendParent=function(e){return!this.getModel().isEdge(e)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(e){this.extendParents=e},mxGraph.prototype.isExtendParentsOnAdd=function(){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(e){this.extendParentsOnAdd=e},mxGraph.prototype.isConstrainChild=function(e){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(e))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(e){this.constrainChildren=e},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(e){this.allowNegativeCoordinates=e},mxGraph.prototype.getOverlap=function(e){return this.isAllowOverlapParent(e)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(e){return!1},mxGraph.prototype.getFoldableCells=function(e,t){return this.model.filterCells(e,mxUtils.bind(this,function(e){return this.isCellFoldable(e,t)}))},mxGraph.prototype.isCellFoldable=function(e,t){var n=null!=(n=this.view.getState(e))?n.style:this.getCellStyle(e);return 0<this.model.getChildCount(e)&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(e,t,n){return null!=e&&(this.isSplitEnabled()&&this.isSplitTarget(e,t,n)||!this.model.isEdge(e)&&(this.isSwimlane(e)||0<this.model.getChildCount(e)&&!this.isCellCollapsed(e)))},mxGraph.prototype.isSplitTarget=function(e,t,n){return!(!this.model.isEdge(e)||null==t||1!=t.length||!this.isCellConnectable(t[0])||null!=this.getEdgeValidationError(e,this.model.getTerminal(e,!0),t[0]))&&(n=this.model.getTerminal(e,!0),e=this.model.getTerminal(e,!1),!this.model.isAncestor(t[0],n)&&!this.model.isAncestor(t[0],e))},mxGraph.prototype.getDropTarget=function(e,t,n){if(!this.isSwimlaneNesting())for(var a=0;a<e.length;a++)if(this.isSwimlane(e[a]))return null;if((a=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t))).x-=this.panDx,a.y-=this.panDy,a=this.getSwimlaneAt(a.x,a.y),null==n)n=a;else if(null!=a){for(var i=this.model.getParent(a);null!=i&&this.isSwimlane(i)&&i!=n;)i=this.model.getParent(i);i==n&&(n=a)}for(;null!=n&&!this.isValidDropTarget(n,e,t)&&!this.model.isLayer(n);)n=this.model.getParent(n);return!this.model.isLayer(n)&&mxUtils.indexOf(e,n)<0?n:null},mxGraph.prototype.getDefaultParent=function(){var e=this.defaultParent;return null==e&&(null==(e=this.getCurrentRoot())&&(e=this.model.getRoot(),e=this.model.getChildAt(e,0))),e},mxGraph.prototype.setDefaultParent=function(e){this.defaultParent=e},mxGraph.prototype.getSwimlane=function(e){for(;null!=e&&!this.isSwimlane(e);)e=this.model.getParent(e);return e},mxGraph.prototype.getSwimlaneAt=function(e,t,n){if(null!=(n=n||this.getDefaultParent()))for(var a=this.model.getChildCount(n),i=0;i<a;i++){var s=this.model.getChildAt(n,i),o=this.getSwimlaneAt(e,t,s);if(null!=o)return o;if(this.isSwimlane(s)&&(o=this.view.getState(s),this.intersects(o,e,t)))return s}return null},mxGraph.prototype.getCellAt=function(e,t,n,a,i){if(a=null==a||a,i=null==i||i,null!=(n=null!=n?n:this.getDefaultParent()))for(var s=this.model.getChildCount(n)-1;0<=s;s--){var o=this.model.getChildAt(n,s),r=this.getCellAt(e,t,o,a,i);if(null!=r)return r;if(this.isCellVisible(o)&&(i&&this.model.isEdge(o)||a&&this.model.isVertex(o))&&(r=this.view.getState(o),this.intersects(r,e,t)))return o}return null},mxGraph.prototype.intersects=function(e,t,n){if(null!=e){var a=e.absolutePoints;if(null!=a){e=this.tolerance*this.tolerance;for(var i=a[0],s=1;s<a.length;s++){var o=a[s];if(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,t,n)<=e)return!0;i=o}}else if(0!=(i=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(a=Math.cos(-i),i=Math.sin(-i),s=new mxPoint(e.getCenterX(),e.getCenterY()),t=(i=mxUtils.getRotatedPoint(new mxPoint(t,n),a,i,s)).x,n=i.y),mxUtils.contains(e,t,n))return!0}return!1},mxGraph.prototype.hitsSwimlaneContent=function(e,t,n){var a=this.getView().getState(e);if(e=this.getStartSize(e),null!=a){var i=this.getView().getScale();if(t-=a.x,n-=a.y,0<e.width&&0<t&&t>e.width*i||0<e.height&&0<n&&n>e.height*i)return!0}return!1},mxGraph.prototype.getChildVertices=function(e){return this.getChildCells(e,!0,!1)},mxGraph.prototype.getChildEdges=function(e){return this.getChildCells(e,!1,!0)},mxGraph.prototype.getChildCells=function(e,t,n){for(e=null!=e?e:this.getDefaultParent(),e=this.model.getChildCells(e,null!=t&&t,null!=n&&n),t=[],n=0;n<e.length;n++)this.isCellVisible(e[n])&&t.push(e[n]);return t},mxGraph.prototype.getConnections=function(e,t){return this.getEdges(e,t,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(e,t){return this.getEdges(e,t,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(e,t){return this.getEdges(e,t,!1,!0,!1)},mxGraph.prototype.getEdges=function(e,t,n,a,i,s){n=null==n||n,a=null==a||a,i=null==i||i,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(e),l=this.model.getChildCount(e),d=0;d<l;d++){var c=this.model.getChildAt(e,d);!r&&this.isCellVisible(c)||(o=o.concat(this.model.getEdges(c,n,a)))}for(o=o.concat(this.model.getEdges(e,n,a)),r=[],d=0;d<o.length;d++)l=null!=(c=this.view.getState(o[d]))?c.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[d],!0),c=null!=c?c.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[d],!1),(i&&l==c||l!=c&&(n&&c==e&&(null==t||this.isValidAncestor(l,t,s))||a&&l==e&&(null==t||this.isValidAncestor(c,t,s))))&&r.push(o[d]);return r},mxGraph.prototype.isValidAncestor=function(e,t,n){return n?this.model.isAncestor(t,e):this.model.getParent(e)==t},mxGraph.prototype.getOpposites=function(e,t,n,a){n=null==n||n,a=null==a||a;var i=[],s={};if(null!=e)for(var o=0;o<e.length;o++){var r=null!=(l=this.view.getState(e[o]))?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(e[o],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(e[o],!1);if(r==t&&null!=l&&l!=t&&a){var d=mxCellPath.create(l);null==s[d]&&(s[d]=l,i.push(l))}else l==t&&null!=r&&r!=t&&n&&(null==s[d=mxCellPath.create(r)]&&(s[d]=r,i.push(r)))}return i},mxGraph.prototype.getEdgesBetween=function(e,t,n){n=null!=n&&n;for(var a=this.getEdges(e),i=[],s=0;s<a.length;s++){var o=null!=(r=this.view.getState(a[s]))?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[s],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[s],!1);(o==e&&r==t||!n&&o==t&&r==e)&&i.push(a[s])}return i},mxGraph.prototype.getPointForEvent=function(e,t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a=this.view.scale,i=this.view.translate,s=0!=t?this.gridSize/2:0;return n.x=this.snap(n.x/a-i.x-s),n.y=this.snap(n.y/a-i.y-s),n},mxGraph.prototype.getCells=function(e,t,n,a,i,s){if(s=null!=s?s:[],0<n||0<a){var o=e+n,r=t+a;if(null!=(i=i||this.getDefaultParent()))for(var l=this.model.getChildCount(i),d=0;d<l;d++){var c=this.model.getChildAt(i,d),m=this.view.getState(c);if(this.isCellVisible(c)&&null!=m){var u=m;0!=(m=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION)||0)&&(u=mxUtils.getBoundingBox(u,m)),u.x>=e&&u.y+u.height<=r&&u.y>=t&&u.x+u.width<=o?s.push(c):this.getCells(e,t,n,a,c,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(e,t,n,a,i){var s=[];if((a||i)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),r=0;r<o;r++){var l=this.model.getChildAt(n,r),d=this.view.getState(l);this.isCellVisible(l)&&null!=d&&(!a||d.x>=e)&&(!i||d.y>=t)&&s.push(l)}return s},mxGraph.prototype.findTreeRoots=function(e,t,n){t=null!=t&&t,n=null!=n&&n;var a=[];if(null!=e){for(var i=this.getModel(),s=i.getChildCount(e),o=null,r=0,l=0;l<s;l++){var d=i.getChildAt(e,l);if(this.model.isVertex(d)&&this.isCellVisible(d)){for(var c=this.getConnections(d,t?e:null),m=0,u=0,p=0;p<c.length;p++)this.view.getVisibleTerminal(c[p],!0)==d?m++:u++;(n&&0==m&&0<u||!n&&0==u&&0<m)&&a.push(d),r<(c=n?u-m:m-u)&&(r=c,o=d)}}0==a.length&&null!=o&&a.push(o)}return a},mxGraph.prototype.traverse=function(e,t,n,a,i){if(null!=n&&null!=e){t=null==t||t,i=i||[];var s=mxCellPath.create(e);if(null==i[s]&&(null==(a=n(i[s]=e,a))||a)&&0<(a=this.model.getEdgeCount(e)))for(s=0;s<a;s++){var o=this.model.getEdgeAt(e,s),r=this.model.getTerminal(o,!0)==e;t&&!r||(r=this.model.getTerminal(o,!r),this.traverse(r,t,n,o,i))}}},mxGraph.prototype.isCellSelected=function(e){return this.getSelectionModel().isSelected(e)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(e){this.getSelectionModel().setCell(e)},mxGraph.prototype.setSelectionCells=function(e){this.getSelectionModel().setCells(e)},mxGraph.prototype.addSelectionCell=function(e){this.getSelectionModel().addCell(e)},mxGraph.prototype.addSelectionCells=function(e){this.getSelectionModel().addCells(e)},mxGraph.prototype.removeSelectionCell=function(e){this.getSelectionModel().removeCell(e)},mxGraph.prototype.removeSelectionCells=function(e){this.getSelectionModel().removeCells(e)},mxGraph.prototype.selectRegion=function(e,t){var n=this.getCells(e.x,e.y,e.width,e.height);return this.selectCellsForEvent(n,t),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(e,t,n){var a=0<(i=this.selectionModel).cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var i=null!=a?this.model.getParent(a):this.getDefaultParent(),s=this.model.getChildCount(i);null==a&&0<s?(e=this.model.getChildAt(i,0),this.setSelectionCell(e)):null!=a&&!t||null==this.view.getState(i)||null==this.model.getGeometry(i)?null!=a&&n?0<this.model.getChildCount(a)&&(e=this.model.getChildAt(a,0),this.setSelectionCell(e)):0<s&&(t=i.getIndex(a),e=e?(t++,this.model.getChildAt(i,t%s)):(t--,this.model.getChildAt(i,t<0?s-1:t)),this.setSelectionCell(e)):this.getCurrentRoot()!=i&&this.setSelectionCell(i)},mxGraph.prototype.selectAll=function(e){e=e||this.getDefaultParent(),null!=(e=this.model.getChildren(e))&&this.setSelectionCells(e)},mxGraph.prototype.selectVertices=function(e){this.selectCells(!0,!1,e)},mxGraph.prototype.selectEdges=function(e){this.selectCells(!1,!0,e)},mxGraph.prototype.selectCells=function(t,n,e){e=e||this.getDefaultParent();var a=mxUtils.bind(this,function(e){return null!=this.view.getState(e)&&0==this.model.getChildCount(e)&&(this.model.isVertex(e)&&t||this.model.isEdge(e)&&n)});e=this.model.filterDescendants(a,e),this.setSelectionCells(e)},mxGraph.prototype.selectCellForEvent=function(e,t){var n=this.isCellSelected(e);this.isToggleEvent(t)?n?this.removeSelectionCell(e):this.addSelectionCell(e):(!n||1!=this.getSelectionCount())&&this.setSelectionCell(e)},mxGraph.prototype.selectCellsForEvent=function(e,t){this.isToggleEvent(t)?this.addSelectionCells(e):this.setSelectionCells(e)},mxGraph.prototype.createHandler=function(e){var t=null;return null!=e&&(t=this.model.isEdge(e.cell)?(t=this.view.getEdgeStyle(e),this.isLoop(e)||t==mxEdgeStyle.ElbowConnector||t==mxEdgeStyle.SideToSide||t==mxEdgeStyle.TopToBottom?new mxElbowEdgeHandler(e):t==mxEdgeStyle.SegmentConnector||t==mxEdgeStyle.OrthConnector?new mxEdgeSegmentHandler(e):new mxEdgeHandler(e)):new mxVertexHandler(e)),t},mxGraph.prototype.addMouseListener=function(e){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(e)},mxGraph.prototype.removeMouseListener=function(e){if(null!=this.mouseListeners)for(var t=0;t<this.mouseListeners.length;t++)if(this.mouseListeners[t]==e){this.mouseListeners.splice(t,1);break}},mxGraph.prototype.updateMouseEvent=function(e){if(null==e.graphX||null==e.graphY){var t=mxUtils.convertPoint(this.container,e.getX(),e.getY());e.graphX=t.x-this.panDx,e.graphY=t.y-this.panDy}},mxGraph.prototype.fireMouseEvent=function(e,t,n){if(null==n&&(n=this),this.updateMouseEvent(t),e==mxEvent.MOUSE_DOWN&&(this.isMouseDown=!0),mxClient.IS_TOUCH&&this.doubleTapEnabled&&e==mxEvent.MOUSE_DOWN){var a=(new Date).getTime();a-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-t.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-t.getY())<this.doubleTapTolerance?(this.lastTouchTime=0,this.dblClick(t.getEvent(),t.getCell()),t.getEvent().cancelBubble=!0):(this.lastTouchX=t.getX(),this.lastTouchY=t.getY(),this.lastTouchTime=a)}if(a=2!=t.getEvent().detail,mxClient.IS_IE&&"CSS1Compat"==document.compatMode&&((null!=this.lastMouseX&&Math.abs(this.lastMouseX-t.getX())>this.doubleTapTolerance||null!=this.lastMouseY&&Math.abs(this.lastMouseY-t.getY())>this.doubleTapTolerance)&&(a=!0),e==mxEvent.MOUSE_UP&&(this.lastMouseX=t.getX(),this.lastMouseY=t.getY())),(e!=mxEvent.MOUSE_UP||this.isMouseDown)&&a){if(e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1),!this.isEditing()&&(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE&&mxClient.IS_SVG||t.getEvent().target!=this.container)){if(e==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&this.scrollPointToVisible(t.getGraphX(),t.getGraphY(),this.autoExtend),null!=this.mouseListeners)for(n=[n,t],t.getEvent().returnValue=!0,a=0;a<this.mouseListeners.length;a++){var i=this.mouseListeners[a];e==mxEvent.MOUSE_DOWN?i.mouseDown.apply(i,n):e==mxEvent.MOUSE_MOVE?i.mouseMove.apply(i,n):e==mxEvent.MOUSE_UP&&i.mouseUp.apply(i,n)}e==mxEvent.MOUSE_UP&&this.click(t)}}else e==mxEvent.MOUSE_UP&&(this.isMouseDown=!1)},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(e){var t=e.view.graph.getModel().isEdge(e.cell),n=e.view.scale,a=null,i=this.image.width,s=this.image.height;return t?a=1==(t=e.absolutePoints).length%2?t[Math.floor(t.length/2)]:(e=t[(a=t.length/2)-1],t=t[a],new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2)):((a=new mxPoint).x=this.align==mxConstants.ALIGN_LEFT?e.x:this.align==mxConstants.ALIGN_CENTER?e.x+e.width/2:e.x+e.width,a.y=this.verticalAlign==mxConstants.ALIGN_TOP?e.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?e.y+e.height/2:e.y+e.height),new mxRectangle(Math.round(a.x-(i*this.defaultOverlap-this.offset.x)*n),Math.round(a.y-(s*this.defaultOverlap-this.offset.y)*n),i*n,s*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.suspended=!1,mxOutline.prototype.init=function(e){this.outline=new mxGraph(e,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet()),this.outline.foldingEnabled=!1,this.outline.autoScroll=!1;var t=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(e){!this.suspended&&null!=this.outline&&t.apply(this.outline,arguments)}),mxClient.IS_SVG&&((e=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),e.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=!1,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(e,t){!this.suspended&&!this.active&&this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this),(e=this.source.getView()).addListener(mxEvent.SCALE,this.updateHandler),e.addListener(mxEvent.TRANSLATE,this.updateHandler),e.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),e.addListener(mxEvent.DOWN,this.updateHandler),e.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(e){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(e){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.init(this.outline.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.outline),this.selectionBorder.node.style.background="",this.sizer=this.createSizer(),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="pointer"),mxEvent.addListener(this.sizer.node,mxClient.IS_TOUCH?"touchstart":"mousedown",mxUtils.bind(this,function(e){this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))})),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(e){this.enabled=e},mxOutline.prototype.setZoomEnabled=function(e){this.sizer.node.style.visibility=e?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){var e=null!=this.sizerImage?new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src):new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);return e.dialect=this.outline.dialect,e},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(e){return null},mxOutline.prototype.update=function(e){if(null!=this.source){var t=this.source.view.scale,n=new mxRectangle((n=this.source.getGraphBounds()).x/t+this.source.panDx,n.y/t+this.source.panDy,n.width/t,n.height/t),a=new mxRectangle(0,0,this.source.container.clientWidth/t,this.source.container.clientHeight/t);(s=n.clone()).add(a);var i=this.getSourceContainerSize(),s=(a=Math.max(i.width/t,s.width),t=Math.max(i.height/t,s.height),Math.max(0,this.outline.container.clientWidth-this.border));i=Math.max(0,this.outline.container.clientHeight-this.border);if(0<(s=Math.min(s/a,i/t))){this.outline.getView().scale!=s&&(this.outline.getView().scale=s,e=!0),(a=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&a.setCurrentRoot(this.source.getView().currentRoot);i=(t=this.source.view.translate).x+this.source.panDx;var o=t.y+this.source.panDy;null!=(s=this.getOutlineOffset(s))&&(i+=s.x,o+=s.y),n.x<0&&(i-=n.x),n.y<0&&(o-=n.y),a.translate.x==i&&a.translate.y==o||(a.translate.x=i,a.translate.y=o,e=!0);n=a.translate,i=(s=this.source.getView().scale)/a.scale,o=1/a.scale;var r=this.source.container;this.bounds=new mxRectangle((n.x-t.x-this.source.panDx)/o,(n.y-t.y-this.source.panDy)/o,r.clientWidth/i,r.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*a.scale/s,this.bounds.y+=this.source.container.scrollTop*a.scale/s,(n=this.selectionBorder.bounds).x==this.bounds.x&&n.y==this.bounds.y&&n.width==this.bounds.width&&n.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),n=this.sizer.bounds,a=new mxRectangle(this.bounds.x+this.bounds.width-n.width/2,this.bounds.y+this.bounds.height-n.height/2,n.width,n.height),n.x==a.x&&n.y==a.y&&n.width==a.width&&n.height==a.height||(this.sizer.bounds=a,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),e&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(e,t){this.enabled&&this.showViewport&&(this.zoom=t.isSource(this.sizer),this.startX=t.getX(),this.startY=t.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):this.dy0=this.dx0=0),t.consume()},mxOutline.prototype.mouseMove=function(e,t){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=t.getX()-this.startX,a=t.getY()-this.startY,i=null;if(this.zoom)a=n/((i=this.source.container).clientWidth/i.clientHeight),i=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+a)),this.selectionBorder.bounds=i,this.selectionBorder.redraw();else{var s=this.outline.getView().scale;i=new mxRectangle(this.bounds.x+n,this.bounds.y+a,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=i,this.selectionBorder.redraw(),n=n/s*this.source.getView().scale,a=a/s*this.source.getView().scale,this.source.panGraph(-n-this.dx0,-a-this.dy0)}n=this.sizer.bounds,this.sizer.bounds=new mxRectangle(i.x+i.width-n.width/2,i.y+i.height-n.height/2,n.width,n.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),t.consume()}},mxOutline.prototype.mouseUp=function(e,t){if(this.active){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(0<Math.abs(n)||0<Math.abs(a)){if(this.zoom){a=this.selectionBorder.bounds.width;var i=this.source.getView().scale;this.source.zoomTo(i-n*i/a,!1)}else this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),n/=this.outline.getView().scale,a/=this.outline.getView().scale,i=this.source.getView().translate,this.source.getView().setTranslate(i.x-n,i.y-a));this.update(),t.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(e,t,n,a,i,s){var o="";return(this.source&&this.checkTerminal(e,n,t)||!this.source&&this.checkTerminal(e,a,t))&&(null!=this.countError&&(this.source&&(0==this.max||i>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(e,t,n,a)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(e,t,n,a){t=e.model.getValue(n),a=e.model.getValue(a),n=!this.validNeighborsAllowed;for(var i=this.validNeighbors,s=0;s<i.length;s++){if(this.source&&this.checkType(e,a,i[s])){n=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(e,t,i[s])){n=this.validNeighborsAllowed;break}}return n},mxMultiplicity.prototype.checkTerminal=function(e,t,n){return t=e.model.getValue(t),this.checkType(e,t,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(e,t,n,a,i){return null!=t&&(isNaN(t.nodeType)?t==n:mxUtils.isNode(t,n,a,i))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(e){this.enabled=e},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(e){this.bubbling=e},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(e){if(null!=this.graph){var t=this.graph.getModel();t.removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler)}this.graph=e,null!=this.graph&&((t=this.graph.getModel()).addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(e){return null},mxLayoutManager.prototype.beforeUndo=function(e){e=this.getCellsForChanges(e.changes);var t=this.getGraph().getModel();if(this.isBubbling())for(var n=t.getParents(e);0<n.length;)e=e.concat(n),n=t.getParents(n);this.layoutCells(mxUtils.sortCells(e,!1))},mxLayoutManager.prototype.cellsMoved=function(e,t){if(null!=e&&null!=t)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.getGraph().getModel(),i=0;i<e.length;i++){var s=this.getLayout(a.getParent(e[i]));null!=s&&s.moveCell(e[i],n.x,n.y)}},mxLayoutManager.prototype.getCellsForChanges=function(e){for(var t=[],n={},a=0;a<e.length;a++){if((i=e[a])instanceof mxRootChange)return[];for(var i=this.getCellsForChange(i),s=0;s<i.length;s++)if(null!=i[s]){var o=mxCellPath.create(i[s]);null==n[o]&&(n[o]=i[s],t.push(i[s]))}}return t},mxLayoutManager.prototype.getCellsForChange=function(e){var t=this.getGraph().getModel();return e instanceof mxChildChange?[e.child,e.previous,t.getParent(e.child)]:e instanceof mxTerminalChange||e instanceof mxGeometryChange?[e.cell,t.getParent(e.cell)]:[]},mxLayoutManager.prototype.layoutCells=function(e){if(0<e.length){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=null,a=0;a<e.length;a++)e[a]!=t.getRoot()&&e[a]!=n&&(n=e[a],this.executeLayout(this.getLayout(n),n));this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",e))}finally{t.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(e,t){null!=e&&null!=t&&e.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSpaceManager.prototype=new mxEventSource,mxSpaceManager.prototype.constructor=mxSpaceManager,mxSpaceManager.prototype.graph=null,mxSpaceManager.prototype.enabled=!0,mxSpaceManager.prototype.shiftRightwards=!0,mxSpaceManager.prototype.shiftDownwards=!0,mxSpaceManager.prototype.extendParents=!0,mxSpaceManager.prototype.resizeHandler=null,mxSpaceManager.prototype.foldHandler=null,mxSpaceManager.prototype.isCellIgnored=function(e){return!this.getGraph().getModel().isVertex(e)},mxSpaceManager.prototype.isCellShiftable=function(e){return this.getGraph().getModel().isVertex(e)&&this.getGraph().isCellMovable(e)},mxSpaceManager.prototype.isEnabled=function(){return this.enabled},mxSpaceManager.prototype.setEnabled=function(e){this.enabled=e},mxSpaceManager.prototype.isShiftRightwards=function(){return this.shiftRightwards},mxSpaceManager.prototype.setShiftRightwards=function(e){this.shiftRightwards=e},mxSpaceManager.prototype.isShiftDownwards=function(){return this.shiftDownwards},mxSpaceManager.prototype.setShiftDownwards=function(e){this.shiftDownwards=e},mxSpaceManager.prototype.isExtendParents=function(){return this.extendParents},mxSpaceManager.prototype.setExtendParents=function(e){this.extendParents=e},mxSpaceManager.prototype.getGraph=function(){return this.graph},mxSpaceManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.resizeHandler),this.graph.removeListener(this.foldHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler),this.graph.addListener(mxEvent.FOLD_CELLS,this.foldHandler))},mxSpaceManager.prototype.cellsResized=function(e){if(null!=e){var t=this.graph.getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isCellIgnored(e[n])){this.cellResized(e[n]);break}}finally{t.endUpdate()}}},mxSpaceManager.prototype.cellResized=function(e){var t=this.getGraph(),n=t.getView(),a=t.getModel(),i=n.getState(e),s=n.getState(a.getParent(e));if(null!=i&&null!=s){var o=this.getCellsToShift(i),r=a.getGeometry(e);if(null!=o&&null!=r){var l=n.translate,d=n.scale,c=(n=i.x-s.origin.x-l.x*d,s=i.y-s.origin.y-l.y*d,l=i.x+i.width,i.y+i.height),m=i.width-r.width*d+n-r.x*d,u=i.height-r.height*d+s-r.y*d,p=1-r.width*d/i.width;i=1-r.height*d/i.height;a.beginUpdate();try{for(r=0;r<o.length;r++)o[r]!=e&&this.isCellShiftable(o[r])&&this.shiftCell(o[r],m,u,n,s,l,c,p,i,this.isExtendParents()&&t.isExtendParent(o[r]))}finally{a.endUpdate()}}}},mxSpaceManager.prototype.shiftCell=function(e,t,n,a,i,s,o,r,l,d){var c=(a=this.getGraph()).getView().getState(e);if(null!=c){var m=a.getModel();if(null!=(p=m.getGeometry(e))){m.beginUpdate();try{if(this.isShiftRightwards())if(c.x>=s)(p=p.clone()).translate(-t,0);else{var u=Math.max(0,c.x-x0);(p=p.clone()).translate(-r*u,0)}if(this.isShiftDownwards())if(c.y>=o)(p=p.clone()).translate(0,-n);else{var p,g=Math.max(0,c.y-i);(p=p.clone()).translate(0,-l*g)}p!=m.getGeometry(e)&&(m.setGeometry(e,p),d&&a.extendParent(e))}finally{m.endUpdate()}}}},mxSpaceManager.prototype.getCellsToShift=function(e){var t=this.getGraph(),n=t.getModel().getParent(e.cell),a=this.isShiftDownwards(),i=this.isShiftRightwards();return t.getCellsBeyond(e.x+(a?0:e.width),e.y+(a&&i?0:e.height),n,i,a)},mxSpaceManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(e){this.enabled=e},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(e){this.horizontal=e},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(e){this.addEnabled=e},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(e){this.resizeEnabled=e},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(e){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=e,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(e){return!this.getGraph().isSwimlane(e)},mxSwimlaneManager.prototype.isCellHorizontal=function(e){if(this.graph.isSwimlane(e)){var t=this.graph.view.getState(e);return e=null!=t?t.style:this.graph.getCellStyle(e),1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)this.isSwimlaneIgnored(e[n])||this.swimlaneAdded(e[n])}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(e){for(var t=this.getGraph().getModel(),n=t.getParent(e),a=t.getChildCount(n),i=null,s=0;s<a;s++){var o=t.getChildAt(n,s);if(o!=e&&!this.isSwimlaneIgnored(o)&&null!=(i=t.getGeometry(o)))break}null!=i&&this.resizeSwimlane(e,i.width,i.height)},mxSwimlaneManager.prototype.cellsResized=function(e){if(null!=e){var t=this.getGraph().getModel();t.beginUpdate();try{for(var n=0;n<e.length;n++)if(!this.isSwimlaneIgnored(e[n])){var a=t.getGeometry(e[n]);if(null!=a){for(var i=new mxRectangle(0,0,a.width,a.height),s=o=e[n];null!=s;){var o=s,r=(s=t.getParent(s),this.graph.isSwimlane(s)?this.graph.getStartSize(s):new mxRectangle);i.width+=r.width,i.height+=r.height}this.resizeSwimlane(o,i.width,i.height)}}}finally{t.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(e,t,n){var a=this.getGraph().getModel();a.beginUpdate();try{if(!this.isSwimlaneIgnored(e))if(null!=(r=a.getGeometry(e))){var i=this.isCellHorizontal(e);(i&&r.height!=n||!i&&r.width!=t)&&(r=r.clone(),i?r.height=n:r.width=t,a.setGeometry(e,r))}var s=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;t-=s.width,n-=s.height;for(var o=a.getChildCount(e),r=0;r<o;r++){var l=a.getChildAt(e,r);this.resizeSwimlane(l,t,n)}}finally{a.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds)},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(e,t,n,a,i){a=null==a||a,i=null==i||i;var s=mxCellPath.create(e.cell),o=this.deltas[s];return null==o?(o=new mxPoint(t,n),this.deltas[s]=o,this.count++):a?(o.X+=t,o.Y+=n):(o.X=t,o.Y=n),i&&this.addEdges(e),o},mxCellStatePreview.prototype.show=function(e){var t,n=this.graph.getModel(),a=n.getRoot();for(t in this.deltas){var i=mxCellPath.resolve(a,t),s=this.graph.view.getState(i),o=this.deltas[t];i=this.graph.view.getState(n.getParent(i));this.translateState(i,s,o.x,o.y)}for(t in this.deltas)i=mxCellPath.resolve(a,t),s=this.graph.view.getState(i),o=this.deltas[t],i=this.graph.view.getState(n.getParent(i)),this.revalidateState(i,s,o.x,o.y,e)},mxCellStatePreview.prototype.translateState=function(e,t,n,a){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.invalid=!0,this.graph.view.validateBounds(e,t.cell),e=i.getGeometry(t.cell);var s=mxCellPath.create(t.cell);0==n&&0==a||null==e||e.relative&&null==this.deltas[s]||(t.x+=n,t.y+=a)}for(e=i.getChildCount(t.cell),s=0;s<e;s++)this.translateState(t,this.graph.view.getState(i.getChildAt(t.cell,s)),n,a)}},mxCellStatePreview.prototype.revalidateState=function(e,t,n,a,i){if(null!=t){t.invalid=!0,this.graph.view.validatePoints(e,t.cell);var s=mxCellPath.create(t.cell),o=this.graph.getModel(),r=this.graph.getCellGeometry(t.cell);for(0==n&&0==a||null==r||!r.relative||!o.isVertex(t.cell)||null!=e&&!o.isVertex(e.cell)&&null==this.deltas[s]||(t.x+=n,t.y+=a,this.graph.cellRenderer.redraw(t)),null!=i&&i(t),e=o.getChildCount(t.cell),s=0;s<e;s++)this.revalidateState(t,this.graph.view.getState(o.getChildAt(t.cell,s)),n,a,i)}},mxCellStatePreview.prototype.addEdges=function(e){for(var t=this.graph.getModel(),n=t.getEdgeCount(e.cell),a=0;a<n;a++){var i=this.graph.view.getState(t.getEdgeAt(e.cell,a));null!=i&&this.moveState(i,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(e){this.enabled=e},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(e){this.cloneEnabled=e},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(e){this.moveEnabled=e},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(e){this.selectEnabled=e},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(e){this.removeCellsFromParent=e},mxGraphHandler.prototype.getInitialCellForEvent=function(e){return e.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(e){return this.graph.isCellSelected(e)},mxGraphHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&null!=t.getState()){var n=this.getInitialCellForEvent(t);if(this.cell=null,this.delayedSelection=this.isDelayedSelection(n),this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,t.getEvent()),this.isMoveEnabled()){var a=this.graph.model,i=a.getGeometry(n);this.graph.isCellMovable(n)&&(!a.isEdge(n)||1<this.graph.getSelectionCount()||null!=i.points&&0<i.points.length||null==a.getTerminal(n,!0)||null==a.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(t.getEvent())&&this.graph.isCellsCloneable())&&this.start(n,t.getX(),t.getY()),this.cellWasClicked=!0,!mxClient.IS_SF&&!mxClient.IS_GC||"SELECT"!=t.getSource().nodeName?t.consume():mxClient.IS_SF&&"SELECT"==t.getSource().nodeName&&(this.cellWasClicked=!1,this.first=null)}}},mxGraphHandler.prototype.getGuideStates=function(){var e=this.graph.getDefaultParent(),t=this.graph.getModel(),n=mxUtils.bind(this,function(e){return null!=this.graph.view.getState(e)&&t.isVertex(e)&&null!=t.getGeometry(e)&&!t.getGeometry(e).relative});return this.graph.view.getCellStates(t.filterDescendants(n,e))},mxGraphHandler.prototype.getCells=function(e){return!this.delayedSelection&&this.graph.isCellMovable(e)?[e]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(e){return null!=(e=this.getBoundingBox(e))&&(e.grow(-1,-1),e.width<this.minimumSize&&(e.x-=(this.minimumSize-e.width)/2,e.width=this.minimumSize),e.height<this.minimumSize&&(e.y-=(this.minimumSize-e.height)/2,e.height=this.minimumSize)),e},mxGraphHandler.prototype.getBoundingBox=function(e){var t=null;if(null!=e&&0<e.length)for(var n=this.graph.getModel(),a=0;a<e.length;a++)if(n.isVertex(e[a])||n.isEdge(e[a])){var i=this.graph.view.getState(e[a]);if(null!=i){var s=i;n.isVertex(e[a])&&null!=i.shape&&null!=i.shape.boundingBox&&(s=i.shape.boundingBox),null==t?t=new mxRectangle(s.x,s.y,s.width,s.height):t.add(s)}}return t},mxGraphHandler.prototype.createPreviewShape=function(e){return(e=new mxRectangleShape(e,null,this.previewColor)).isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1),e},mxGraphHandler.prototype.start=function(e,t,n){this.cell=e,this.first=mxUtils.convertPoint(this.graph.container,t,n),this.cells=this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))},mxGraphHandler.prototype.useGuidesForEvent=function(e){return null==this.guide||this.guide.isEnabledForEvent(e.getEvent())},mxGraphHandler.prototype.snap=function(e){var t=this.scaleGrid?this.graph.view.scale:1;return e.x=this.graph.snap(e.x/t)*t,e.y=this.graph.snap(e.y/t)*t,e},mxGraphHandler.prototype.mouseMove=function(e,t){var n=this.graph;if(!t.isConsumed()&&n.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){var a=(s=mxUtils.convertPoint(n.container,t.getX(),t.getY())).x-this.first.x,i=s.y-this.first.y,s=n.tolerance;if(null!=this.shape||Math.abs(a)>s||Math.abs(i)>s){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var o=n.isGridEnabledEvent(t.getEvent());s=!0;if(null!=this.guide&&this.useGuidesForEvent(t))s=!1,a=(i=this.guide.move(this.bounds,new mxPoint(a,i),o)).x,i=i.y;else if(o){var r=n.getView().translate,l=n.getView().scale;o=this.bounds.x-(n.snap(this.bounds.x/l-r.x)+r.x)*l,r=this.bounds.y-(n.snap(this.bounds.y/l-r.y)+r.y)*l,a=(i=this.snap(new mxPoint(a,i))).x-o,i=i.y-r}for(null!=this.guide&&s&&this.guide.hide(),n.isConstrainedEvent(t.getEvent())&&(Math.abs(a)>Math.abs(i)?i=0:a=0),this.currentDx=a,this.currentDy=i,this.updatePreviewShape(),s=null,i=t.getCell(),n.isDropEnabled()&&this.highlightEnabled&&(s=n.getDropTarget(this.cells,t.getEvent(),i)),o=s,r=n.getModel();null!=o&&o!=this.cells[0];)o=r.getParent(o);l=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var d=!1;null==(a=n.getView().getState(s))||null!=o||r.getParent(this.cell)==s&&!l?(this.target=null,this.connectOnDrop&&null!=i&&1==this.cells.length&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&(null!=(a=n.getView().getState(i))&&(n=null==n.getEdgeValidationError(null,this.cell,i)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(n),d=!0))):(this.target!=s&&(this.target=s,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),d=!0),null!=a&&d?this.highlight.highlight(a):this.highlight.hide()}t.consume(),mxEvent.consume(t.getEvent())}else!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||t.isConsumed()||null==t.getState()||n.isMouseDown||(null==(a=n.getCursorForCell(t.getCell()))&&n.isEnabled()&&n.isCellMovable(t.getCell())&&(a=n.getModel().isEdge(t.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),t.getState().setCursor(a),t.consume())},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(e){null!=this.highlight&&this.highlight.setHighlightColor(e)},mxGraphHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()){var n=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var a=n.getView().scale,i=n.isCloneEvent(t.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),s=this.currentDx/a,o=(a=this.currentDy/a,t.getCell());this.connectOnDrop&&null==this.target&&null!=o&&n.getModel().isVertex(o)&&n.isCellConnectable(o)&&n.isEdgeValid(null,this.cell,o)?n.connectionHandler.connect(this.cell,o,t.getEvent()):(o=this.target,n.isSplitEnabled()&&n.isSplitTarget(o,this.cells,t.getEvent())?n.splitEdge(o,this.cells,null,s,a):this.moveCells(this.cells,s,a,i,this.target,t.getEvent()))}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(t)}this.cellWasClicked&&t.consume(),this.reset()},mxGraphHandler.prototype.selectDelayed=function(e){this.graph.selectCellForEvent(this.cell,e.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.delayedSelection=this.cellWasClicked=!1,this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){if(this.graph.getModel().isVertex(e)){if(e=this.graph.getView().getState(e),n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),0!=(a=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))){t=Math.cos(-a);var a=Math.sin(-a),i=new mxPoint(e.getCenterX(),e.getCenterY());n=mxUtils.getRotatedPoint(n,t,a,i)}return null!=e&&!mxUtils.contains(e,n.x,n.y)}return!1},mxGraphHandler.prototype.moveCells=function(e,t,n,a,i,s){a&&(e=this.graph.getCloneableCells(e)),null==i&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),e,s)&&(i=this.graph.getDefaultParent()),e=this.graph.moveCells(e,t-this.graph.panDx/this.graph.view.scale,n-this.graph.panDy/this.graph.view.scale,a,i,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(e[0]),a&&this.graph.setSelectionCells(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.destroyShapes()},mxPanningHandler.prototype=new mxPopupMenu,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.triggerX=null,mxPanningHandler.prototype.triggerY=null,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.selectOnPopup=!0,mxPanningHandler.prototype.clearSelectionOnBackground=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(e){this.panningEnabled=e},mxPanningHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addListener(this.div,mxClient.IS_TOUCH?"touchmove":"mousemove",mxUtils.bind(this,function(e){this.graph.tooltipHandler.hide()}))},mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())&&mxEvent.isLeftMouseButton(t)||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)},mxPanningHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()){this.hideMenu(),this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop;var n=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());this.triggerX=n.x,this.triggerY=n.y,this.popupTrigger=this.isPopupTrigger(t),this.panningTrigger=this.isPanningEnabled()&&this.isPanningTrigger(t),this.startX=t.getX(),this.startY=t.getY(),this.panningTrigger&&this.consumePanningTrigger(t)}},mxPanningHandler.prototype.consumePanningTrigger=function(e){e.consume()},mxPanningHandler.prototype.mouseMove=function(e,t){var n=t.getX()-this.startX,a=t.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a)),this.graph.panGraph(n+this.dx0,a+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",t)),t.consume();else if(this.panningTrigger){var i=this.active;this.active=Math.abs(n)>this.graph.tolerance||Math.abs(a)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",t))}},mxPanningHandler.prototype.mouseUp=function(e,t){var n=Math.abs(t.getX()-this.startX),a=Math.abs(t.getY()-this.startY);if(this.active){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){n=t.getX()-this.startX,a=t.getY()-this.startY,this.useGrid&&(n=this.graph.snap(n),a=this.graph.snap(a));var i=this.graph.getView().scale,s=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(s.x+n/i,s.y+a/i)}this.active=!1,this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",t)),t.consume()}else this.popupTrigger&&n<this.graph.tolerance&&a<this.graph.tolerance&&(n=this.getCellForPopupEvent(t),this.graph.isEnabled()&&this.selectOnPopup&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),a=mxUtils.getScrollOrigin(),a=new mxPoint(t.getX()+a.x,t.getY()+a.y),this.popup(a.x+1,a.y+1,n,t.getEvent()),t.consume());this.popupTrigger=this.panningTrigger=!1},mxPanningHandler.prototype.getCellForPopupEvent=function(e){return e.getCell()},mxPanningHandler.prototype.panGraph=function(e,t){this.graph.getView().setTranslate(e,t)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(e){this.enabled=e},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(e){this.hotspot=e},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(e){this.hotspotEnabled=e},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(e){var t=null;if(this.isEnabled()){var n=null!=(t=this.getState(e))&&this.isValidState(t);e=this.getMarkerColor(e.getEvent(),t,n),this.validState=n?t:null,t==this.markedState&&e==this.currentColor||(this.currentColor=e,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))}return t},mxCellMarker.prototype.markCell=function(e,t){var n=this.graph.getView().getState(e);null!=n&&(this.currentColor=null!=t?t:this.validColor,this.markedState=n,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(e){return!0},mxCellMarker.prototype.getMarkerColor=function(e,t,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(e){var t=this.graph.getView();return cell=this.getCell(e),null!=(t=this.getStateToMark(t.getState(cell)))&&this.intersects(t,e)?t:null},mxCellMarker.prototype.getCell=function(e){return e.getCell()},mxCellMarker.prototype.getStateToMark=function(e){return e},mxCellMarker.prototype.intersects=function(e,t){return!this.hotspotEnabled||mxUtils.intersectsHotspot(e,t.getGraphX(),t.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(e){this.enabled=e},mxSelectionCellsHandler.prototype.getHandler=function(e){return this.handlers.get(e)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(e,t){t.reset.apply(t)})},mxSelectionCellsHandler.prototype.refresh=function(){var e=this.handlers;this.handlers=new mxDictionary;for(var t=this.graph.getSelectionCells(),n=0;n<t.length;n++){var a=this.graph.view.getState(t[n]);if(null!=a){var i=e.remove(t[n]);null!=i&&(i.state!=a?(i.destroy(),i=null):i.redraw()),null==i&&(i=this.graph.createHandler(a),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",a))),null!=i&&this.handlers.put(t[n],i)}}e.visit(mxUtils.bind(this,function(e,t){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",t.state)),t.destroy()}))},mxSelectionCellsHandler.prototype.mouseDown=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseDown.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseMove=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseMove.apply(t,n)})}},mxSelectionCellsHandler.prototype.mouseUp=function(e,t){if(this.graph.isEnabled()&&this.isEnabled()){var n=[e,t];this.handlers.visit(function(e,t){t.mouseUp.apply(t,n)})}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.tapAndHoldEnabled=!0,mxConnectionHandler.prototype.tapAndHoldDelay=500,mxConnectionHandler.prototype.tapAndHoldInProgress=!1,mxConnectionHandler.prototype.tapAndHoldValid=!1,mxConnectionHandler.prototype.tapAndHoldTolerance=4,mxConnectionHandler.prototype.initialTouchX=0,mxConnectionHandler.prototype.initialTouchY=0,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(e){this.enabled=e},mxConnectionHandler.prototype.isCreateTarget=function(){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(e){this.createTarget=e},mxConnectionHandler.prototype.createShape=function(){var e=new mxPolyline([],mxConstants.INVALID_COLOR);if(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=!0,this.graph.dialect==mxConstants.DIALECT_SVG)e.node.setAttribute("pointer-events","none");else{var t=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(e.node,this.graph,t)}return e},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(e){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?this.redrawIcons(this.icons,this.iconState):(this.destroyIcons(this.icons),this.previous=null),this.constraintHandler.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(e){this.destroyIcons(this.icons)}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(e){return!0},mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);return a.hotspotEnabled=!0,a.getCell=mxUtils.bind(this,function(e,t){return t=mxCellMarker.prototype.getCell.apply(a,arguments),this.error=null,this.isConnectableCell(t)?(null!=t?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,t),null!=this.error&&0==this.error.length&&(t=null,this.isCreateTarget()&&(this.error=null))):this.isValidSource(t)||(t=null):this.isConnecting()&&!this.isCreateTarget()&&!this.graph.allowDanglingEdges&&(this.error=""),t):null}),a.isValidState=mxUtils.bind(this,function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)}),a.getMarkerColor=mxUtils.bind(this,function(e,t,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null}),a.intersects=mxUtils.bind(this,function(e,t){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(a,arguments)}),a},mxConnectionHandler.prototype.start=function(e,t,n,a){this.previous=e,this.first=new mxPoint(t,n),this.edgeState=null!=a?a:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=e,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(e){return this.graph.isValidSource(e)},mxConnectionHandler.prototype.isValidTarget=function(e){return!0},mxConnectionHandler.prototype.validateConnection=function(e,t){return this.isValidTarget(t)?this.graph.getEdgeValidationError(null,e,t):""},mxConnectionHandler.prototype.getConnectImage=function(e){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(e){return null!=e.text&&e.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(e){if(null==(i=this.getConnectImage(e))||null==e)return null;this.iconState=e;var t=[],n=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src,null,null,0);n.preserveImageAspect=!1,this.isMoveIconToFrontForState(e)?(n.dialect=mxConstants.DIALECT_STRICTHTML,n.init(this.graph.container)):(n.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=n.node.previousSibling&&n.node.parentNode.insertBefore(n.node,n.node.parentNode.firstChild)),n.node.style.cursor=mxConstants.CURSOR_CONNECT;var a=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:e}),i=mxUtils.bind(this,function(e){mxEvent.isConsumed(e)||(this.icon=n,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,a())))});return mxEvent.redirectMouseEvents(n.node,this.graph,a,i),t.push(n),this.redrawIcons(t,this.iconState),t},mxConnectionHandler.prototype.redrawIcons=function(e,t){if(null!=e&&null!=e[0]&&null!=t){var n=this.getIconPosition(e[0],t);e[0].bounds.x=n.x,e[0].bounds.y=n.y,e[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(e,t){var n=this.graph.getView().scale,a=t.getCenterX(),i=t.getCenterY();if(this.graph.isSwimlane(t.cell)){a=0!=(s=this.graph.getStartSize(t.cell)).width?t.x+s.width*n/2:a,i=0!=s.height?t.y+s.height*n/2:i;if(0!=(s=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0))){n=Math.cos(s);var s=Math.sin(s),o=new mxPoint(t.getCenterX(),t.getCenterY());a=(i=mxUtils.getRotatedPoint(new mxPoint(a,i),n,s,o)).x,i=i.y}}return new mxPoint(a-e.bounds.width/2,i-e.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(e){if(null!=e){this.iconState=null;for(var t=0;t<e.length;t++)e[t].destroy()}},mxConnectionHandler.prototype.isStartEvent=function(e){return!this.graph.isForceMarqueeEvent(e.getEvent())&&(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon))},mxConnectionHandler.prototype.mouseDown=function(e,t){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!t.isConsumed()&&!this.isConnecting()&&this.isStartEvent(t)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.edgeState=this.createEdgeState(t),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape()),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(t.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),t.consume()}else if(mxClient.IS_TOUCH&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress&&this.isEnabled()&&this.graph.isEnabled()&&!this.isConnecting()){this.tapAndHoldInProgress=!0,this.initialTouchX=t.getX(),this.initialTouchY=t.getY();var a=this.graph.view.getState(this.marker.getCell(t));this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(t,a),this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.tapAndHold=function(e,t){null!=t&&(this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,this.marker.mark(),this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.previous=t,this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)))},mxConnectionHandler.prototype.isImmediateConnectSource=function(e){return!this.graph.isCellMovable(e.cell)},mxConnectionHandler.prototype.createEdgeState=function(e){return null},mxConnectionHandler.prototype.updateCurrentState=function(e){var t=this.marker.process(e);this.constraintHandler.update(e,null==this.first),this.currentState=t},mxConnectionHandler.prototype.convertWaypoint=function(e){var t=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();e.x=e.x/t-n.x,e.y=e.y/t-n.y},mxConnectionHandler.prototype.mouseMove=function(e,t){if(this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-t.getX())<this.tapAndHoldTolerance&&Math.abs(this.initialTouchY-t.getY())<this.tapAndHoldTolerance),t.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{if(!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(this.icons),this.currentState=null),(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(t),null!=this.first){var n=this.graph.getView().scale,a=null,i=n=new mxPoint(this.graph.snap(t.getGraphX()/n)*n,this.graph.snap(t.getGraphY()/n)*n);null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint&&(a=this.constraintHandler.currentConstraint,i=this.constraintHandler.currentPoint.clone());var s=this.first;if(null!=this.selectedIcon){var o=this.selectedIcon.bounds.width,r=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(o=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=o.x,this.selectedIcon.bounds.y=o.y):(o=new mxRectangle(t.getGraphX()+this.connectIconOffset.x,t.getGraphY()+this.connectIconOffset.y,o,r),this.selectedIcon.bounds=o),this.selectedIcon.redraw()}if(null!=this.edgeState){if(this.edgeState.absolutePoints=[null,null!=this.currentState?null:i],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==a&&(a=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,a)),(s=null)!=this.waypoints)for(s=[],i=0;i<this.waypoints.length;i++)a=this.waypoints[i].clone(),this.convertWaypoint(a),s[i]=a;this.graph.view.updatePoints(this.edgeState,s,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState),i=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],s=this.edgeState.absolutePoints[0]}else null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(null!=(o=this.getTargetPerimeterPoint(this.currentState,t))&&(i=o)),null==this.sourceConstraint&&null!=this.previous&&(null!=(o=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:i,t))&&(s=o));if(null==this.currentState&&this.movePreviewAway){if(o=s,null!=this.edgeState&&2<this.edgeState.absolutePoints.length&&(null!=(a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(o=a)),a=i.x-o.x,o=i.y-o.y,0==(r=Math.sqrt(a*a+o*o)))return;i.x-=4*a/r,i.y-=4*o/r}null==this.shape&&(a=Math.abs(n.x-this.first.x),o=Math.abs(n.y-this.first.y),a>this.graph.tolerance||o>this.graph.tolerance)&&(this.shape=this.createShape(),this.updateCurrentState(t)),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(n=[s],null!=this.waypoints&&(n=n.concat(this.waypoints)),n.push(i),this.shape.points=n),this.drawPreview()),mxEvent.consume(t.getEvent()),t.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(this.icons),(this.icons=null)!=this.currentState&&null==this.error&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),t.consume())),this.previous=this.currentState):this.previous==this.currentState&&null!=this.currentState&&null==this.icons&&!this.graph.isMouseDown&&t.consume():this.constraintHandler.reset();if(null!=this.constraintHandler.currentConstraint&&this.marker.reset(),!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(n=!1,s=t.getSource(),i=0;i<this.icons.length&&!n;i++)n=s==this.icons[i].node||s.parentNode==this.icons[i].node;n||this.updateIcons(this.currentState,this.icons,t)}}},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(e,t){var n=null,a=(i=e.view).getPerimeterFunction(e);if(null!=a){var i,s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());null!=(i=a(i.getPerimeterBounds(e),this.edgeState,s,!1))&&(n=i)}else n=new mxPoint(e.getCenterX(),e.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(e,t,n){n=null;var a=e.view,i=a.getPerimeterFunction(e),s=new mxPoint(e.getCenterX(),e.getCenterY());if(null!=i){var o=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0),r=-o*(Math.PI/180);0!=o&&(t=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),Math.cos(r),Math.sin(r),s)),null!=(e=i(a.getPerimeterBounds(e),e,t,!1))&&(0!=o&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-r),Math.sin(-r),s)),n=e)}else n=s;return n},mxConnectionHandler.prototype.updateIcons=function(e,t,n){},mxConnectionHandler.prototype.isStopEvent=function(e){return null!=e.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(e){var t=mxUtils.convertPoint(this.graph.container,e.getX(),e.getY()),n=Math.abs(t.x-this.first.x);t=Math.abs(t.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||t>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),n=this.graph.view.scale,t=new mxPoint(this.graph.snap(e.getGraphX()/n)*n,this.graph.snap(e.getGraphY()/n)*n),this.waypoints.push(t))},mxConnectionHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(t))return this.addWaypointForEvent(t),void t.consume();if(null==this.error){var n=null!=this.previous?this.previous.cell:null,a=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),this.connect(n,a,t.getEvent(),t.getCell())}else null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons(this.icons),t.consume()}null!=this.first&&this.reset(),this.tapAndHoldValid=this.tapAndHoldInProgress=!1},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),this.destroyIcons(this.icons),this.icons=null,this.marker.reset(),this.constraintHandler.reset(),this.sourceConstraint=this.error=this.previous=this.edgeState=this.selectedIcon=null,this.mouseDownCounter=0,this.icon=this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){var e=null==this.error;this.shape.strokewidth=this.getEdgeWidth(e),e=this.getEdgeColor(e),this.shape.stroke=e,this.shape.redraw()},mxConnectionHandler.prototype.getEdgeColor=function(e){return e?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(e){return e?3:1},mxConnectionHandler.prototype.connect=function(e,t,n,a){if(null!=t||this.isCreateTarget()||this.graph.allowDanglingEdges){var i=this.graph.getModel(),s=null;i.beginUpdate();try{if(null!=e&&null==t&&this.isCreateTarget()&&null!=(t=this.createTargetVertex(n,e))){if(null!=(a=this.graph.getDropTarget([t],n,a))&&this.graph.getModel().isEdge(a))a=this.graph.getDefaultParent();else{var o=this.graph.getView().getState(a);if(null!=o){var r=i.getGeometry(t);r.x-=o.origin.x,r.y-=o.origin.y}}this.graph.addCell(t,a)}var l=this.graph.getDefaultParent();if(null!=e&&null!=t&&i.getParent(e)==i.getParent(t)&&i.getParent(i.getParent(e))!=i.getRoot()&&(l=i.getParent(e),null!=e.geometry&&e.geometry.relative&&null!=t.geometry&&t.geometry.relative&&(l=i.getParent(l))),r=o=null,null!=this.edgeState&&(o=this.edgeState.cell.value,r=this.edgeState.cell.style),null!=(s=this.insertEdge(l,null,o,e,t,r))){this.graph.setConnectionConstraint(s,e,!0,this.sourceConstraint),this.graph.setConnectionConstraint(s,t,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&i.setGeometry(s,this.edgeState.cell.geometry);var d=i.getGeometry(s);if(null==d&&((d=new mxGeometry).relative=!0,i.setGeometry(s,d)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,m=this.graph.view.translate;for(d.points=[],e=0;e<this.waypoints.length;e++){var u=this.waypoints[e];d.points.push(new mxPoint(u.x/c-m.x,u.y/c-m.y))}}null==t&&((u=this.graph.getPointForEvent(n,!1)).x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,d.setTerminalPoint(u,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",s,"event",n,"target",a))}}catch(e){mxLog.show(),mxLog.debug(e.message)}finally{i.endUpdate()}this.select&&this.selectCells(s,t)}},mxConnectionHandler.prototype.selectCells=function(e,t){this.graph.setSelectionCell(e)},mxConnectionHandler.prototype.insertEdge=function(e,t,n,a,i,s){return null==this.factoryMethod?this.graph.insertEdge(e,t,n,a,i,s):(t=this.createEdge(n,a,i,s),this.graph.addEdge(t,e,a,i))},mxConnectionHandler.prototype.createTargetVertex=function(e,t){for(var n=this.graph.getCellGeometry(t);null!=n&&n.relative;)t=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t);var a=this.graph.cloneCells([t])[0];if(null!=(n=this.graph.getModel().getGeometry(a))){var i=this.graph.getPointForEvent(e);if(n.x=this.graph.snap(i.x-n.width/2)-this.graph.panDx/this.graph.view.scale,n.y=this.graph.snap(i.y-n.height/2)-this.graph.panDy/this.graph.view.scale,null!=this.first){var s=this.graph.view.getState(t);if(null!=s){var o=this.getAlignmentTolerance();Math.abs(this.graph.snap(this.first.x)-this.graph.snap(i.x))<=o?n.x=s.x:Math.abs(this.graph.snap(this.first.y)-this.graph.snap(i.y))<=o&&(n.y=s.y)}}}return a},mxConnectionHandler.prototype.getAlignmentTolerance=function(){return this.graph.isGridEnabled()?this.graph.gridSize:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(e,t,n,a){var i=null;return null!=this.factoryMethod&&(i=this.factoryMethod(t,n,a)),null==i&&((i=new mxCell(e||"")).setEdge(!0),i.setStyle(a),(e=new mxGeometry).relative=!0,i.setGeometry(e)),i},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(e){this.enabled=e},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var e=0;e<this.focusIcons.length;e++)this.focusIcons[e].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null},mxConstraintHandler.prototype.getTolerance=function(){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(e,t,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(e,t){return!1},mxConstraintHandler.prototype.update=function(e,t){if(this.isEnabled()&&!this.isEventIgnored(e)){var n=this.getTolerance(),a=new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n),i=null!=e.getCell()&&this.graph.isCellConnectable(e.getCell());if((null==this.currentFocusArea||!mxUtils.intersects(this.currentFocusArea,a)||null!=e.getState()&&null!=this.currentFocus&&i)&&(this.currentFocusArea=null,e.getState()!=this.currentFocus))if(this.currentFocus=null,this.constraints=null!=e.getState()&&i?this.graph.getAllConnectionConstraints(e.getState(),t):null,null!=this.constraints){if(this.currentFocus=e.getState(),this.currentFocusArea=new mxRectangle(e.getState().x,e.getState().y,e.getState().width,e.getState().height),null!=this.focusIcons){for(i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}for(this.focusIcons=[],this.focusPoints=[],i=0;i<this.constraints.length;i++){var s,o=this.graph.getConnectionPoint(e.getState(),this.constraints[i]),r=(s=this.getImageForConstraint(e.getState(),this.constraints[i],o)).src;(s=new mxImageShape(s=new mxRectangle(o.x-s.width/2,o.y-s.height/2,s.width,s.height),r)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getOverlayPane()),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild),r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,r),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(o)}this.currentFocusArea.grow(n)}else if(null!=this.focusIcons){for(null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusPoints=this.focusIcons=null}if(this.currentPoint=this.currentConstraint=null,null!=this.focusIcons&&null!=this.constraints&&(null==e.getState()||this.currentFocus==e.getState()))for(i=0;i<this.focusIcons.length;i++)if(mxUtils.intersects(this.focusIcons[i].bounds,a)){this.currentConstraint=this.constraints[i],this.currentPoint=this.focusPoints[i],(n=this.focusIcons[i].bounds.clone()).grow(mxClient.IS_IE?3:2),mxClient.IS_IE&&(n.width-=1,n.height-=1),null==this.focusHighlight?((n=new mxRectangleShape(n,null,this.highlightColor,3)).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,n.init(this.graph.getView().getOverlayPane()),this.focusHighlight=n,r=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e.getState()}),mxEvent.redirectMouseEvents(n.node,this.graph,r)):(this.focusHighlight.bounds=n,this.focusHighlight.redraw());break}null==this.currentConstraint&&null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)}},mxConstraintHandler.prototype.destroy=function(){this.reset()},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(e){this.enabled=e},mxRubberband.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(this.graph.isForceMarqueeEvent(t.getEvent())||null==t.getState())){var n=mxUtils.getOffset(this.graph.container),a=mxUtils.getScrollOrigin(this.graph.container);if(a.x-=n.x,a.y-=n.y,this.start(t.getX()+a.x,t.getY()+a.y),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var i=this.graph.container,s=function(e){e=new mxMouseEvent(e);var t=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=t.x,e.graphY=t.y,e};this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,s(e))}),this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,s(e))}),mxEvent.addListener(document,"mousemove",this.dragHandler),mxEvent.addListener(document,"mouseup",this.dropHandler)}t.consume(!1)}},mxRubberband.prototype.start=function(e,t){this.first=new mxPoint(e,t)},mxRubberband.prototype.mouseMove=function(e,t){if(!t.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),a=mxUtils.getOffset(this.graph.container);n.x-=a.x,n.y-=a.y;a=t.getX()+n.x,n=t.getY()+n.y;var i=this.first.x-a,s=this.first.y-n,o=this.graph.tolerance;(null!=this.div||Math.abs(i)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,n),t.consume())}},mxRubberband.prototype.createShape=function(){return null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv),this.sharedDiv},mxRubberband.prototype.mouseUp=function(e,t){var n=null!=this.div;this.reset(),n&&(n=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(n,t.getEvent()),t.consume())},mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div),null!=this.dragHandler&&(mxEvent.removeListener(document,"mousemove",this.dragHandler),this.dragHandler=null),null!=this.dropHandler&&(mxEvent.removeListener(document,"mouseup",this.dropHandler),this.dropHandler=null),this.currentY=this.currentX=0,this.div=this.first=null},mxRubberband.prototype.update=function(e,t){this.currentX=e,this.currentY=t,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var e=this.currentX-this.graph.panDx,t=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,e),this.y=Math.min(this.first.y,t),this.width=Math.max(this.first.x,e)-this.x,this.height=Math.max(this.first.y,t)-this.y,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.init(this.graph.getView().getOverlayPane()),this.graph.isCellMovable(this.state.cell)&&(this.selectionBorder.node.style.cursor=mxConstants.CURSOR_MOVABLE_VERTEX),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var e=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],e||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var t=0;e&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",t++)),this.sizers.push(this.createSizer("n-resize",t++)),this.sizers.push(this.createSizer("ne-resize",t++)),this.sizers.push(this.createSizer("w-resize",t++)),this.sizers.push(this.createSizer("e-resize",t++)),this.sizers.push(this.createSizer("sw-resize",t++)),this.sizers.push(this.createSizer("s-resize",t++))),this.sizers.push(this.createSizer("se-resize",t++))),null!=(e=this.graph.model.getGeometry(this.state.cell))&&!e.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)&&(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,null,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.rotationEnabled&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(this.rotationShape=this.createSizer("pointer",mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.redraw()},mxVertexHandler.prototype.getSelectionBounds=function(e){return new mxRectangle(Math.round(e.x),Math.round(e.y),Math.round(e.width),Math.round(e.height))},mxVertexHandler.prototype.createSelectionShape=function(e){return(e=new mxRectangleShape(e,null,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(e,t,n,a){return n=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),(a=this.createSizerShape(n,t,a)).isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(a.bounds.height-=1,a.bounds.width-=1,a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(a.node,this.graph,this.state),this.graph.isEnabled()&&(a.node.style.cursor=e),this.isSizerVisible(t)||(a.node.style.visibility="hidden"),a},mxVertexHandler.prototype.isSizerVisible=function(e){return!0},mxVertexHandler.prototype.createSizerShape=function(e,t,n){return null!=this.handleImage?(e.width=this.handleImage.width,e.height=this.handleImage.height,new mxImageShape(e,this.handleImage.src)):t==mxEvent.ROTATION_HANDLE?new mxEllipse(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(e,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(e,t,n){null!=e&&(e.bounds.x=Math.round(t-e.bounds.width/2),e.bounds.y=Math.round(n-e.bounds.height/2),e.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){if(e.isSource(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e.isSource(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.sizers.length;n++)if(e.isSource(this.sizers[n])||null!=t&&mxUtils.intersects(this.sizers[n].bounds,t))return n;return null},mxVertexHandler.prototype.mouseDown=function(e,t){if(!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(0<this.tolerance||t.getState()==this.state)){var n=this.getHandleForEvent(t);null!=n&&(this.start(t.getX(),t.getY(),n),t.consume())}},mxVertexHandler.prototype.start=function(e,t,n){e=mxUtils.convertPoint(this.graph.container,e,t),this.startX=e.x,this.startY=e.y,this.index=n,this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))},mxVertexHandler.prototype.mouseMove=function(e,t){if(t.isConsumed()||null==this.index)null!=this.getHandleForEvent(t)&&t.consume(!1);else{var n=new mxPoint(t.getGraphX(),t.getGraphY()),a=this.graph.isGridEnabledEvent(t.getEvent()),i=this.graph.getView().scale;if(this.index==mxEvent.LABEL_HANDLE)a&&(n.x=this.graph.snap(n.x/i)*i,n.y=this.graph.snap(n.y/i)*i),this.moveSizerTo(this.sizers[this.sizers.length-1],n.x,n.y);else if(this.index==mxEvent.ROTATION_HANDLE){var s=this.state.x+this.state.width/2-n.x,o=this.state.y+this.state.height/2-n.y;this.currentAlpha=0!=s?180*Math.atan(o/s)/Math.PI+90:o<0?180:0,0<s&&(this.currentAlpha-=180),this.rotationRaster&&(s=n.x-this.state.getCenterX(),o=n.y-this.state.getCenterY(),s=Math.abs(Math.sqrt(s*s+o*o)-this.state.height/2-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(s))))),this.currentAlpha=Math.round(this.currentAlpha/s)*s),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw()}else{var r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-r),d=Math.sin(-r),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=(s=n.x-this.startX,o=n.y-this.startY,n=this.graph.view.translate,d*s+l*o);s=l*s-d*o;this.bounds=this.union(this.selectionBounds,s,m,this.index,a,i,n),l=Math.cos(r),c=(d=Math.sin(r))*(s=(o=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY())).x-c.x)+l*(o=o.y-c.y)-o,this.bounds.x+=l*s-d*o-s,this.bounds.y+=c,this.drawPreview()}t.consume()}},mxVertexHandler.prototype.mouseUp=function(e,t){if(!t.isConsumed()&&null!=this.index&&null!=this.state){var n=new mxPoint(t.getGraphX(),t.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index==mxEvent.ROTATION_HANDLE)null!=this.currentAlpha&&this.rotateCell(this.state.cell,this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0));else{var a=this.graph.isGridEnabledEvent(t.getEvent()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=Math.cos(-i),o=Math.sin(-i),r=(n=o*(r=n.x-this.startX)+s*(l=n.y-this.startY),s*r-o*l),l=n,d=this.graph.view.scale;this.resizeCell(this.state.cell,r/d,l/d,this.index,a)}}finally{this.graph.getModel().endUpdate()}this.reset(),t.consume()}},mxVertexHandler.prototype.rotateCell=function(e,t){var n=this.graph.getModel();if(n.isVertex(e)){if(null!=(s=e==this.state?this.state:this.graph.view.getState(e))&&this.graph.setCellStyles(mxConstants.STYLE_ROTATION,(s.style[mxConstants.STYLE_ROTATION]||0)+t,[e]),this.state.cell!=e&&(null!=(s=this.graph.getCellGeometry(e))&&!s.relative))if(0!=t){var a=this.graph.getModel().getParent(e),i=this.graph.getCellGeometry(a);if(!s.relative&&null!=i){var s,o=mxUtils.toRadians(t),r=(a=Math.cos(o),o=Math.sin(o),new mxPoint(s.getCenterX(),s.getCenterY()));i=new mxPoint(i.width/2,i.height/2),a=mxUtils.getRotatedPoint(r,a,o,i);(s=s.clone()).x=a.x-s.width/2,s.y=a.y-s.height/2,n.setGeometry(e,s)}}else(s=s.clone()).x+=dx,s.y+=dy,n.setGeometry(e,s);for(s=n.getChildCount(e),a=0;a<s;a++)this.rotateCell(n.getChildAt(e,a),t)}},mxVertexHandler.prototype.reset=function(){this.index=this.currentAlpha=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview())},mxVertexHandler.prototype.resizeCell=function(e,t,n,a,i){var s=this.graph.model.getGeometry(e);if(null!=s)if(a==mxEvent.LABEL_HANDLE)a=this.graph.view.scale,t=(this.labelShape.bounds.getCenterX()-this.startX)/a,n=(this.labelShape.bounds.getCenterY()-this.startY)/a,null==(s=s.clone()).offset?s.offset=new mxPoint(t,n):(s.offset.x+=t,s.offset.y+=n),this.graph.model.setGeometry(e,s);else{if(a=this.union(s,t,n,a,i,1,new mxPoint(0,0)),0!=(r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"))){t=a.getCenterX()-s.getCenterX(),n=a.getCenterY()-s.getCenterY(),i=Math.cos(r);var o=Math.sin(r),r=i*t-o*n-t;t=o*t+i*n-n,n=a.x-s.x;var l=a.y-s.y,d=i*n-o*l;i=o*n+i*l,a.x+=r,a.y+=t,this.graph.isCellCollapsed(e)||0==r&&0==t||(n=s.x-a.x+d,l=s.y-a.y+i,this.moveChildren(e,n,l))}this.graph.resizeCell(e,a)}},mxVertexHandler.prototype.moveChildren=function(e,t,n){for(var a=this.graph.getModel(),i=a.getChildCount(e),s=0;s<i;s++){var o=a.getChildAt(e,s);if(a.isVertex(o)){var r=this.graph.getCellGeometry(o);null!=r&&!r.relative&&((r=r.clone()).x+=t,r.y+=n,a.setGeometry(o,r))}}},mxVertexHandler.prototype.union=function(e,t,n,a,i,s,o){if(this.singleSizer){o=e.x+e.width+t;var r=e.y+e.height+n;return i&&(o=this.graph.snap(o/s)*s,r=this.graph.snap(r/s)*s),(s=new mxRectangle(e.x,e.y,0,0)).add(new mxRectangle(o,r,0,0)),s}var l=(r=e.x-o.x*s)+e.width,d=e.y-o.y*s;return e=d+e.height,4<a?(e+=n,i&&(e=this.graph.snap(e/s)*s)):a<3&&(d+=n,i&&(d=this.graph.snap(d/s)*s)),0==a||3==a||5==a?(r+=t,i&&(r=this.graph.snap(r/s)*s)):2!=a&&4!=a&&7!=a||(l+=t,i&&(l=this.graph.snap(l/s)*s)),e-=d,(i=l-r)<0&&(r+=i,i=Math.abs(i)),e<0&&(d+=e,e=Math.abs(e)),new mxRectangle(r+o.x*s,d+o.y*s,i,e)},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.state.x,this.state.y,this.state.width,this.state.height);var e=this.state;if(null!=this.sizers){var t=e.x+e.width,n=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],t,n);else{var a=e.x+e.width/2,i=e.y+e.height/2;if(1<this.sizers.length){var s=mxUtils.toRadians(e.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=(s=Math.sin(s),new mxPoint(e.getCenterX(),e.getCenterY())),l=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),o,s,r);this.moveSizerTo(this.sizers[0],l.x,l.y),l.x=a,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[1],l.x,l.y),l.x=t,l.y=e.y,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[2],l.x,l.y),l.x=e.x,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[3],l.x,l.y),l.x=t,l.y=i,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[4],l.x,l.y),l.x=e.x,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[5],l.x,l.y),l.x=a,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[6],l.x,l.y),l.x=t,l.y=n,l=mxUtils.getRotatedPoint(l,o,s,r),this.moveSizerTo(this.sizers[7],l.x,l.y),this.moveSizerTo(this.sizers[8],a+e.absoluteOffset.x,i+e.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],a+e.absoluteOffset.x,i+e.absoluteOffset.y):this.moveSizerTo(this.sizers[0],e.x,e.y)}}null!=this.rotationShape&&(s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),s=Math.sin(s),r=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),l=mxUtils.getRotatedPoint(new mxPoint(e.x+e.width/2,e.y-16),o,s,r),this.moveSizerTo(this.rotationShape,l.x,l.y)),this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.drawPreview()},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.preview&&(this.preview.destroy(),this.preview=null),this.selectionBorder.destroy(),this.labelShape=this.selectionBorder=null,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy(),this.sizers[e]=null},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.svgStrokeTolerance=0,this.shape.node.style.cursor=mxConstants.CURSOR_MOVABLE_EDGE,mxEvent.addListener(this.shape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e,this.state.cell)})),mxEvent.addGestureListeners(this.shape.node,mxUtils.bind(this,function(e){this.addEnabled&&this.isAddPointEvent(e)?this.addPoint(this.state,e):this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,this.state))}),mxUtils.bind(this,function(e){var t=this.state.cell;if(null!=this.index){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.graph.getCellAt(n.x,n.y);this.graph.isSwimlane(t)&&this.graph.hitsSwimlaneContent(t,n.x,n.y)&&(t=null)}this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,this.graph.getView().getState(t)))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,this.state))})),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var e=this.state.getVisibleTerminalState(!0);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container),this.preferHtml||null!=(e=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends()),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=new mxRectangleShape(new mxRectangle,mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR),this.labelShape.pointerEvents=!1,this.initBend(this.labelShape),this.labelShape.node.style.cursor=mxConstants.CURSOR_LABEL_HANDLE,mxEvent.redirectMouseEvents(this.labelShape.node,this.graph,this.state),this.redraw()},mxEdgeHandler.prototype.isAddPointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.isRemovePointEvent=function(e){return mxEvent.isShiftDown(e)},mxEdgeHandler.prototype.getSelectionPoints=function(e){return e.absolutePoints},mxEdgeHandler.prototype.createSelectionShape=function(e){return(e=new mxPolyline(e,this.getSelectionColor())).strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(e){return!0},mxEdgeHandler.prototype.createMarker=function(){var e=new mxCellMarker(this.graph),a=this;return e.getCell=function(e){var t=mxCellMarker.prototype.getCell.apply(this,arguments);if(!a.isConnectableCell(t))return null;var n=a.graph.getModel();return(t==a.state.cell||null!=t&&!a.graph.connectableEdges&&n.isEdge(t))&&(t=null),t},e.isValidState=function(e){var t=a.graph.getModel();t=null!=(t=a.graph.view.getTerminalPort(e,a.graph.view.getState(t.getTerminal(a.state.cell,!a.isSource)),!a.isSource))?t.cell:null;return a.error=a.validateConnection(a.isSource?e.cell:t,a.isSource?t:e.cell),null==a.error},e},mxEdgeHandler.prototype.validateConnection=function(e,t){return this.graph.getEdgeValidationError(this.state.cell,e,t)},mxEdgeHandler.prototype.createBends=function(){for(var e=this.state.cell,t=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var a=n==this.abspoints.length-1;if((a=0==n||a)||this.graph.isCellBendable(e)){var i=this.createHandleShape(n);if(this.initBend(i),mxClient.IS_TOUCH&&i.node.setAttribute("pointer-events","none"),this.isHandleEnabled(n))if(mxClient.IS_TOUCH){var s=mxUtils.bind(this,function(e){return e=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),this.graph.view.getState(this.graph.getCellAt(e.x,e.y))});mxEvent.redirectMouseEvents(i.node,this.graph,s)}else i.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(i.node,this.graph,this.state);t.push(i),a||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}}return t},mxEdgeHandler.prototype.isHandleEnabled=function(e){return!0},mxEdgeHandler.prototype.isHandleVisible=function(e){return!0},mxEdgeHandler.prototype.createHandleShape=function(e){return null!=this.handleImage?new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src):(e=mxConstants.HANDLE_SIZE,this.preferHtml&&(e-=1),new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR))},mxEdgeHandler.prototype.initBend=function(e){this.preferHtml?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()))},mxEdgeHandler.prototype.getHandleForEvent=function(e){if(null!=this.bends)for(var t=this.tolerance,n=(t=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null,0);n<this.bends.length;n++)if((e.isSource(this.bends[n])||null!=t&&mxUtils.intersects(this.bends[n].bounds,t))&&"hidden"!=this.bends[n].node.style.visibility)return n;return!(e.isSource(this.labelShape)&&"hidden"!=this.labelShape.node.style.visibility||e.isSource(this.state.text))||(mxClient.IS_SF||mxClient.IS_GC)&&"SELECT"==e.getSource().nodeName?null:mxEvent.LABEL_HANDLE},mxEdgeHandler.prototype.mouseDown=function(e,t){var n=null;null!=(n=this.getHandleForEvent(t))&&!t.isConsumed()&&this.graph.isEnabled()&&!this.graph.isForceMarqueeEvent(t.getEvent())&&(this.removeEnabled&&this.isRemovePointEvent(t.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(t.getCell()))&&this.start(t.getX(),t.getY(),n),t.consume())},mxEdgeHandler.prototype.start=function(e,t,n){this.startX=e,this.startY=t,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(e=this.state.cell,(null==(t=this.graph.model.getTerminal(e,this.isSource))&&this.graph.isTerminalPointMovable(e,this.isSource)||null!=t&&this.graph.isCellDisconnectable(e,t,this.isSource))&&(this.index=n)):this.index=n},mxEdgeHandler.prototype.clonePreviewState=function(e,t){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.getPointForEvent=function(e){var n=new mxPoint(e.getGraphX(),e.getGraphY()),a=this.getSnapToTerminalTolerance(),t=this.graph.getView(),i=!1,s=!1;if(this.snapToTerminals&&0<a){var o=function(e){if(null!=e){var t=e.x;Math.abs(n.x-t)<a&&(n.x=t,i=!0),e=e.y,Math.abs(n.y-e)<a&&(n.y=e,s=!0)}},r=function(e){null!=e&&o.call(this,new mxPoint(t.getRoutingCenterX(e),t.getRoutingCenterY(e)))};if(r.call(this,this.state.getVisibleTerminalState(!0)),r.call(this,this.state.getVisibleTerminalState(!1)),null!=this.abspoints)for(r=0;r<this.abspoints;r++)r!=this.index&&o.call(this,this.abspoints[r])}return this.graph.isGridEnabledEvent(e.getEvent())&&(e=t.scale,r=t.translate,i||(n.x=(this.graph.snap(n.x/e-r.x)+r.x)*e),s||(n.y=(this.graph.snap(n.y/e-r.y)+r.y)*e)),n},mxEdgeHandler.prototype.getPreviewTerminalState=function(e){this.constraintHandler.update(e,this.isSource),this.marker.process(e),e=this.marker.getValidState();var t=null;return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint&&this.marker.reset(),null!=e?t=e:null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(t=this.constraintHandler.currentFocus),t},mxEdgeHandler.prototype.getPreviewPoints=function(e){var t=null!=(t=this.graph.getCellGeometry(this.state.cell)).points?t.points.slice():null;return this.isSource||this.isTarget?this.graph.resetEdgesOnConnect&&(t=null):(this.convertPoint(e,!1),null==t?t=[e]:t[this.index-1]=e),t},mxEdgeHandler.prototype.updatePreviewState=function(e,t,n){var a=this.isSource?n:this.state.getVisibleTerminalState(!0),i=this.isTarget?n:this.state.getVisibleTerminalState(!1),s=this.graph.getConnectionConstraint(e,a,!0),o=this.graph.getConnectionConstraint(e,i,!1),r=this.constraintHandler.currentConstraint;null==r&&(r=new mxConnectionConstraint),this.isSource?s=r:this.isTarget&&(o=r),(!this.isSource||null!=a)&&e.view.updateFixedTerminalPoint(e,a,!0,s),(!this.isTarget||null!=i)&&e.view.updateFixedTerminalPoint(e,i,!1,o),(this.isSource||this.isTarget)&&null==n&&(e.setAbsoluteTerminalPoint(t,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),e.view.updatePoints(e,this.points,a,i),e.view.updateFloatingTerminalPoints(e,a,i)},mxEdgeHandler.prototype.mouseMove=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.getPointForEvent(t);if(this.isLabel)this.label.x=n.x,this.label.y=n.y;else{this.points=this.getPreviewPoints(n);var a=this.isSource||this.isTarget?this.getPreviewTerminalState(t):null,i=this.clonePreviewState(n,null!=a?a.cell:null);this.updatePreviewState(i,n,a),this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor),this.abspoints=i.absolutePoints,this.active=!0}this.drawPreview(),mxEvent.consume(t.getEvent()),t.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(t)&&t.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(e,t){if(null!=this.index&&null!=this.marker){var n=this.state.cell;if(t.getX()!=this.startX||t.getY()!=this.startY)if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var a=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(a=this.constraintHandler.currentFocus.cell),null==a&&this.marker.hasValidState()&&(a=this.marker.validState.cell),null!=a)n=this.connect(n,a,this.isSource,this.graph.isCloneEvent(t.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable(),t);else if(this.graph.isAllowDanglingEdges()){(a=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=a.x/this.graph.view.scale-this.graph.view.translate.x,a.y=a.y/this.graph.view.scale-this.graph.view.translate.y;var i=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=i&&(a.x-=i.origin.x,a.y-=i.origin.y),a.x-=this.graph.panDx/this.graph.view.scale,a.y-=this.graph.panDy/this.graph.view.scale,this.changeTerminalPoint(n,a,this.isSource)}}else this.active?this.changePoints(n,this.points):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().revalidate(this.state.cell));null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),t.consume()}},mxEdgeHandler.prototype.reset=function(){this.points=this.label=this.index=this.error=null,this.isTarget=this.isSource=this.isLabel=this.active=!1,this.marker.reset(),this.constraintHandler.reset(),this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(e){null!=this.shape&&(this.shape.stroke=e)},mxEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate();return t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x),e.y=Math.round(e.y/n-a.y),null!=(n=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell)))&&(e.x-=n.origin.x,e.y-=n.origin.y),e},mxEdgeHandler.prototype.moveLabel=function(e,t,n){var a=this.graph.getModel();if(null!=(i=a.getGeometry(e.cell))){var i=i.clone(),s=this.graph.getView().getRelativePoint(e,t,n);i.x=s.x,i.y=s.y;var o=this.graph.getView().scale;i.offset=new mxPoint(0,0),s=this.graph.view.getPoint(e,i),i.offset=new mxPoint((t-s.x)/o,(n-s.y)/o),a.setGeometry(e.cell,i)}},mxEdgeHandler.prototype.connect=function(e,t,n,a,i){var s=(i=this.graph.getModel()).getParent(e);i.beginUpdate();try{if(a){var o=e.clone();i.add(s,o,i.getChildCount(s));var r=i.getTerminal(e,!n);this.graph.connectCell(o,r,!n),e=o}var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(e,t,n,l)}finally{i.endUpdate()}return e},mxEdgeHandler.prototype.changeTerminalPoint=function(e,t,n){var a=this.graph.getModel(),i=a.getGeometry(e);if(null!=i){a.beginUpdate();try{(i=i.clone()).setTerminalPoint(t,n),a.setGeometry(e,i),this.graph.connectCell(e,null,n,new mxConnectionConstraint)}finally{a.endUpdate()}}},mxEdgeHandler.prototype.changePoints=function(e,t){var n=this.graph.getModel(),a=n.getGeometry(e);null!=a&&((a=a.clone()).points=t,n.setGeometry(e,a))},mxEdgeHandler.prototype.addPoint=function(e,t){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),a=this.graph.isGridEnabledEvent(t);this.convertPoint(n,a),this.addPointAt(e,n.x,n.y),mxEvent.consume(t)},mxEdgeHandler.prototype.addPointAt=function(e,t,n){var a=this.graph.getCellGeometry(e.cell);if(t=new mxPoint(t,n),null!=a){a=a.clone(),n=this.graph.view.translate;var i=this.graph.view.scale;n=mxUtils.findNearestSegment(e,(t.x+n.x)*i,(t.y+n.y)*i),null==a.points?a.points=[t]:a.points.splice(n,0,t),this.graph.getModel().setGeometry(e.cell,a),this.destroy(),this.init()}},mxEdgeHandler.prototype.removePoint=function(e,t){if(0<t&&t<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(t-1,1),this.graph.getModel().setGeometry(e.cell,n),this.destroy(),this.init())}},mxEdgeHandler.prototype.getHandleFillColor=function(e){e=0==e;var t=this.state.cell,n=this.graph.getModel().getTerminal(t,e),a=mxConstants.HANDLE_FILLCOLOR;return null!=n&&!this.graph.isCellDisconnectable(t,n,e)||null==n&&!this.graph.isTerminalPointMovable(t,e)?a=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=n&&this.graph.isCellDisconnectable(t,n,e)&&(a=mxConstants.CONNECT_HANDLE_FILLCOLOR),a},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice();var e=this.state.cell,t=mxConstants.LABEL_HANDLE_SIZE;if(this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-t/2),Math.round(this.label.y-t/2),t,t),this.labelShape.redraw(),null!=(t=this.graph.getLabel(e))&&0<t.length&&this.graph.isLabelMovable(e)?this.labelShape.node.style.visibility="visible":this.labelShape.node.style.visibility="hidden",null!=this.bends&&0<this.bends.length){var n=this.abspoints.length-1,a=(e=this.abspoints[0],this.abspoints[0].y);t=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.round(this.abspoints[0].x-t.width/2),Math.round(a-t.height/2),t.width,t.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw();a=this.abspoints[n];var i=this.abspoints[n].x,s=(n=this.abspoints[n].y,this.bends.length-1);t=this.bends[s].bounds;this.bends[s].bounds=new mxRectangle(Math.round(i-t.width/2),Math.round(n-t.height/2),t.width,t.height),this.bends[s].fill=this.getHandleFillColor(s),this.bends[s].redraw(),this.redrawInnerBends(e,a)}this.drawPreview()},mxEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=n){null==this.points&&(this.points=[]);for(var a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){var i=this.abspoints[a].x,s=this.abspoints[a].y,o=this.bends[a].bounds;this.bends[a].node.style.visibility="visible",this.bends[a].bounds=new mxRectangle(Math.round(i-o.width/2),Math.round(s-o.height/2),o.width,o.height),this.bends[a].redraw(),this.points[a-1]=n[a-1]}else this.bends[a].destroy(),this.bends[a]=null}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var e=mxConstants.LABEL_HANDLE_SIZE;e=new mxRectangle(Math.round(this.label.x-e/2),Math.round(this.label.y-e/2),e,e);this.labelShape.bounds=e,this.labelShape.redraw()}else this.shape.points=this.abspoints,this.shape.redraw()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.bends)for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null)},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype=new mxEdgeHandler,mxElbowEdgeHandler.prototype.constructor=mxElbowEdgeHandler,mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);return this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e.push(this.createVirtualBend()),this.points.push(new mxPoint(0,0)),t=this.createHandleShape(2),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxElbowEdgeHandler.prototype.createVirtualBend=function(){var e=this.createHandleShape();this.initBend(e);var t=this.getCursorForBend();return e.node.style.cursor=t,t=mxUtils.bind(this,function(e){!mxEvent.isConsumed(e)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,e),mxEvent.consume(e))}),mxEvent.redirectMouseEvents(e.node,this.graph,this.state,null,null,null,t),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(e){var t=null;return null==this.bends||null==this.bends[1]||e!=this.bends[1].node&&e.parentNode!=this.bends[1].node||(t=this.doubleClickOrientationResource,t=mxResources.get(t)||t),t},mxElbowEdgeHandler.prototype.convertPoint=function(e,t){var n=this.graph.getView().getScale(),a=this.graph.getView().getTranslate(),i=this.state.origin;t&&(e.x=this.graph.snap(e.x),e.y=this.graph.snap(e.y)),e.x=Math.round(e.x/n-a.x-i.x),e.y=Math.round(e.y/n-a.y-i.y)},mxElbowEdgeHandler.prototype.redrawInnerBends=function(e,t){var n=null==(n=null!=(n=this.graph.getModel().getGeometry(this.state.cell).points)?n[0]:null)?new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2):new mxPoint(this.graph.getView().scale*(n.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(n.y+this.graph.getView().translate.y+this.state.origin.y)),a=(i=this.bends[1].bounds).width,i=i.height;null==this.handleImage&&(i=a=mxConstants.HANDLE_SIZE);var s=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i);null==this.handleImage&&"hidden"!=this.labelShape.node.style.visibility&&mxUtils.intersects(s,this.labelShape.bounds)&&(a+=3,i+=3,s=new mxRectangle(Math.round(n.x-a/2),Math.round(n.y-i/2),a,i)),this.bends[1].bounds=s,this.bends[1].redraw()},mxUtils.extend(mxEdgeSegmentHandler,mxEdgeHandler),mxEdgeSegmentHandler.prototype=new mxElbowEdgeHandler,mxEdgeSegmentHandler.prototype.constructor=mxEdgeSegmentHandler,mxEdgeSegmentHandler.prototype.getPreviewPoints=function(e){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);this.convertPoint(e,!1);var t=this.state.absolutePoints,n=t[0].clone();this.convertPoint(n,!1);for(var a=[],i=1;i<t.length;i++){var s=t[i].clone();this.convertPoint(s,!1),i==this.index&&(n.x==s.x?(n.x=e.x,s.x=e.x):(n.y=e.y,s.y=e.y)),i<t.length-1&&a.push(s),n=s}if(1==a.length){if(n=this.state.view,i=this.state.getVisibleTerminalState(!0),null!=(s=this.state.getVisibleTerminalState(!1))&null!=i){var o=this.state.origin.x,r=this.state.origin.y;mxUtils.contains(s,a[0].x+o,a[0].y+r)?t[1].y==t[2].y?a[0].y=n.getRoutingCenterY(i)-r:a[0].x=n.getRoutingCenterX(i)-o:mxUtils.contains(i,a[0].x+o,a[0].y+r)&&(t[1].y==t[0].y?a[0].y=n.getRoutingCenterY(s)-r:a[0].x=n.getRoutingCenterX(s)-o)}}else 0==a.length&&(a=[e]);return a},mxEdgeSegmentHandler.prototype.createBends=function(){var e=[],t=this.createHandleShape(0);this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none");var n=this.state.absolutePoints;if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var a=0;a<n.length-1;a++)t=this.createVirtualBend(),e.push(t),t.node.style.cursor=0==n[a].x-n[a+1].x?"col-resize":"row-resize",this.points.push(new mxPoint(0,0)),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")}return t=this.createHandleShape(n.length),this.initBend(t),t.node.style.cursor=mxConstants.CURSOR_BEND_HANDLE,mxEvent.redirectMouseEvents(t.node,this.graph,this.state),e.push(t),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none"),e},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.refresh=function(){if(null!=this.bends){for(var e=0;e<this.bends.length;e++)null!=this.bends[e]&&(this.bends[e].destroy(),this.bends[e]=null);this.bends=this.createBends()}},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(e,t){if(this.graph.isCellBendable(this.state.cell)){var n=mxConstants.HANDLE_SIZE,a=this.state.absolutePoints;if(null!=a&&1<a.length)for(var i=0;i<this.state.absolutePoints.length-1;i++)if(null!=this.bends[i+1]){e=a[i],t=a[i+1];var s=new mxPoint(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2);this.bends[i+1].bounds=new mxRectangle(Math.round(s.x-n/2),Math.round(s.y-n/2),n,n),this.bends[i+1].redraw()}}},mxEdgeSegmentHandler.prototype.changePoints=function(e,t){t=[];var n=this.abspoints;if(1<n.length)for(var a=n[0],i=n[1],s=2;s<n.length;s++){var o=n[s];Math.round(a.x)==Math.round(i.x)&&Math.round(i.x)==Math.round(o.x)||Math.round(a.y)==Math.round(i.y)&&Math.round(i.y)==Math.round(o.y)||(i=(a=i).clone(),this.convertPoint(i,!1),t.push(i)),i=o}mxElbowEdgeHandler.prototype.changePoints.apply(this,arguments)},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(e){this.enabled=e},mxKeyHandler.prototype.bindKey=function(e,t){this.normalKeys[e]=t},mxKeyHandler.prototype.bindShiftKey=function(e,t){this.shiftKeys[e]=t},mxKeyHandler.prototype.bindControlKey=function(e,t){this.controlKeys[e]=t},mxKeyHandler.prototype.bindControlShiftKey=function(e,t){this.controlShiftKeys[e]=t},mxKeyHandler.prototype.isControlDown=function(e){return mxEvent.isControlDown(e)},mxKeyHandler.prototype.getFunction=function(e){return null!=e?this.isControlDown(e)?mxEvent.isShiftDown(e)?this.controlShiftKeys[e.keyCode]:this.controlKeys[e.keyCode]:mxEvent.isShiftDown(e)?this.shiftKeys[e.keyCode]:this.normalKeys[e.keyCode]:null},mxKeyHandler.prototype.isGraphEvent=function(e){if((e=mxEvent.getSource(e))==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&e==this.graph.cellEditor.textarea)return!0;for(;null!=e;){if(e==this.graph.container)return!0;e=e.parentNode}return!1},mxKeyHandler.prototype.keyDown=function(e){if(this.graph.isEnabled()&&!mxEvent.isConsumed(e)&&this.isGraphEvent(e)&&this.isEnabled())if(27==e.keyCode)this.escape(e);else if(!this.graph.isEditing()){var t=this.getFunction(e);null!=t&&(t(e),mxEvent.consume(e))}},mxKeyHandler.prototype.escape=function(e){this.graph.isEscapeEnabled()&&this.graph.escape(e)},mxKeyHandler.prototype.destroy=function(){this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(e){this.enabled=e},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(e){this.hideOnHover=e},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",this.div.style.zIndex=this.zIndex,document.body.appendChild(this.div),mxEvent.addListener(this.div,"mousedown",mxUtils.bind(this,function(e){this.hideTooltip()})))},mxTooltipHandler.prototype.mouseDown=function(e,t){this.reset(t,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(e,t){t.getX()==this.lastX&&t.getY()==this.lastY||(this.reset(t,!0),(this.isHideOnHover()||t.getState()!=this.state||t.getSource()!=this.node&&(!this.stateSource||null!=t.getState()&&this.stateSource==(t.isSource(t.getState().shape)||!t.isSource(t.getState().text))))&&this.hideTooltip()),this.lastX=t.getX(),this.lastY=t.getY()},mxTooltipHandler.prototype.mouseUp=function(e,t){this.reset(t,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(e,t){if(this.resetTimer(),t&&this.isEnabled()&&null!=e.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var n=e.getState(),a=e.getSource(),i=e.getX(),s=e.getY(),o=e.isSource(n.shape)||e.isSource(n.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.panningHandler.isMenuShowing()){var e=this.graph.getTooltip(n,a,i,s);this.show(e,i,s),this.state=n,this.node=a,this.stateSource=o}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")},mxTooltipHandler.prototype.show=function(e,t,n){if(null!=e&&0<e.length){null==this.div&&this.init();var a=mxUtils.getScrollOrigin();this.div.style.left=t+a.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+a.y+"px",mxUtils.isNode(e)?(this.div.innerHTML="",this.div.appendChild(e)):this.div.innerHTML=e.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(e,t){},mxCellTracker.prototype.mouseMove=function(e,t){this.isEnabled()&&this.process(t)},mxCellTracker.prototype.mouseUp=function(e,t){this.reset()},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(e){this.highlightColor=e,null!=this.shape&&(this.shape.stroke=e)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var e=null;return(e=this.graph.model.isEdge(this.state.cell)?new mxPolyline(this.state.absolutePoints,this.highlightColor,this.strokeWidth):new mxRectangleShape(new mxRectangle,null,this.highlightColor,this.strokeWidth)).dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(e.node,this.graph,this.state),e.svgStrokeTolerance=0,e.pointerEvents=!1,e.isDashed=this.dashed,e},mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){var e=0;this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),e=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),0!=e&&(this.shape.rotation=e),this.shape.redraw()}},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(e){this.state!=e&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=e,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(t)});n?this.handler.bindControlKey(e,a):this.handler.bindKey(e,a)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(e,t,n,a){if(null!=this.config){var i=this.createConditions(e,n,a);this.addItems(e,t,n,a,i,this.config.firstChild,null)}},mxDefaultPopupMenu.prototype.addItems=function(e,t,n,a,i,s,o){for(var r=!1;null!=s;){if("add"==s.nodeName){if(null==(l=s.getAttribute("if"))||i[l]){var l=s.getAttribute("as"),d=(l=mxResources.get(l)||l,mxUtils.eval(mxUtils.getTextContent(s))),c=s.getAttribute("action"),m=s.getAttribute("icon"),u=s.getAttribute("iconCls");r&&(t.addSeparator(o),r=!1),null!=m&&this.imageBasePath&&(m=this.imageBasePath+m),l=this.addAction(t,e,l,m,d,c,n,o,u),this.addItems(e,t,n,a,i,s.firstChild,l)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(e,t,n,a,i,s,o,r,l){return e.addItem(n,a,function(e){"function"==typeof i&&i.call(t,t,o,e),null!=s&&t.execute(s,o,e)},r,l)},mxDefaultPopupMenu.prototype.createConditions=function(e,t,n){var a=e.graph.getModel(),i=a.getChildCount(t),s=[];for(s.nocell=null==t,s.ncells=1<e.graph.getSelectionCount(),s.notRoot=a.getRoot()!=a.getParent(e.graph.getDefaultParent()),s.cell=null!=t,a=null!=t&&1==e.graph.getSelectionCount(),s.nonEmpty=a&&0<i,s.expandable=a&&e.graph.isCellFoldable(t,!1),s.collapsable=a&&e.graph.isCellFoldable(t,!0),s.validRoot=a&&e.graph.isValidRoot(t),s.emptyValidRoot=s.validRoot&&0==i,s.swimlane=a&&e.graph.isSwimlane(t),i=this.config.getElementsByTagName("condition"),a=0;a<i.length;a++){var o=mxUtils.eval(mxUtils.getTextContent(i[a])),r=i[a].getAttribute("name");null!=r&&"function"==typeof o&&(s[r]=o(e,t,n))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(e){null!=e&&(this.toolbar=new mxToolbar(e),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(e,t){var n=t.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(e,t,n,a){var i=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(e,t,i,a)},mxDefaultToolbar.prototype.addSeparator=function(e){e=e||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(e)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(e){return this.toolbar.addActionCombo(e)},mxDefaultToolbar.prototype.addActionOption=function(e,t,n){var a=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(e,t,a)},mxDefaultToolbar.prototype.addOption=function(e,t,n){return this.toolbar.addOption(e,t,n)},mxDefaultToolbar.prototype.addMode=function(e,t,n,a,i){var s=mxUtils.bind(this,function(){this.editor.setMode(n),null!=i&&i(this.editor)});return this.toolbar.addSwitchMode(e,t,s,a)},mxDefaultToolbar.prototype.addPrototype=function(e,t,n,a,i,s){var o=function(){return"function"==typeof n?n():null!=n?n.clone():null},r=mxUtils.bind(this,function(e,t){"function"==typeof i?i(this.editor,o(),e,t):this.drop(o(),e,t),this.toolbar.resetMode(),mxEvent.consume(e)});return e=this.toolbar.addMode(e,t,r,a,null,s),this.installDropHandler(e,function(e,t,n){r(t,n)}),e},mxDefaultToolbar.prototype.drop=function(e,t,n){var a=this.editor.graph,i=a.getModel();if(null!=n&&!i.isEdge(n)&&this.connectOnDrop&&a.isCellConnectable(n))this.connect(e,t,n);else{for(;null!=n&&!a.isValidDropTarget(n,[e],t);)n=i.getParent(n);this.insert(e,t,n)}},mxDefaultToolbar.prototype.insert=function(e,t,n){var a=this.editor.graph;if(a.canImportCell(e)){var i=mxEvent.getClientX(t),s=mxEvent.getClientY(t);i=mxUtils.convertPoint(a.container,i,s);return a.isSplitEnabled()&&a.isSplitTarget(n,[e],t)?a.splitEdge(n,[e],null,i.x,i.y):this.editor.addVertex(n,e,i.x,i.y)}return null},mxDefaultToolbar.prototype.connect=function(e,t,n){var a=(t=this.editor.graph).getModel();if(null!=n&&t.isCellConnectable(e)&&t.isEdgeValid(null,n,e)){var i=null;a.beginUpdate();try{var s=a.getGeometry(n),o=a.getGeometry(e).clone();o.x=s.x+(s.width-o.width)/2,o.y=s.y+(s.height-o.height)/2;var r=this.spacing*t.gridSize,l=20*a.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?o.x+=(o.width+s.width)/2+r+l:o.y+=(o.height+s.height)/2+r+l,e.setGeometry(o);var d=a.getParent(n);if(t.addCell(e,d),t.constrainChild(e),i=this.editor.createEdge(n,e),null==a.getGeometry(i)){var c=new mxGeometry;c.relative=!0,a.setGeometry(i,c)}t.addEdge(i,d,n,e)}finally{a.endUpdate()}t.setSelectionCells([e,i]),t.scrollCellToVisible(e)}},mxDefaultToolbar.prototype.installDropHandler=function(t,n){var a=document.createElement("img");a.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,function(e){a.style.width=2*t.offsetWidth+"px",a.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,n,a),mxEvent.removeListener(a,"load",i)});mxClient.IS_IE?i():mxEvent.addListener(a,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.session=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.urlInit=null,mxEditor.prototype.urlNotify=null,mxEditor.prototype.urlPoll=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(e){this.modified=e},mxEditor.prototype.addActions=function(){this.addAction("save",function(e){e.save()}),this.addAction("print",function(e){new mxPrintPreview(e.graph,1).open()}),this.addAction("show",function(e){mxUtils.show(e.graph,null,10,10)}),this.addAction("exportImage",function(e){var t=e.getUrlImage();if(null==t||mxClient.IS_LOCAL)e.execute("show");else{var n=mxUtils.getViewXml(e.graph,1);n=mxUtils.getXml(n,"\n");mxUtils.submit(t,e.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}),this.addAction("refresh",function(e){e.graph.refresh()}),this.addAction("cut",function(e){e.graph.isEnabled()&&mxClipboard.cut(e.graph)}),this.addAction("copy",function(e){e.graph.isEnabled()&&mxClipboard.copy(e.graph)}),this.addAction("paste",function(e){e.graph.isEnabled()&&mxClipboard.paste(e.graph)}),this.addAction("delete",function(e){e.graph.isEnabled()&&e.graph.removeCells()}),this.addAction("group",function(e){e.graph.isEnabled()&&e.graph.setSelectionCell(e.groupCells())}),this.addAction("ungroup",function(e){e.graph.isEnabled()&&e.graph.setSelectionCells(e.graph.ungroupCells())}),this.addAction("removeFromParent",function(e){e.graph.isEnabled()&&e.graph.removeCellsFromParent()}),this.addAction("undo",function(e){e.graph.isEnabled()&&e.undo()}),this.addAction("redo",function(e){e.graph.isEnabled()&&e.redo()}),this.addAction("zoomIn",function(e){e.graph.zoomIn()}),this.addAction("zoomOut",function(e){e.graph.zoomOut()}),this.addAction("actualSize",function(e){e.graph.zoomActual()}),this.addAction("fit",function(e){e.graph.fit()}),this.addAction("showProperties",function(e,t){e.showProperties(t)}),this.addAction("selectAll",function(e){e.graph.isEnabled()&&e.graph.selectAll()}),this.addAction("selectNone",function(e){e.graph.isEnabled()&&e.graph.clearSelection()}),this.addAction("selectVertices",function(e){e.graph.isEnabled()&&e.graph.selectVertices()}),this.addAction("selectEdges",function(e){e.graph.isEnabled()&&e.graph.selectEdges()}),this.addAction("edit",function(e,t){e.graph.isEnabled()&&e.graph.isCellEditable(t)&&e.graph.startEditingAtCell(t)}),this.addAction("toBack",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!0)}),this.addAction("toFront",function(e,t){e.graph.isEnabled()&&e.graph.orderCells(!1)}),this.addAction("enterGroup",function(e,t){e.graph.enterGroup(t)}),this.addAction("exitGroup",function(e){e.graph.exitGroup()}),this.addAction("home",function(e){e.graph.home()}),this.addAction("selectPrevious",function(e){e.graph.isEnabled()&&e.graph.selectPreviousCell()}),this.addAction("selectNext",function(e){e.graph.isEnabled()&&e.graph.selectNextCell()}),this.addAction("selectParent",function(e){e.graph.isEnabled()&&e.graph.selectParentCell()}),this.addAction("selectChild",function(e){e.graph.isEnabled()&&e.graph.selectChildCell()}),this.addAction("collapse",function(e){e.graph.isEnabled()&&e.graph.foldCells(!0)}),this.addAction("collapseAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!0,!1,t)}}),this.addAction("expand",function(e){e.graph.isEnabled()&&e.graph.foldCells(!1)}),this.addAction("expandAll",function(e){if(e.graph.isEnabled()){var t=e.graph.getChildVertices();e.graph.foldCells(!1,!1,t)}}),this.addAction("bold",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("shadow",function(e){e.graph.isEnabled()&&e.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_SHADOW)}),this.addAction("alignCellsLeft",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(e){e.graph.isEnabled()&&e.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(e){e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(e){e.graph.isEnabled()&&e.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(e){var t=100*e.graph.getView().scale;t=parseFloat(mxUtils.prompt(mxResources.get(e.askZoomResource)||e.askZoomResource,t))/100;isNaN(t)||e.graph.getView().setScale(t)}),this.addAction("toggleTasks",function(e){null!=e.tasks?e.tasks.setVisible(!e.tasks.isVisible()):e.showTasks()}),this.addAction("toggleHelp",function(e){null!=e.help?e.help.setVisible(!e.help.isVisible()):e.showHelp()}),this.addAction("toggleOutline",function(e){null==e.outline?e.showOutline():e.outline.setVisible(!e.outline.isVisible())}),this.addAction("toggleConsole",function(e){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.createSession=function(){var e=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.SESSION,"session",e))});return this.connect(this.urlInit,this.urlPoll,this.urlNotify,e)},mxEditor.prototype.configure=function(e){null!=e&&(new mxCodec(e.ownerDocument).decode(e,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(e,t){this.actions[e]=t},mxEditor.prototype.execute=function(t,e,n){var a=this.actions[t];if(null!=a)try{var i=arguments;i[0]=this,a.apply(this,i)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(e,t){this.templates[e]=t},mxEditor.prototype.getTemplate=function(e){return this.templates[e]},mxEditor.prototype.createGraph=function(){var e=new mxGraph(null,null,this.graphRenderHint);return e.setTooltips(!0),e.setPanning(!0),this.installDblClickHandler(e),this.installUndoHandler(e),this.installDrillHandler(e),this.installChangeHandler(e),this.installInsertHandler(e),e.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){return this.createPopupMenu(e,t,n)}),e.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,t){return this.createEdge(e,t)}),this.createSwimlaneManager(e),this.createLayoutManager(e),e},mxEditor.prototype.createSwimlaneManager=function(e){return(e=new mxSwimlaneManager(e,!1)).isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(a){var e=new mxLayoutManager(a),i=this;return e.getLayout=function(e){var t=null,n=i.graph.getModel();return null!=n.getParent(e)&&(i.layoutSwimlanes&&a.isSwimlane(e)?(null==i.swimlaneLayout&&(i.swimlaneLayout=i.createSwimlaneLayout()),t=i.swimlaneLayout):i.layoutDiagram&&(a.isValidRoot(e)||null==n.getParent(n.getParent(e)))&&(null==i.diagramLayout&&(i.diagramLayout=i.createDiagramLayout()),t=i.diagramLayout)),t},e},mxEditor.prototype.setGraphContainer=function(e){null==this.graph.container&&(this.graph.init(e),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(e),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.installDblClickHandler=function(a){a.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,t){var n=t.getProperty("cell");null!=n&&a.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),t.consume())}))},mxEditor.prototype.installUndoHandler=function(a){var e=mxUtils.bind(this,function(e,t){var n=t.getProperty("edit");this.undoManager.undoableEditHappened(n)});a.getModel().addListener(mxEvent.UNDO,e),a.getView().addListener(mxEvent.UNDO,e),e=function(e,t){var n=t.getProperty("edit").changes;a.setSelectionCells(a.getSelectionCellsForChanges(n))},this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(e){var t=mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.ROOT))});e.getView().addListener(mxEvent.DOWN,t),e.getView().addListener(mxEvent.UP,t)},mxEditor.prototype.installChangeHandler=function(s){var e=mxUtils.bind(this,function(e,t){this.setModified(!0),1==this.validating&&s.validateGraph();for(var n=t.getProperty("edit").changes,a=0;a<n.length;a++){var i=n[a];if(i instanceof mxRootChange||i instanceof mxValueChange&&i.cell==this.graph.model.root||i instanceof mxCellAttributeChange&&i.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,e)},mxEditor.prototype.installInsertHandler=function(e){var n=this;e.addMouseListener({mouseDown:function(e,t){null==n.insertFunction||t.isPopupTrigger()||!n.forcedInserting&&null!=t.getState()||(n.graph.clearSelection(),n.insertFunction(t.getEvent(),t.getCell()),this.isActive=!0,t.consume())},mouseMove:function(e,t){this.isActive&&t.consume()},mouseUp:function(e,t){this.isActive&&(this.isActive=!1,t.consume())}})},mxEditor.prototype.createDiagramLayout=function(){var e=this.graph.gridSize,t=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*e,2*e);return t.isVertexIgnored=function(e){return!t.graph.isSwimlane(e)},t},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(e){this.toolbar.init(e),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.setStatusContainer=function(e){null==this.status&&(this.status=e,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var e=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+e)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(e))},mxEditor.prototype.setStatus=function(e){null!=this.status&&null!=e&&(this.status.innerHTML=e)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(e){t.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(e,t){null!=e&&new mxCompactTreeLayout(this.graph,t).execute(e)},mxEditor.prototype.getTitle=function(){for(var e="",t=this.graph,n=t.getCurrentRoot();null!=n&&null!=t.getModel().getParent(t.getModel().getParent(n));)t.isValidRoot(n)&&(e=" > "+t.convertValueToString(n)+e),n=t.getModel().getParent(n);return this.getRootTitle()+e},mxEditor.prototype.getRootTitle=function(){var e=this.graph.getModel().getRoot();return this.graph.convertValueToString(e)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var e=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),e)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(e){if(null!=e){var t=mxUtils.load(e).getXml();this.readGraphModel(t.documentElement),this.filename=e,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",e))}},mxEditor.prototype.readGraphModel=function(e){new mxCodec(e.ownerDocument).decode(e,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(e,t){if(null!=(e=e||this.getUrlPost())&&0<e.length){var n=this.writeGraphModel(t);this.postDiagram(e,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",e))},mxEditor.prototype.postDiagram=function(t,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(t,this.postParameterName+"="+n,mxUtils.bind(this,function(e){this.fireEvent(new mxEventObject(mxEvent.POST,"request",e,"url",t,"data",n))}))},mxEditor.prototype.writeGraphModel=function(e){e=null!=e?e:this.linefeed;var t=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(t,e)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.connect=function(e,t,n,a){var i=null;return mxClient.IS_LOCAL||((i=new mxSession(this.graph.getModel(),e,t,n)).addListener(mxEvent.RECEIVE,mxUtils.bind(this,function(e,t){null!=t.getProperty("node").getAttribute("namespace")&&this.resetHistory()})),i.addListener(mxEvent.DISCONNECT,a),i.addListener(mxEvent.CONNECT,a),i.addListener(mxEvent.NOTIFY,a),i.addListener(mxEvent.GET,a),i.start()),i},mxEditor.prototype.swapStyles=function(e,t){var n=this.graph.getStylesheet().styles[t];this.graph.getView().getStylesheet().putCellStyle(t,this.graph.getStylesheet().styles[e]),this.graph.getStylesheet().putCellStyle(e,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(e){if(null==(e=e||this.graph.getSelectionCell())&&(null==(e=this.graph.getCurrentRoot())&&(e=this.graph.getModel().getRoot())),null!=e){this.graph.stopEditing(!0);var t=(n=mxUtils.getOffset(this.graph.container)).x+10,n=n.y;if(null==this.properties||this.movePropertiesDialog){var a=this.graph.getCellBounds(e);null!=a&&(t+=a.x+Math.min(200,a.width),n+=a.y)}else t=this.properties.getX(),n=this.properties.getY();this.hideProperties(),null!=(e=this.createProperties(e))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,e,t,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var a=this.graph.getModel(),e=a.getValue(n);if(mxUtils.isNode(e)){var t=new mxForm("properties");t.addText("ID",n.getId()).setAttribute("readonly","true");var i=null,s=null,o=null,r=null,l=null;a.isVertex(n)&&(null!=(i=a.getGeometry(n))&&(s=t.addText("top",i.y),o=t.addText("left",i.x),r=t.addText("width",i.width),l=t.addText("height",i.height)));var d=a.getStyle(n),c=t.addText("Style",d||""),m=e.attributes,u=[];for(e=0;e<m.length;e++)u[e]=t.addTextarea(m[e].nodeName,m[e].nodeValue,"label"==m[e].nodeName?4:2);return e=mxUtils.bind(this,function(){this.hideProperties(),a.beginUpdate();try{null!=i&&((i=i.clone()).x=parseFloat(o.value),i.y=parseFloat(s.value),i.width=parseFloat(r.value),i.height=parseFloat(l.value),a.setGeometry(n,i)),0<c.value.length?a.setStyle(n,c.value):a.setStyle(n,null);for(var e=0;e<m.length;e++){var t=new mxCellAttributeChange(n,m[e].nodeName,u[e].value);a.execute(t)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{a.endUpdate()}}),d=mxUtils.bind(this,function(){this.hideProperties()}),t.addButtons(e,d),t.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth;(e=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200)).setClosable(!0),e.destroyOnClose=!1;var n=mxUtils.bind(this,function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)});this.graph.getModel().addListener(mxEvent.CHANGE,n),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n),this.graph.addListener(mxEvent.ROOT,n),null!=this.tasksWindowImage&&e.setImage(this.tasksWindowImage),this.tasks=e,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(e){null!=this.tasks&&(e=this.tasks.content,mxEvent.release(e),e.innerHTML="",this.createTasks(e))},mxEditor.prototype.createTasks=function(e){},mxEditor.prototype.showHelp=function(e){if(null==this.help){var t=document.createElement("iframe");t.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("frameBorder","0"),t.style.backgroundColor="white",e=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,t,(e-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);a.setMaximizable(!0),a.setClosable(!0),a.destroyOnClose=!1,a.setResizable(!0),null!=this.helpWindowImage&&a.setImage(this.helpWindowImage),mxClient.IS_NS&&(e=function(e){t.setAttribute("height",a.div.offsetHeight-26+"px")},a.addListener(mxEvent.RESIZE_END,e),a.addListener(mxEvent.MAXIMIZE,e),a.addListener(mxEvent.NORMALIZE,e),a.addListener(mxEvent.SHOW,e)),this.help=a}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var e=document.createElement("div");e.style.overflow="hidden",e.style.width="100%",e.style.height="100%",e.style.background="white",e.style.cursor="move";var t=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,!1),n=new mxOutline(this.graph,e);t.setClosable(!0),t.setResizable(!0),t.destroyOnClose=!1,t.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=t,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(e){"select"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==e?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==e&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(e,t,n){this.popupHandler.createMenu(this,e,t,n)},mxEditor.prototype.createEdge=function(e,t){var n=null;if(null!=this.defaultEdge)n=this.graph.getModel().cloneCell(this.defaultEdge);else{(n=new mxCell("")).setEdge(!0);var a=new mxGeometry;a.relative=!0,n.setGeometry(a)}return null!=(a=this.getEdgeStyle())&&n.setStyle(a),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(e){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(e)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(e){if(null!=this.cycleAttributeName){var t=this.consumeCycleAttribute(e);null!=t&&e.setStyle(e.getStyle()+";"+this.cycleAttributeName+"="+t)}},mxEditor.prototype.addVertex=function(e,t,n,a){for(var i=this.graph.getModel();null!=e&&!this.graph.isValidDropTarget(e);)e=i.getParent(e);e=null!=e?e:this.graph.getSwimlaneAt(n,a);var s=this.graph.getView().scale,o=i.getGeometry(t),r=i.getGeometry(e);if(this.graph.isSwimlane(t)&&!this.graph.swimlaneNesting)e=null;else{if(null==e&&this.swimlaneRequired)return null;if(null!=e&&null!=r){var l=this.graph.getView().getState(e);if(null!=l){if(n-=l.origin.x*s,a-=l.origin.y*s,this.graph.isConstrainedMoving){r=o.width;var d=o.height,c=l.x+l.width;c<n+r&&(n-=n+r-c),(c=l.y+l.height)<a+d&&(a-=a+d-c)}}else null!=r&&(n-=r.x*s,a-=r.y*s)}}(o=o.clone()).x=this.graph.snap(n/s-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(a/s-this.graph.getView().translate.y-this.graph.gridSize/2),t.setGeometry(o),null==e&&(e=this.graph.getDefaultParent()),this.cycleAttribute(t),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",t,"parent",e)),i.beginUpdate();try{null!=(t=this.graph.addCell(t,e))&&(this.graph.constrainChild(t),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",t)))}finally{i.endUpdate()}return null!=t&&(this.graph.setSelectionCell(t),this.graph.scrollCellToVisible(t),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",t))),t},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.templates=this.status=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(e){if(null!=e){var t=e.getName();mxCodecRegistry.codecs[t]=e;var n=mxUtils.getFunctionName(e.template.constructor);n!=t&&mxCodecRegistry.addAlias(n,t)}return e},addAlias:function(e,t){mxCodecRegistry.aliases[e]=t},getCodec:function(e){var t=null;if(null!=e){t=mxUtils.getFunctionName(e);var n=mxCodecRegistry.aliases[t];if(null!=n&&(t=n),null==(t=mxCodecRegistry.codecs[t]))try{t=new mxObjectCodec(new e),mxCodecRegistry.register(t)}catch(e){}}return t}};function mxCodec(e){this.document=e||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(e,t,n,a){for(var i in this.template=e,this.exclude=null!=t?t:[],this.idrefs=null!=n?n:[],this.mapping=null!=a?a:[],this.reverse={},this.mapping)this.reverse[this.mapping[i]]=i}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(e,t){return this.objects[e]=t},mxCodec.prototype.getObject=function(e){var t=null;return null!=e&&(null==(t=this.objects[e])&&(null==(t=this.lookup(e))&&(null!=(e=this.getElementById(e))&&(t=this.decode(e))))),t},mxCodec.prototype.lookup=function(e){return null},mxCodec.prototype.getElementById=function(e,t){return mxUtils.findNodeByAttribute(this.document.documentElement,null!=t?t:"id",e)},mxCodec.prototype.getId=function(e){var t=null;return null!=e&&(null==(t=this.reference(e))&&e instanceof mxCell&&(null==(t=e.getId())&&(0==(t=mxCellPath.create(e)).length&&(t="root")))),t},mxCodec.prototype.reference=function(e){return null},mxCodec.prototype.encode=function(e){var t=null;if(null!=e&&null!=e.constructor){var n=mxCodecRegistry.getCodec(e.constructor);null!=n?t=n.encode(this,e):mxUtils.isNode(e)?t=mxClient.IS_IE?e.cloneNode(!0):this.document.importNode(e,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(e.constructor))}return t},mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=null;try{d=eval(a.nodeName)}catch(e){}try{var f=mxCodecRegistry.getCodec(d);null!=f?c=f.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}catch(e){mxLog.debug("Cannot decode "+a.nodeName+": "+e.message)}}return c},mxCodec.prototype.encodeCell=function(e,t,n){if(t.appendChild(this.encode(e)),null==n||n){n=e.getChildCount();for(var a=0;a<n;a++)this.encodeCell(e.getChildAt(a),t)}},mxCodec.prototype.isCellCodec=function(e){return null!=e&&"function"==typeof e.isCellCodec&&e.isCellCodec()},mxCodec.prototype.decodeCell=function(e,t){t=null==t||t;var n=null;if(null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT){if(n=mxCodecRegistry.getCodec(e.nodeName),!this.isCellCodec(n))for(var a=e.firstChild;null!=a&&!this.isCellCodec(n);)n=mxCodecRegistry.getCodec(a.nodeName),a=a.nextSibling;this.isCellCodec(n)||(n=mxCodecRegistry.getCodec(mxCell)),n=n.decode(this,e),t&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(e){var t=e.parent,n=e.getTerminal(!0),a=e.getTerminal(!1);e.setTerminal(null,!1),e.setTerminal(null,!0),(e.parent=null)!=t&&t.insert(e),null!=n&&n.insertEdge(e,!0),null!=a&&a.insertEdge(e,!1)},mxCodec.prototype.setAttribute=function(e,t,n){null!=t&&null!=n&&e.setAttribute(t,n)},mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(e){if(null!=e){var t=this.reverse[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.getAttributeName=function(e){if(null!=e){var t=this.mapping[e];null!=t&&(e=t)}return e},mxObjectCodec.prototype.isExcluded=function(e,t,n,a){return t==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,t)},mxObjectCodec.prototype.isReference=function(e,t,n,a){return 0<=mxUtils.indexOf(this.idrefs,t)},mxObjectCodec.prototype.encode=function(e,t){var n=e.document.createElement(this.getName());return t=this.beforeEncode(e,t,n),this.encodeObject(e,t,n),this.afterEncode(e,t,n)},mxObjectCodec.prototype.encodeObject=function(e,t,n){for(var a in e.setAttribute(n,"id",e.getId(t)),t){var i=a,s=t[i];null!=s&&!this.isExcluded(t,i,s,!0)&&(mxUtils.isNumeric(i)&&(i=null),this.encodeValue(e,t,i,s,n))}},mxObjectCodec.prototype.encodeValue=function(e,t,n,a,i){if(null!=a){if(this.isReference(t,n,a,!0)){var s=e.getId(a);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+a);a=s}s=this.template[n],(null==n||e.encodeDefaults||s!=a)&&(n=this.getAttributeName(n),this.writeAttribute(e,t,n,a,i))}},mxObjectCodec.prototype.writeAttribute=function(e,t,n,a,i){"object"!=typeof a?this.writePrimitiveAttribute(e,t,n,a,i):this.writeComplexAttribute(e,t,n,a,i)},mxObjectCodec.prototype.writePrimitiveAttribute=function(e,t,n,a,i){a=this.convertValueToXml(a),null==n?(t=e.document.createElement("add"),"function"==typeof a?t.appendChild(e.document.createTextNode(a)):e.setAttribute(t,"value",a),i.appendChild(t)):"function"!=typeof a&&e.setAttribute(i,n,a)},mxObjectCodec.prototype.writeComplexAttribute=function(e,t,n,a,i){null!=(e=e.encode(a))?(null!=n&&e.setAttribute("as",n),i.appendChild(e)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+a)},mxObjectCodec.prototype.convertValueToXml=function(e){return void 0!==e.length||1!=e&&0!=e||(e=1==e?"1":"0"),e},mxObjectCodec.prototype.convertValueFromXml=function(e){return mxUtils.isNumeric(e)&&(e=parseFloat(e)),e},mxObjectCodec.prototype.beforeEncode=function(e,t,n){return t},mxObjectCodec.prototype.afterEncode=function(e,t,n){return n},mxObjectCodec.prototype.decode=function(e,t,n){var a=t.getAttribute("id"),i=e.objects[a];return null==i&&(i=n||this.cloneTemplate(),null!=a&&e.putObject(a,i)),t=this.beforeDecode(e,t,i),this.decodeNode(e,t,i),this.afterDecode(e,t,i)},mxObjectCodec.prototype.decodeNode=function(e,t,n){null!=t&&(this.decodeAttributes(e,t,n),this.decodeChildren(e,t,n))},mxObjectCodec.prototype.decodeAttributes=function(e,t,n){if(null!=(t=t.attributes))for(var a=0;a<t.length;a++)this.decodeAttribute(e,t[a],n)},mxObjectCodec.prototype.decodeAttribute=function(e,t,n){var a=t.nodeName;if("as"!=a&&"id"!=a){t="value"==a?t.nodeValue:this.convertValueFromXml(t.nodeValue);var i=this.getFieldName(a);if(this.isReference(n,i,t,!1)){if(null==(e=e.getObject(t)))return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+a+"="+t);t=e}this.isExcluded(n,a,t,!1)||(n[a]=t)}},mxObjectCodec.prototype.decodeChildren=function(e,t,n){for(t=t.firstChild;null!=t;){var a=t.nextSibling;t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n)&&this.decodeChild(e,t,n),t=a}},mxObjectCodec.prototype.decodeChild=function(e,t,n){var a=this.getFieldName(t.getAttribute("as"));if(null==a||!this.isExcluded(n,a,t,!1)){var i=this.getFieldTemplate(n,a,t),s=null;"add"==t.nodeName?null==(s=t.getAttribute("value"))&&(s=mxUtils.eval(mxUtils.getTextContent(t))):s=e.decode(t,i),this.addObjectValue(n,a,s,i)}},mxObjectCodec.prototype.getFieldTemplate=function(e,t,n){return(e=e[t])instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(e,t,n,a){null!=n&&n!=a&&(null!=t&&0<t.length?e[t]=n:e.push(n))},mxObjectCodec.prototype.processInclude=function(e,t,n){if("include"!=t.nodeName)return!1;if(null!=(t=t.getAttribute("name")))try{var a=mxUtils.load(t).getDocumentElement();null!=a&&e.decode(a,n)}catch(e){}return!0},mxObjectCodec.prototype.beforeDecode=function(e,t,n){return t},mxObjectCodec.prototype.afterDecode=function(e,t,n){return n},mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return e.isCellCodec=function(){return!0},e.isExcluded=function(e,t,n,a){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||a&&"value"==t&&n.nodeType==mxConstants.NODETYPE_ELEMENT},e.afterEncode=function(e,t,n){if(null!=t.value&&t.value.nodeType==mxConstants.NODETYPE_ELEMENT){var a=n;(n=mxClient.IS_IE?t.value.cloneNode(!0):e.document.importNode(t.value,!0)).appendChild(a),e=a.getAttribute("id"),n.setAttribute("id",e),a.removeAttribute("id")}return n},e.beforeDecode=function(e,t,n){var a=t,i=this.getName();if(t.nodeName!=i?(null!=(a=t.getElementsByTagName(i)[0])&&a.parentNode==t?(mxUtils.removeWhitespace(a,!0),mxUtils.removeWhitespace(a,!1),a.parentNode.removeChild(a)):a=null,n.value=t.cloneNode(!0),null!=(t=n.value.getAttribute("id"))&&(n.setId(t),n.value.removeAttribute("id"))):n.setId(t.getAttribute("id")),null!=a)for(t=0;t<this.idrefs.length;t++){i=this.idrefs[t];var s=a.getAttribute(i);if(null!=s){a.removeAttribute(i);var o=e.objects[s]||e.lookup(s);null==o&&(null!=(s=e.getElementById(s))&&(o=(mxCodecRegistry.codecs[s.nodeName]||this).decode(e,s))),n[i]=o}}return a},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphModel);return e.encodeObject=function(e,t,n){var a=e.document.createElement("root");e.encodeCell(t.getRoot(),a),n.appendChild(a)},e.decodeChild=function(e,t,n){"root"==t.nodeName?this.decodeRoot(e,t,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeRoot=function(e,t,n){var a=null;for(t=t.firstChild;null!=t;){var i=e.decodeCell(t);null!=i&&null==i.getParent()&&(a=i),t=t.nextSibling}null!=a&&n.setRoot(a)},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return e.afterEncode=function(e,t,n){return e.encodeCell(t.root,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.root=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;)n=a.nextSibling,e.decodeCell(a),a.parentNode.removeChild(a),a=n}return t},e.afterDecode=function(e,t,n){return n.previous=n.root,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return e.isReference=function(e,t,n,a){return!("child"!=t||null==e.previous&&a)||0<=mxUtils.indexOf(this.idrefs,t)},e.afterEncode=function(e,t,n){return this.isReference(t,"child",t.child,!0)?n.setAttribute("child",e.getId(t.child)):e.encodeCell(t.child,n),n},e.beforeDecode=function(e,t,n){if(null!=t.firstChild&&t.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var a=(t=t.cloneNode(!0)).firstChild;for(n.child=e.decodeCell(a,!1),n=a.nextSibling,a.parentNode.removeChild(a),a=n;null!=a;){if(n=a.nextSibling,a.nodeType==mxConstants.NODETYPE_ELEMENT){var i=a.getAttribute("id");null==e.lookup(i)&&e.decodeCell(a)}a.parentNode.removeChild(a),a=n}}else a=t.getAttribute("child"),n.child=e.getObject(a);return t},e.afterDecode=function(e,t,n){return n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index,n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return e.afterDecode=function(e,t,n){return n.previous=n.terminal,n},e}());var mxGenericChangeCodec=function(e,a){var t=new mxObjectCodec(e,["model","previous"],["cell"]);return t.afterDecode=function(e,t,n){return mxUtils.isNode(n.cell)&&(n.cell=e.decodeCell(n.cell,!1)),n.previous=n[a],n},t};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxGraphView);return e.encode=function(e,t){return this.encodeCell(e,t,t.graph.getModel().getRoot())},e.encodeCell=function(e,t,n){var a=t.graph.getModel(),i=t.getState(n),s=a.getParent(n);if(null==s||null!=i){var o=a.getChildCount(n),r=t.graph.getCellGeometry(n),l=null;if(s==a.getRoot()?l="layer":null==s?l="graph":a.isEdge(n)?l="edge":0<o&&null!=r?l="group":a.isVertex(n)&&(l="vertex"),null!=l){var d=e.document.createElement(l);if(null!=t.graph.getLabel(n)&&(d.setAttribute("label",t.graph.getLabel(n)),t.graph.isHtmlLabel(n)&&d.setAttribute("html",!0)),null==s){var c=t.getGraphBounds();null!=c&&(d.setAttribute("x",Math.round(c.x)),d.setAttribute("y",Math.round(c.y)),d.setAttribute("width",Math.round(c.width)),d.setAttribute("height",Math.round(c.height))),d.setAttribute("scale",t.scale)}else if(null!=i&&null!=r){for(c in i.style)"function"==typeof(s=i.style[c])&&"object"==typeof s&&(s=mxStyleRegistry.getName(s)),null!=s&&"function"!=typeof s&&"object"!=typeof s&&d.setAttribute(c,s);if(null!=(s=i.absolutePoints)&&0<s.length){for(r=Math.round(s[0].x)+","+Math.round(s[0].y),c=1;c<s.length;c++)r+=" "+Math.round(s[c].x)+","+Math.round(s[c].y);d.setAttribute("points",r)}else d.setAttribute("x",Math.round(i.x)),d.setAttribute("y",Math.round(i.y)),d.setAttribute("width",Math.round(i.width)),d.setAttribute("height",Math.round(i.height));null!=(c=i.absoluteOffset)&&(0!=c.x&&d.setAttribute("dx",Math.round(c.x)),0!=c.y&&d.setAttribute("dy",Math.round(c.y)))}for(c=0;c<o;c++)null!=(i=this.encodeCell(e,t,a.getChildAt(n,c)))&&d.appendChild(i)}}return d},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxStylesheet);return e.encode=function(e,t){var n,a=e.document.createElement(this.getName());for(n in t.styles){var i=t.styles[n],s=e.document.createElement("add");if(null!=n){for(var o in s.setAttribute("as",n),i){var r=this.getStringValue(o,i[o]);if(null!=r){var l=e.document.createElement("add");l.setAttribute("value",r),l.setAttribute("as",o),s.appendChild(l)}}0<s.childNodes.length&&a.appendChild(s)}}return a},e.getStringValue=function(e,t){var n=typeof t;return"function"==n?t=mxStyleRegistry.getName(style[j]):"object"==n&&(t=null),t},e.decode=function(e,t,n){n=n||new this.template.constructor;var a=t.getAttribute("id");for(null!=a&&(e.objects[a]=n),t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName&&null!=(a=t.getAttribute("as"))){var i=t.getAttribute("extend"),s=null!=i?mxUtils.clone(n.styles[i]):null;for(null==s&&(null!=i&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+i+" not found to extend"),s={}),i=t.firstChild;null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT){var o=i.getAttribute("as");if("add"==i.nodeName){var r=mxUtils.getTextContent(i),l=null;null!=r&&0<r.length?l=mxUtils.eval(r):(l=i.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l))),null!=l&&(s[o]=l)}else"remove"==i.nodeName&&delete s[o]}i=i.nextSibling}n.putCellStyle(a,s)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultKeyHandler);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n)for(t=t.firstChild;null!=t;){if(!this.processInclude(e,t,n)&&"add"==t.nodeName){var a=t.getAttribute("as"),i=t.getAttribute("action"),s=t.getAttribute("control");n.bindAction(a,i,s)}t=t.nextSibling}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultToolbar);return e.encode=function(e,t){return null},e.decode=function(e,t,n){if(null!=n){var a=n.editor;for(t=t.firstChild;null!=t;){if(t.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,t,n))if("separator"==t.nodeName)n.addSeparator();else if("br"==t.nodeName)n.toolbar.addBreak();else if("hr"==t.nodeName)n.toolbar.addLine();else if("add"==t.nodeName){var i=t.getAttribute("as"),s=(i=mxResources.get(i)||i,t.getAttribute("icon")),o=t.getAttribute("pressedIcon"),r=t.getAttribute("action"),l=t.getAttribute("mode"),d=t.getAttribute("template"),c="0"!=t.getAttribute("toggle"),m=mxUtils.getTextContent(t),u=null;if(null!=r)u=n.addItem(i,s,r,o);else if(null!=l){var p=mxUtils.eval(m);u=n.addMode(i,s,l,o,p)}else if(null!=d||null!=m&&0<m.length)u=a.templates[d],d=t.getAttribute("style"),null!=u&&null!=d&&(u=u.clone()).setStyle(d),(d=null)!=m&&0<m.length&&(d=mxUtils.eval(m)),u=n.addPrototype(i,s,u,o,d,c);else if(0<(o=mxUtils.getChildNodes(t)).length)if(null==s)for(d=n.addActionCombo(i),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?n.addOption(d,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),c=c.getAttribute("action"),n.addActionOption(d,s,c));else{var g=null,v=n.addPrototype(i,s,function(){if(null==(e=a.templates[g.value]))return mxLog.warn("Template "+e+" not found"),null;var e=e.clone(),t=g.options[g.selectedIndex].cellStyle;return null!=t&&e.setStyle(t),e},null,null,c);g=n.addCombo();for(mxEvent.addListener(g,"change",function(){n.toolbar.selectMode(v,function(e){return e=mxUtils.convertPoint(a.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),a.addVertex(null,p(),e.x,e.y)}),n.toolbar.noReset=!1}),i=0;i<o.length;i++)"separator"==(c=o[i]).nodeName?n.addOption(g,"---"):"add"==c.nodeName&&(s=c.getAttribute("as"),m=c.getAttribute("template"),n.addOption(g,s,m||d).cellStyle=c.getAttribute("style"))}null!=u&&(null!=(d=t.getAttribute("id"))&&0<d.length&&u.setAttribute("id",d))}t=t.nextSibling}}return n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxDefaultPopupMenu);return e.encode=function(e,t){return null},e.decode=function(e,t,n){var a=t.getElementsByTagName("include")[0];return null!=a?this.processInclude(e,a,n):null!=n&&(n.config=t),n},e}()),mxCodecRegistry.register(function(){var e=new mxObjectCodec(new mxEditor,"modified lastSnapshot ignoredChanges undoManager graphContainer toolbarContainer".split(" "));return e.afterDecode=function(e,t,n){return null!=(e=t.getAttribute("defaultEdge"))&&(t.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[e]),null!=(e=t.getAttribute("defaultGroup"))&&(t.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[e]),n},e.decodeChild=function(e,t,n){if("Array"==t.nodeName){if("templates"==t.getAttribute("as"))return void this.decodeTemplates(e,t,n)}else if("ui"==t.nodeName)return void this.decodeUi(e,t,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},e.decodeUi=function(e,t,n){for(e=t.firstChild;null!=e;){if("add"==e.nodeName){t=e.getAttribute("as");var a=e.getAttribute("element"),i=e.getAttribute("style"),s=null;if(null!=a)null!=(s=document.getElementById(a))&&null!=i&&(s.style.cssText+=";"+i);else{a=parseInt(e.getAttribute("x"));var o=parseInt(e.getAttribute("y")),r=e.getAttribute("width"),l=e.getAttribute("height");(s=document.createElement("div")).style.cssText=i,new mxWindow(mxResources.get(t)||t,s,a,o,r,l,!1,!0).setVisible(!0)}"graph"==t?n.setGraphContainer(s):"toolbar"==t?n.setToolbarContainer(s):"title"==t?n.setTitleContainer(s):"status"==t?n.setStatusContainer(s):"map"==t&&n.setMapContainer(s)}else"resource"==e.nodeName?mxResources.add(e.getAttribute("basename")):"stylesheet"==e.nodeName&&mxClient.link("stylesheet",e.getAttribute("name"));e=e.nextSibling}},e.decodeTemplates=function(e,t,n){null==n.templates&&(n.templates=[]),t=mxUtils.getChildNodes(t);for(var a=0;a<t.length;a++){for(var i=t[a].getAttribute("as"),s=t[a].firstChild;null!=s&&1!=s.nodeType;)s=s.nextSibling;null!=s&&(n.templates[i]=e.decodeCell(s))}},e}()),EditorUi=function(e,t,n){this.projectDesignController=e,this.editor=t||new Editor,this.container=n||document.body;var a=t.graph,i=this;CRUD_PERMISSIONS=this.projectDesignController.crudPermissions;var s=mxUtils.bind(this,function(e){return null==e&&(e=window.event),!!this.isEditingEnabled()&&a.isEditing()});this.container.style.overflow="hidden",(new Image).src=mxPopupMenu.prototype.submenuImage,null!=mxConnectionHandler.prototype.connectImage&&((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.actions=new Actions(this),this.menus=new Menus(this),this.createDivs(),this.refresh(),this.createUi(),this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.footerContainer.onselectstart=s,this.footerContainer.onmousedown=s),mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?(mxEvent.addListener(this.diagramContainer,"contextmenu",s),mxEvent.addListener(this.sidebarContainer,"contextmenu",s)):(this.diagramContainer.oncontextmenu=s,this.sidebarContainer.oncontextmenu=s),a.init(this.diagramContainer),a.refresh(),a.setEnabled(this.isEditingEnabled()),a.container.setAttribute("tabindex","0"),a.container.style.cursor="default",a.container.style.backgroundImage="url("+t.gridImage+")",a.container.style.backgroundPosition="-1px -1px",a.container.focus();var o=a.fireMouseEvent;a.fireMouseEvent=function(e,t,n){e==mxEvent.MOUSE_DOWN&&this.container.focus(),o.apply(this,arguments)},this.createMultiplicities(a.multiplicities,["start","finally","end"],[[1,1],[1,1],[0,0]],[[0,0],[0,0],[1,"n"]]),this.createMultiplicities(a.multiplicities,["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[[1,1],[0,0],[0,1],[0,1],[0,1],[1,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["login","pause","unpause","logout"],[[1,2],[1,2],[1,2],[1,2]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["set","math"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["background","playback","menu","saydigits","saynumber","sayphonetic","tts","ispeechtts","awspolly","getdigits","getsecretdigits","lumenvoxtts","sestektts"],[[1,"n"],[1,1],[1,"n"],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,"n"],[1,"n"],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["record"],[[1,1]],[[1,"n"]]),this.createMultiplicities(a.multiplicities,["database","ispeechasr","sendSMS","sendMail","sendFax","googleasr","lumenvoxasr","tildeasr","dialogflow","awslex","sesteknda","sestekasr"],[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["gotoc","gotoif","gotoiftime","vswitch"],[[0,0],[1,2],[1,2],[1,"n"]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["queuelog","goal"],[[1,1],[1,1]],[[1,"n"],[1,"n"]]),this.createMultiplicities(a.multiplicities,["noop","system","agi","subproject","custom_app"],[[1,1],[1,1],[0,1],[0,1],[0,1]],[[1,"n"],[1,"n"],[1,"n"],[1,"n"],[1,"n"]]),a.dblClick=function(e,n){var t=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",e,"cell",n);this.fireEvent(t),mxEvent.isConsumed(e)||t.isConsumed()||(this.getModel().isEdge(n)?0<=["background","gotoif","gotoiftime","menu","getdigits","getsecretdigits","vswitch","login","pause","unpause","logout"].indexOf(n.source.value.tagName)&&this.startEditingAtCell(n):this.getModel().isVertex(n)&&i.projectDesignController.openDialog(n.getValue(),function(e){for(var t=0;t<e.length;t+=1)n.setAttribute(e[t].name,e[t].value);a.refresh(n)}),t.consume())},a.panningHandler.autoExpand=!0,a.panningHandler.factoryMethod=mxUtils.bind(this,function(e,t,n){this.isEditingEnabled()&&this.menus.createPopupMenu(e,t,n)}),t.outline.init(this.outlineContainer),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){a.panningHandler.hideMenu()})),mxClient.IS_TOUCH&&(mxEvent.addListener(a.container,"gesturechange",mxUtils.bind(this,function(e){a.view.getDrawPane().setAttribute("transform","scale("+e.scale+")"),a.view.getOverlayPane().style.visibility="hidden"})),mxEvent.addListener(a.container,"gestureend",mxUtils.bind(this,function(e){a.view.getDrawPane().removeAttribute("transform"),a.zoomToCenter=!0,a.zoom(e.scale),a.view.getOverlayPane().style.visibility="visible"})));var r=this.isEditingEnabled()?this.createKeyHandler(t):null;this.getKeyHandler=function(){return r},mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.refresh(),a.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.init(),this.open(),this.refresh()},EditorUi.prototype.splitSize=mxClient.IS_TOUCH?16:8,EditorUi.prototype.menubarHeight=33,EditorUi.prototype.toolbarHeight=36,EditorUi.prototype.footerHeight=0,EditorUi.prototype.hsplitPosition=204,EditorUi.prototype.vsplitPosition=190,EditorUi.prototype.init=function(){this.addUndoListener(),this.addSelectionListener();var e=this.actions.get("paste"),t=function(){e.setEnabled(!mxClipboard.isEmpty())},n=mxClipboard.cut;mxClipboard.cut=function(){n.apply(this,arguments),t()};var a=mxClipboard.copy;mxClipboard.copy=function(){a.apply(this,arguments),t()}},EditorUi.prototype.isEditingEnabled=function(){return!!CRUD_PERMISSIONS.canEdit},EditorUi.prototype.exportXML=function(e){var t=window.document.createElement("a");t.href="data:attachment/text;charset=utf-8,"+encodeURIComponent(e),t.download=this.editor.filename+".xml",t.target="_self",t.click()},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(e,t){try{var n=mxUtils.parseXml(e);this.editor.setGraphXml(n.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(e){}},EditorUi.prototype.openString=function(e,t,n){try{var a=mxUtils.parseXml(e);this.editor.setGraphXml(a.documentElement),this.editor.modified=!1,this.editor.undoManager.clear(),null!=t&&(this.editor.filename=t),null!=n&&(this.editor.data=n)}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}},EditorUi.prototype.validate=function(e,t){for(var n=this.editor.graph,a=(e=null!=e?e:n.model.getRoot(),t=null!=t?t:{},!0),i=n.model.getChildCount(e),s=0;s<i;s++){var o=n.model.getChildAt(e,s),r=t;n.isValidRoot(o)&&(r={}),null!=(r=this.validate(o,r))?n.setCellWarning(o,r.replace(/\n/g,"<br>")):n.setCellWarning(o,null),a=a&&null==r}if(i="",n.model.isVertex(e))switch(e.value.nodeName){case"start":i=this.validateBlock("start")?"":"Only one Start block is allowed\n";break;case"finally":i=this.validateBlock("finally")?"":"Only one Finally block is allowed\n";break;case"playback":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n";break;case"answer":i=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"menu":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("digit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("response")?"":mxResources.get("invalidTimeout")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"getsecretdigits":i=0<e.value.getAttribute("file_id")?"":mxResources.get("noAudioSelected")+"\n",i+=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n",i+=0<e.value.getAttribute("mindigit")?"":mxResources.get("wrongMinDigit")+"\n",i+=0<e.value.getAttribute("maxdigit")?"":mxResources.get("wrongMaxDigit")+"\n",i+=0<=e.value.getAttribute("hiddendigitsnum")?"":mxResources.get("wrongHiddenDigitsnum")+"\n",i+=0<=e.value.getAttribute("retry")?"":mxResources.get("invalidRetry")+"\n";break;case"vswitch":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"database":i=0<e.value.getAttribute("odbc_id")?"":mxResources.get("noDatabaseSelected")+"\n",i+=""!==e.value.getAttribute("query")?"":mxResources.get("missingQuery")+"\n";break;case"set":case"math":i=0<e.value.getAttribute("variable_id")?"":mxResources.get("noVariableSelected")+"\n";break;case"gotoc":i=""!==e.value.getAttribute("context")?"":mxResources.get("noContextSelected")+"\n",i+=""!==e.value.getAttribute("extension")?"":mxResources.get("noExtensionSelected")+"\n",i+=1<=e.value.getAttribute("priority")?"":mxResources.get("invalidPriority")+"\n";break;case"system":case"agi":i=""!==e.value.getAttribute("command")?"":mxResources.get("noCommandSelected")+"\n";break;case"gotoif":i=""!==e.value.getAttribute("condition")?"":mxResources.get("noConditionSelected")+"\n";break;case"saydigits":i=""!==e.value.getAttribute("digits")?"":mxResources.get("noDigitsSelected")+"\n";break;case"saynumber":i=""!==e.value.getAttribute("number")?"":mxResources.get("noNumberSelected")+"\n";break;case"sayphonetic":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"record":i=""!==e.value.getAttribute("file")?"":mxResources.get("noFileSelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"goal":i=""!==e.value.getAttribute("goalname")?"":mxResources.get("noGoalSelected")+"\n";break;case"ext_dial":i="-1"!==e.value.getAttribute("trunk_name")?"":mxResources.get("noTrunkSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"dial":i=0<e.value.getAttribute("sip_id")?"":mxResources.get("noIdentifierSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"queue":i="-1"!==e.value.getAttribute("queue_id")?"":mxResources.get("noQueueSelected")+"\n",i+=0<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"callback":i="-1"!==e.value.getAttribute("list_id")?"":mxResources.get("noListSelected")+"\n",i+=""!==e.value.getAttribute("name")?"":mxResources.get("noFirstNameSelected")+"\n",i+=""!==e.value.getAttribute("phone")?"":mxResources.get("noPhoneSelected")+"\n",i+=""!==e.value.getAttribute("delay")?"":mxResources.get("invalidDelay")+"\n";break;case"gotoiftime":i=0<e.value.getAttribute("interval_id")?"":mxResources.get("noIntervalSelected")+"\n";break;case"voicemail":i=""!==e.value.getAttribute("mailbox")?"":mxResources.get("noBoxNumberSelected")+"\n";break;case"subproject":i=0<e.value.getAttribute("project_id")?"":mxResources.get("noProjectSelected")+"\n";break;case"sendSMS":i=0<e.value.getAttribute("sms_account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("sms_text")?"":mxResources.get("noTextSelected")+"\n";break;case"sendMail":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n";break;case"sendFax":i=0<e.value.getAttribute("account_id")?"":mxResources.get("noAccountSelected")+"\n",i+=""!==e.value.getAttribute("to")?"":mxResources.get("noRecipientSelected")+"\n",i+=""!==e.value.getAttribute("attachment_path")?"":mxResources.get("noAttachmentSelected")+"\n";break;case"tts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"awspolly":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"awslex":i=""!==e.value.getAttribute("aws_bot_name")?"":mxResources.get("noNameSelected")+"\n",i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i=""!==e.value.getAttribute("aws_access_key_id")?"":mxResources.get("noAccessKeySelected")+"\n",i=""!==e.value.getAttribute("aws_secret_access_key")?"":mxResources.get("noSecretAccessKeySelected")+"\n";break;case"ispeechtts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-10<=e.value.getAttribute("speed")&&e.value.getAttribute("speed")<=10?"":mxResources.get("invalidSpeed")+"\n";break;case"lumenvoxtts":case"sestektts":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n";break;case"lumenvoxasr":case"sestekasr":i=""!==e.value.getAttribute("grammar")?"":mxResources.get("noGrammarSelected")+"\n";break;case"ispeechasr":case"googleasr":i=""!==e.value.getAttribute("key")?"":mxResources.get("noKeySelected")+"\n",i+=-1<=e.value.getAttribute("timeout")?"":mxResources.get("invalidTimeout")+"\n";break;case"tildeasr":i=""!==e.value.getAttribute("appid")?"":mxResources.get("noAppIdInserted")+"\n",i+=""!==e.value.getAttribute("appsecret")?"":mxResources.get("noAppSecretInserted")+"\n",i+=""!==e.value.getAttribute("uri")?"":mxResources.get("noUrlInserted")+"\n";break;case"custom_app":i=""!==e.value.getAttribute("application")?"":mxResources.get("noApplicationSelected")+"\n";break;case"login":case"pause":case"unpause":case"logout":i=""!==e.value.getAttribute("findBy")?"":mxResources.get("noFindBySelected")+"\n";case"sesteknda":i=""!==e.value.getAttribute("text")?"":mxResources.get("noTextSelected")+"\n",i+=""!==e.value.getAttribute("ndauth_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("ndassistant_url")?"":mxResources.get("noUrlInserted")+"\n",i+=""!==e.value.getAttribute("username")?"":mxResources.get("noUsernameSelected")+"\n",i+=""!==e.value.getAttribute("password")?"":mxResources.get("noPasswordSelected")+"\n"}if(n.model.isEdge(e))switch(n.model.getCell(e.source.getId()).value.nodeName){case"background":case"menu":if(void 0!==e.getValue()){var l=/^[0-9]+$|^[-]{1}$|^[i]{1}$|^[t]{1}$|^[*]{1}$|^[#]{1}$/;String(e.getValue()).split(",").forEach(function(e){i+=l.test(e)?"":mxResources.get("numberOrAll")+"\n"})}else i=i+mxResources.get("numberOrAll")+"\n";break;case"getsecretdigits":case"getdigits":if(void 0!==e.getValue())i+=(l=/^(x|i|-)$/).test(String(e.getValue()))?"":mxResources.get("numberOrInvalidOrDefault")+"\n";else i=i+mxResources.get("numberOrInvalidOrDefault")+"\n";break;case"gotoif":case"gotoiftime":if(void 0!==e.getValue())i+=(l=/^(true){1}$|^(false){1}$/).test(String(e.getValue()))?"":mxResources.get("trueOrFalse")+"\n";else i=i+mxResources.get("trueOrFalse")+"\n";break;case"login":case"pause":case"unpause":case"logout":if(void 0!==e.getValue())i+=(l=/^(success){1}$|^(failure){1}$/).test(String(e.getValue()))?"":mxResources.get("successOrFailure")+"\n";else i=i+mxResources.get("successOrFailure")+"\n"}return n.isCellCollapsed(e)&&!a&&(i+=(mxResources.get(n.containsValidationErrorsResource)||n.containsValidationErrorsResource)+"\n"),i=n.model.isEdge(e)?i+(n.getEdgeValidationError(e,n.model.getTerminal(e,!0),n.model.getTerminal(e,!1))||""):i+(n.getCellValidationError(e)||""),null!=(s=n.validateCell(e,t))&&(i+=s),null==n.model.getParent(e)&&n.view.validate(),0<i.length||!a?i:null},EditorUi.prototype.validateBlock=function(t){var n=this.editor.graph,e=n.getDefaultParent(),a=0;return e.children.forEach(function(e){n.model.isVertex(e)&&e.value.nodeName==t&&a++}),!(1<a)},EditorUi.prototype.getUrl=function(e){var t=null!=e?e:window.location.pathname,n=0<t.indexOf("?")?1:0;for(var a in urlParams)t+=0==n?"?":"&",t+=a+"="+urlParams[a],n++;return t},EditorUi.prototype.addUndoListener=function(){var e=this.actions.get("undo"),t=this.actions.get("redo"),n=this.editor.undoManager,a=function(){e.setEnabled(n.canUndo()),t.setEnabled(n.canRedo())};n.addListener(mxEvent.ADD,a),n.addListener(mxEvent.UNDO,a),n.addListener(mxEvent.REDO,a),n.addListener(mxEvent.CLEAR,a),a()},EditorUi.prototype.addSelectionListener=function(){var e=mxUtils.bind(this,function(){var e=this.editor.graph,t=!e.isSelectionEmpty(),n=!1,a=!1,i=e.getSelectionCells();if(null!=i)for(var s=0;s<i.length;s++){var o=i[s];if(e.getModel().isEdge(o)&&(a=!0),e.getModel().isVertex(o)&&(n=!0),a&&n)break}var r=["cut","copy","delete","duplicate","bold","italic","style","underline","toFront","toBack","dashed","rounded","shadow","tilt","autosize"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(t);this.actions.get("curved").setEnabled(a),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("group").setEnabled(1<e.getSelectionCount()),this.actions.get("ungroup").setEnabled(1==e.getSelectionCount()&&0<e.getModel().getChildCount(e.getSelectionCell()));var l=n&&1==e.getSelectionCount();this.actions.get("removeFromGroup").setEnabled(l&&e.getModel().isVertex(e.getModel().getParent(e.getSelectionCell())));var d=["fontFamily","fontSize","alignment","position","text","format","arrange","linewidth","spacing"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(t);d=["line","lineend","linestart"];for(s=0;s<d.length;s++)this.menus.get(d[s]).setEnabled(a);this.actions.get("setAsDefaultEdge").setEnabled(a),this.menus.get("align").setEnabled(1<e.getSelectionCount()),this.menus.get("direction").setEnabled(n||a&&e.isLoop(e.view.getState(e.getSelectionCell()))),this.menus.get("navigation").setEnabled(e.foldingEnabled&&(null!=e.view.currentRoot||1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell()))),this.actions.get("home").setEnabled(null!=e.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=e.view.currentRoot);var c=1==e.getSelectionCount()&&e.isValidRoot(e.getSelectionCell());this.actions.get("enterGroup").setEnabled(c),this.actions.get("expand").setEnabled(c),this.actions.get("collapse").setEnabled(c),this.actions.get("editLink").setEnabled(1==e.getSelectionCount()),this.actions.get("openLink").setEnabled(1==e.getSelectionCount()&&null!=e.getLinkForCell(e.getSelectionCell()))});this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},EditorUi.prototype.refresh=function(){var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),t=this.container.clientWidth+390,n=this.container.clientHeight+190;this.container==document.body&&(t=document.body.clientWidth||document.documentElement.clientWidth,n=e&&document.body.clientHeight||document.documentElement.clientHeight);var a=Math.max(0,Math.min(this.hsplitPosition,t-this.splitSize-20)),i=Math.max(0,Math.min(this.vsplitPosition,n-this.menubarHeight-this.toolbarHeight-this.splitSize-1));this.menubarContainer.style.height=this.menubarHeight+"px",this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px";var s=this.menubarHeight+this.toolbarHeight;if(mxClient.IS_QUIRKS||(s+=1),this.sidebarContainer.style.top=s+"px",this.sidebarContainer.style.width=a+"px",this.outlineContainer.style.width=a+"px",this.outlineContainer.style.height=i+"px",this.diagramContainer.style.left=this.isEditingEnabled()?a+this.splitSize+"px":"0px",this.diagramContainer.style.top=this.sidebarContainer.style.top,this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.outlineContainer.style.bottom,this.hsplit.style.left=a+"px",this.vsplit.style.width=this.sidebarContainer.style.width,this.vsplit.style.bottom=i+this.footerHeight+"px",e){this.menubarContainer.style.width=t+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var o=n-i-this.splitSize-this.menubarHeight-this.toolbarHeight;this.sidebarContainer.style.height=o+"px",this.diagramContainer.style.width=t-a-this.splitSize+"px";var r=n-this.menubarHeight-this.toolbarHeight;this.diagramContainer.style.height=r+"px",this.hsplit.style.height=r+"px"}else this.sidebarContainer.style.bottom=i+this.splitSize+"px",this.diagramContainer.style.bottom=this.outlineContainer.style.bottom},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.outlineContainer=this.createDiv("geOutlineContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.vsplit=this.createDiv("geVsplit"),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.outlineContainer.style.bottom="0px",this.outlineContainer.style.left="0px",this.diagramContainer.style.overflow="scroll",this.diagramContainer.style.right="0px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.vsplit.style.left="0px",this.vsplit.style.height=this.splitSize+"px",this.hsplit.style.width=this.splitSize+"px"},EditorUi.prototype.createUi=function(){this.menubar=this.menus.createMenubar(this.createDiv("geMenubar")),this.menubarContainer.appendChild(this.menubar.container),this.toolbar=this.createToolbar(this.createDiv("geToolbar")),this.toolbarContainer.appendChild(this.toolbar.container),this.sidebar=this.createSidebar(this.sidebarContainer),this.footerContainer.appendChild(this.createFooter()),this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.isEditingEnabled()&&(this.container.appendChild(this.sidebarContainer),this.container.appendChild(this.hsplit),this.container.appendChild(this.vsplit)),this.container.appendChild(this.diagramContainer),this.container.appendChild(this.menubarContainer),this.container.appendChild(this.toolbarContainer),this.container.appendChild(this.outlineContainer),this.container.appendChild(this.footerContainer),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e,this.refresh(),this.editor.graph.sizeDidChange(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()})),this.addSplitHandler(this.vsplit,!1,this.footerHeight,mxUtils.bind(this,function(e){this.vsplitPosition=e,this.refresh(),this.editor.outline.update(!1),this.editor.outline.outline.sizeDidChange()}))},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.createStatusContainer=function(){var e=document.createElement("a");return e.className="geItem geStatus",e},EditorUi.prototype.setStatusText=function(e){this.statusContainer.innerHTML=e},EditorUi.prototype.createToolbar=function(e){return new Toolbar(this,e)},EditorUi.prototype.createSidebar=function(e){return new Sidebar(this,e)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(e){var t=document.createElement("div");return t.className=e,t},EditorUi.prototype.createHeader=function(e){return document.createElement(e)},EditorUi.prototype.createForm=function(e){var t=document.createElement("form");return t.className=e,t},EditorUi.prototype.addSplitHandler=function(t,n,a,i){var s=null,o=null;function r(e){if(null!=s){var t=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));i(Math.max(0,o+(n?t.x-s.x:s.y-t.y)-a)),mxEvent.consume(e)}}function e(e){r(e),o=s=null}mxEvent.addGestureListeners(t,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),o=parseInt(n?t.style.left:t.style.bottom),mxEvent.consume(e)}),mxEvent.addListener(document,"mousemove",r),mxEvent.addListener(document,"touchmove",r),mxEvent.addListener(document,"mouseup",e),mxEvent.addListener(document,"touchend",e)},EditorUi.prototype.executeLayout=function(e,t,n){var a=this.editor.graph,i=a.getSelectionCell();t=null!=this.animate?this.animate:t,a.getModel().beginUpdate();try{e.execute(a.getDefaultParent(),i)}catch(e){throw e}finally{if(t&&navigator.userAgent.indexOf("Camino")<0){var s=new mxMorphing(a);s.addListener(mxEvent.DONE,mxUtils.bind(this,function(){a.getModel().endUpdate()})),s.startAnimation()}else a.getModel().endUpdate()}},EditorUi.prototype.createKeyHandler=function(e){var a=this.editor.graph,o=new mxKeyHandler(a);function t(e){if(!a.isSelectionEmpty()){var t=0,n=0;37==e?t=-1:38==e?n=-1:39==e?t=1:40==e&&(n=1),a.moveCells(a.getSelectionCells(),t,n),a.scrollCellToVisible(a.getSelectionCell())}}o.isControlDown=function(e){return mxEvent.isControlDown(e)||mxClient.IS_MAC&&e.metaKey};var n=mxUtils.bind(this,function(e,t,n,a){var i=this.actions.get(n);if(null!=i){var s=function(){i.enabled&&i.funct()};t?a?o.bindControlShiftKey(e,s):o.bindControlKey(e,s):a?o.bindShiftKey(e,s):o.bindKey(e,s)}});return o.enter=function(){},o.bindKey(8,function(){a.foldCells(!0)}),o.bindKey(13,function(){a.foldCells(!1)}),o.bindKey(33,function(){a.exitGroup()}),o.bindKey(34,function(){a.enterGroup()}),o.bindKey(36,function(){a.home()}),o.bindKey(35,function(){a.refresh()}),o.bindKey(37,function(){t(37)}),o.bindKey(38,function(){t(38)}),o.bindKey(39,function(){t(39)}),o.bindKey(40,function(){t(40)}),o.bindKey(113,function(){a.startEditingAtCell()}),n(46,!1,"delete"),n(82,!0,"tilt"),n(83,!0,"save"),n(83,!0,"saveAs",!0),n(107,!1,"zoomIn"),n(109,!1,"zoomOut"),n(65,!0,"selectAll"),n(86,!0,"selectVertices",!0),n(69,!0,"selectEdges",!0),n(69,!0,"export"),n(66,!0,"toBack"),n(70,!0,"toFront"),n(68,!0,"duplicate"),n(90,!0,"undo"),n(89,!0,"redo"),n(88,!0,"cut"),n(67,!0,"copy"),n(81,!0,"connect"),n(86,!0,"paste"),n(71,!0,"group"),n(71,!0,"grid",!0),n(85,!0,"ungroup"),n(112,!1,"about"),n(80,!0,"publish",!0),o},EditorUi.prototype.createMultiplicities=function(e,t,n,a){for(var i=0;i<t.length;i++)e.push(new mxMultiplicity(!0,t[i],null,null,n[i][0],n[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+n[i][0]+mxResources.get("outgoingedge"),null)),e.push(new mxMultiplicity(!1,t[i],null,null,a[i][0],a[i][1],null,mxResources.get(t[i])+mxResources.get("musthave")+a[i][0]+mxResources.get("incomingedge"),null))};var useLocalStorage=(mxClient.IS_TOUCH||"local"==urlParams.storage)&&"undefined"!=typeof localStorage,fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList,touchStyle=mxClient.IS_TOUCH||"1"==urlParams.touch,counter=0;try{for(var op=window;null!=op.opener&&!isNaN(op.opener.counter);)op=op.opener;null!=op&&(op.counter++,counter=op.counter)}catch(e){}function Sidebar(e,t){this.editorUi=e,this.container=t,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=new Graph(document.createElement("div"),null,null,this.editorUi.editor.graph.getStylesheet()),this.graph.resetViewOnRootChange=!1,this.graph.foldingEnabled=!1,this.graph.setConnectable(!1),this.graph.autoScroll=!1,this.graph.setTooltips(!1),this.graph.setEnabled(!1),this.graph.container.style.visibility="hidden",this.graph.container.style.position="absolute",this.graph.container.style.overflow="hidden",this.graph.container.style.height="1px",this.graph.container.style.width="1px",mxClient.IS_IE||mxClient.IS_IE11||(this.graph.container.style.display="none"),document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(e){for(var t=mxEvent.getSource(e);null!=t;){if(t==this.currentElt)return;t=t.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(e){null==e.toElement&&null==e.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(t,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0})),this.init(),mxClient.IS_SVG||((new Image).src=IMAGE_PATH+"/tooltip.png")}function Actions(e){this.editorUi=e,this.actions=new Object,this.init()}function Action(e,t,n,a,i){mxEventSource.call(this),this.label=e,this.funct=t,this.enabled=null==n||n,this.iconCls=a,this.shortcut=i}function Menubar(e,t){this.editorUi=e,this.container=t,mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function Menu(e,t){mxEventSource.call(this),this.funct=e,this.enabled=null==t||t}function Toolbar(e,t){this.editorUi=e,this.container=t,this.init(),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(e){this.hideMenu()}))}function createCheckbox(e){var t=document.createElement("input");return t.setAttribute("type","checkbox"),e&&t.setAttribute("checked",!0),t}function createDropdownFromApi(e,n,a,i,t,s,o,r){var l=new XMLHttpRequest;l.open("GET",e,!1),l.setRequestHeader("Authorization","Bearer "+t.editor.data.token),l.send(null);var d=[];200===l.status&&(d=JSON.parse(l.response));var c=document.createElement("select"),m=document.createElement("option");return m.text="-- None --",m.value="-1",c.appendChild(m),d.rows.forEach(function(t){r&&t[a]==r||((m=document.createElement("option")).text=t[a],s&&o?(m.value=o,s.forEach(function(e){m.value=m.value.replace("%"+e+"%",t[e])}),m.selected=m.value==n):(m.value=t[i],m.selected=t[i]==n),c.appendChild(m))}),c.className="form-control select2",c}function createDropdownWithOptgroupFromApi(e,t,n,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");d.text="-- None --",d.value="-1",l.appendChild(d);var c=_.groupBy(r.rows,s);for(var m in c)if(c.hasOwnProperty(m)){var u=document.createElement("optgroup");u.label=_.capitalize(m),c[m].forEach(function(e){(d=document.createElement("option")).text=e[n],d.value=e[a],d.selected=e[a]==t,u.appendChild(d)}),l.appendChild(u)}return l.className="form-control select2",l}function createGroupedDropdownFromApi(e,t,n,a,i,s){var o=new XMLHttpRequest;o.open("GET",e,!1),o.setRequestHeader("Authorization","Bearer "+i.editor.data.token),o.send(null);var r=[];200===o.status&&(r=JSON.parse(o.response));var l=document.createElement("select"),d=document.createElement("option");return d.text="-- None --",d.value="0",l.appendChild(d),r.rows.forEach(function(e){(d=document.createElement("option")).className="select-group-father",d.text=e[n].toUpperCase(),d.value=e[a],d.selected=e[a]==t,l.appendChild(d),e[s].forEach(function(e){(d=document.createElement("option")).className="select-group-son",d.text="-"+_.capitalize(e[n]),d.value=e[a],d.selected=e[a]==t,l.appendChild(d)})}),l.className="form-control select2",l}function createDropdownFromArray(e,t){var n=document.createElement("select");for(var a in e){var i=document.createElement("option");i.text=e[a],i.value=a,(0<t||""!=t)&&(i.selected=t===a),n.appendChild(i)}return n.className="form-control select2",n}function createDropdownFromTigerDialList(e){var t=document.createElement("select"),n=[],a=new XMLHttpRequest;try{if(a.open("POST","/api/rest/list/list",!1),a.send(JSON.stringify({page:1,size:6e5})),200===a.status){var i=JSON.parse(a.response);if(0<i.status){var s=i.response.RMI.rows;for(var o in s)n[s[o].id]=s[o].name}}}catch(e){console.log(e)}for(var r in n){var l=document.createElement("option");l.text=n[r],l.value=r,(0<e||""!=e)&&(l.selected=e===r),t.appendChild(l)}return t.className="form-control select2",t}function Dialog(e,t,n,a,i,s,o){var r=0;mxClient.IS_IE&&9!=document.documentMode&&(r=60),n+=r,a+=r;Math.max(0,Math.round((document.body.scrollWidth-n)/2)),Math.max(0,Math.round((Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-a)/3));var l=e.createDiv("geDialog");l.className="modal fade in center",l.style.display="block",l.style.paddingRight="12px";var d=e.createDiv("geModalDialog");d.className="modal-dialog",d.appendChild(t),l.appendChild(d),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.className="modal-backdrop fade in",mxClient.IS_QUIRKS&&new mxDivResizer(this.bg)),i&&document.body.appendChild(this.bg),document.body.appendChild(l),this.onDialogClose=o,this.container=l}function ImportDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("import")+" XML");var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-12"),d=document.createElement("textarea");d.style.width="100%",d.style.height="374px";var c=document.createElement("input");c.type="file",c.setAttribute("accept","text/xml"),c.addEventListener("change",function(e){var t=e.target.files[0];if(console.log(t),t)if("text/xml"===t.type){var n=new FileReader;n.onload=function(e){var t=e.target.result;mxUtils.write(d,t)},n.readAsText(t)}else alert("Failed to load format file");else alert("Failed to load file")},!1),l.appendChild(c),l.appendChild(d),r.appendChild(l),a.appendChild(r);var m=mxUtils.button(mxResources.get("import"),mxUtils.bind(this,function(e){var t=mxUtils.parseXml(d.value);n.editor.setGraphXml(t.documentElement),n.hideDialog()}));m.className="btn blue";var u=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});u.className="btn default",i.appendChild(m),i.appendChild(u),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function AboutDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("about")+" Cally Square");var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=document.createElement("img");r.style.border="0px",r.setAttribute("width","176"),r.setAttribute("width","151"),r.setAttribute("src",IMAGE_PATH+"/logo.png"),a.appendChild(r),mxUtils.br(a),mxUtils.write(a,"Powered by Xenialab "+mxClient.VERSION),mxUtils.br(a);var l=document.createElement("a");l.setAttribute("href","http://www.callysquare.com/"),l.setAttribute("target","_blank"),mxUtils.write(l,"www.callysquare.com"),a.appendChild(l),mxUtils.br(a),mxUtils.br(a);var d=mxUtils.button(mxResources.get("close"),function(){e.hideDialog()});d.className="btn default",i.appendChild(d),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function SaveDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("saveAs"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_copy"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("save"),function(){e.saveAs(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function NewDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("new"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.editor.getOrCreateFilename(),l=e.createDiv("row"),d=e.createDiv("col-md-4"),c=e.createDiv("col-md-8"),m=document.createElement("label");m.className="control-label pull-right",mxUtils.write(m,mxResources.get("name")),d.appendChild(m);var u=document.createElement("input");u.setAttribute("value",r+"_new"),u.setAttribute("id","_name"),u.className="form-control",c.appendChild(u),l.appendChild(d),l.appendChild(c),a.appendChild(l);var p=mxUtils.button(mxResources.get("new"),function(){e.new(u.value),e.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function DescriptionDialog(e){console.log(e.editor.data);var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("description"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="description",d=e.editor.data.description||"",c=e.createDiv("form-group"),m=document.createElement("label");m.className="col-sm-4 control-label",mxUtils.write(m,mxResources.get(l)),c.appendChild(m);var u=document.createElement("input");u.setAttribute("value",d),u.className="form-control",u.setAttribute("id","_description");var p=e.createDiv("col-sm-8");p.appendChild(u),c.appendChild(p),r.appendChild(c),a.appendChild(r);var g=mxUtils.button(mxResources.get("update"),function(){e.description(u.value),e.hideDialog()});g.className="btn blue";var v=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});v.className="btn default",i.appendChild(g),i.appendChild(v),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function VariableDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("variable"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("form-horizontal form-row-seperated"),l="name",d="_"+l,c="variable name",m=e.createDiv("form-group"),u=document.createElement("label");u.className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var p=document.createElement("input");p.setAttribute("value",c),p.className="form-control",p.setAttribute("id",d);var g=e.createDiv("col-sm-8");g.appendChild(p),m.appendChild(g),r.appendChild(m),d="_"+(l="description"),c="variable description",m=e.createDiv("form-group last"),(u=document.createElement("label")).className="col-sm-4 control-label",mxUtils.write(u,mxResources.get(l)),m.appendChild(u);var v=document.createElement("input");v.setAttribute("value",c),v.className="form-control",v.setAttribute("id",d),(g=e.createDiv("col-sm-8")).appendChild(v),m.appendChild(g),r.appendChild(m),a.appendChild(r);var h=mxUtils.button(mxResources.get("new"),function(){e.variable(p.value,v.value),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function OpenDialog(e){var t=e.createDiv("modal-content"),n=e.createDiv("modal-header"),a=e.createDiv("modal-body"),i=e.createDiv("modal-footer"),s=e.createHeader("h4");mxUtils.write(s,mxResources.get("open"));var o=mxUtils.button("",function(){e.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=e.createDiv("row"),l=e.createDiv("col-md-4"),d=e.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=new XMLHttpRequest;m.open("GET","/api/square/projects",!1),m.setRequestHeader("Authorization","Bearer "+e.editor.data.token),m.send(null);var u=[];200===m.status&&(u=JSON.parse(m.response));for(var p=document.createElement("select"),g=0;g<u.length;g++){var v=document.createElement("option");v.text=u[g].name,v.value=u[g].id,p.appendChild(v)}p.className="form-control",d.appendChild(p),r.appendChild(l),r.appendChild(d),a.appendChild(r);var h=mxUtils.button(mxResources.get("open"),function(){console.log(p),console.log(p.value),window.open("square/project/"+p.value,"_blank"),e.hideDialog()});h.className="btn blue";var f=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});f.className="btn default",i.appendChild(h),i.appendChild(f),t.appendChild(n),t.appendChild(a),t.appendChild(i),this.container=t}function RenameDialog(n){var e=n.createDiv("modal-content"),t=n.createDiv("modal-header"),a=n.createDiv("modal-body"),i=n.createDiv("modal-footer"),s=n.createHeader("h4");mxUtils.write(s,mxResources.get("rename"));var o=mxUtils.button("",function(){n.hideDialog()});o.className="close",t.appendChild(o),t.appendChild(s);var r=n.createDiv("row"),l=n.createDiv("col-md-4"),d=n.createDiv("col-md-8"),c=document.createElement("label");c.className="control-label pull-right",mxUtils.write(c,mxResources.get("name")),l.appendChild(c);var m=n.editor.filename,u=document.createElement("input");u.setAttribute("value",m),u.className="form-control",d.appendChild(u),r.appendChild(l),r.appendChild(d),a.appendChild(r);var p=mxUtils.button(mxResources.get("save"),function(){var t=new XMLHttpRequest;t.open("PUT",SAVE_URL+n.editor.data.id,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.setRequestHeader("Authorization","Bearer "+n.editor.data.token),t.send("name="+u.value),t.onload=function(e){200===t.status?(n.editor.setStatus("Project successfully renamed"),n.editor.filename=u.value):(console.log(t.response),n.editor.setStatus(JSON.parse(t.response).errors[0].message))},t.onerror=function(e){mxUtils.alert(t.statusText)},n.hideDialog()});p.className="btn blue";var g=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});g.className="btn default",i.appendChild(p),i.appendChild(g),e.appendChild(t),e.appendChild(a),e.appendChild(i),this.container=e}function EditFileDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("edit"));var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("row"),l=t.createDiv("col-md-12"),d=document.createElement("textarea");if(d.style.width="100%",d.style.height="374px",d.value=mxUtils.getPrettyXml(t.editor.getGraphXml()),fileSupport){d.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault()},!1),d.addEventListener("drop",function(e){if(e.stopPropagation(),e.preventDefault(),0<e.dataTransfer.files.length){var t=e.dataTransfer.files[0],n=new FileReader;n.onload=function(e){d.value=e.target.result},n.readAsText(t)}},!1)}l.appendChild(d),r.appendChild(l),a.appendChild(r);var c=mxUtils.button(mxResources.get("save"),function(){var e=mxUtils.parseXml(d.value);t.editor.setGraphXml(e.documentElement),t.hideDialog()});c.className="btn blue";var m=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});m.className="btn default",i.appendChild(c),i.appendChild(m),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function ExportDialog(t){var e=t.createDiv("modal-content"),n=t.createDiv("modal-header"),a=t.createDiv("modal-body form"),i=t.createDiv("modal-footer"),s=t.createHeader("h4");mxUtils.write(s,mxResources.get("export")+" XML");var o=mxUtils.button("",function(){t.hideDialog()});o.className="close",n.appendChild(o),n.appendChild(s);var r=t.createDiv("form-horizontal form-row-seperated"),l=t.createDiv("form-group last"),d=document.createElement("label");d.className="col-sm-4 control-label",mxUtils.write(d,mxResources.get("filename"));var c=document.createElement("input");c.setAttribute("value",t.editor.getOrCreateFilename()),c.className="form-control";var m=t.createDiv("col-sm-8");m.appendChild(c),l.appendChild(d),l.appendChild(m),r.appendChild(l),a.appendChild(r);var u=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(e){t.save(!1);encodeURIComponent(mxUtils.getXml(t.editor.getGraphXml()));new mxXmlRequest(SAVE_URL+t.editor.data.id+"/download","filename="+c.value,"GET").simulate(document,"_blank"),t.hideDialog()}));u.className="btn blue";var p=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});p.className="btn default",i.appendChild(u),i.appendChild(p),e.appendChild(n),e.appendChild(a),e.appendChild(i),this.container=e}function GeneralDialog(i,s){console.log("general");var o=i.editor.graph,e=i.createDiv("md-dialog"),t=i.createDiv("md-toolbar"),n=i.createDiv("md-dialog-content"),a=i.createDiv("md-dialog-actions"),r=i.createHeader("h4");mxUtils.write(r,mxResources.get("edit")+" "+mxResources.get(s.value.nodeName));var l=mxUtils.button("",function(){i.hideDialog()});l.className="close",t.appendChild(l),t.appendChild(r);for(var d=s.value.attributes.length,c=i.createDiv("form-horizontal form-row-seperated"),m=0;m<d;m++){var u,p=s.value.attributes[m].name,g="_"+p,v=s.value.attributes[m].value,h=i.createDiv(m==d-1?"form-group last":"form-group"),f=document.createElement("label");switch(f.className="col-sm-4 control-label",mxUtils.write(f,mxResources.get(p)),h.appendChild(f),p){case"sip_id":u=createDropdownWithOptgroupFromApi("/api/users/all",v,"fullname","id",i,"role");break;case"queue_id":u=createDropdownFromApi("/api/voice/queues",v,"name","name",i);break;case"trunk_name":u=createDropdownFromApi("/api/trunks",v,"name","name",i);break;case"variable_id":u=createDropdownFromApi("/api/variables",v,"name","id",i);break;case"account_id":u="sendMail"==s.value.nodeName?createDropdownFromApi("/api/mail/servers/out",v,"username","id",i):createDropdownFromApi("/api/sms/accounts",v,"name","id",i);break;case"template_id":u=createDropdownFromApi("/api/templates",v,"name","id",i);break;case"context":u=createDropdownFromApi("/api/voice/contexts",v,"name","name",i);break;case"mailbox":u=createDropdownFromApi("/api/voice/voicemails",v,"mailbox","id",i,["mailbox","context"],"%mailbox%@%context%");break;case"model":u=createDropdownFromArray(ISPEECHASRMODEL,v);break;case"ispeech_asr_language":u=createDropdownFromArray(ISPEECHASRLANG,v);break;case"beep":u=createDropdownFromArray(ISPEECHBEEP,v);break;case"hiddendigitspos":u=createDropdownFromArray(SECRETDIGITSPOS,v);break;case"ispeech_tts_language":u=createDropdownFromArray(ISPEECHLANG,v);break;case"google_tts_language":u=createDropdownFromArray(GOOGLETTSLANG,v);break;case"intKey":u=createDropdownFromArray(ASRINTKEYS,v);break;case"recordingFormat":u=createDropdownFromArray(RECORDINGFORMAT,v);break;case"answer":u=createDropdownFromArray(BOOLSELECT,v);break;case"list_id":u=createDropdownFromTigerDialList(v);break;case"interval_id":u=createGroupedDropdownFromApi("/api/intervals",v,"name","id",i,"SubIntervals");break;case"project_id":u=createDropdownFromApi("/api/square/projects",v,"name","id",i,null,null,i.editor.getOrCreateFilename());break;case"odbc_id":u=createDropdownFromApi("/api/square/odbc",v,"name","id",i);break;case"file_id":u=createDropdownFromApi("/api/sounds",v,"display_name","id",i);break;case"timeout":case"digit":case"mindigit":case"maxdigit":case"response":case"retry":case"speed":(u=document.createElement("input")).setAttribute("type","number"),u.setAttribute("min",0),u.setAttribute("max",1e3),u.setAttribute("value",v),u.className="form-control";break;case"text":case"key":case"query":case"condition":case"command":case"body":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control";break;case"sms_text":(u=document.createElement("textarea")).innerHTML=v,u.className="form-control",u.setAttribute("maxlength","160");break;default:(u=document.createElement("input")).setAttribute("value",v),u.className="form-control"}u.setAttribute("id",g);var b=i.createDiv("col-sm-8");if(b.appendChild(u),mxResources.get("help_"+p)){var E=i.createDiv("p");E.className="help-block",mxUtils.write(E,mxResources.get("help_"+p)),b.appendChild(E)}h.appendChild(b),c.appendChild(h)}n.appendChild(c);var A=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(e){for(var t=0;t<s.value.attributes.length;t++){var n="_"+s.value.attributes[t].name,a=s.value.attributes[t].name;s.setAttribute(a,document.getElementById(n).value)}o.refresh(s),i.hideDialog()}));A.className="btn blue";var y=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});y.className="btn default",a.appendChild(A),a.appendChild(y),e.appendChild(t),e.appendChild(n),e.appendChild(a),this.container=e}Editor=function(){mxEventSource.call(this),this.init(),this.initStencilRegistry(),this.graph=new Graph,this.outline=new mxOutline(this.graph),this.outline.updateOnPan=!0,this.undoManager=this.createUndoManager(),this.status="",this.filename=null,this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[counter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(e){this.status=e,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.modified=!1,this.graphChangeListener=function(){this.modified=!0},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),window.onbeforeunload=mxUtils.bind(this,function(){if(this.modified)return mxResources.get("allChangesLost")}),this.graph.resetViewOnRootChange=!1,this.graph.scrollbars=!0,this.graph.background=null},mxUtils.extend(Editor,mxEventSource),Editor.prototype.gridImage=IMAGE_PATH+"/grid.gif",Editor.prototype.transparentImage=IMAGE_PATH+"/transparent.gif",Editor.prototype.setGraphXml=function(e){var t=new mxCodec(e.ownerDocument);if("mxGraphModel"==e.nodeName){this.graph.view.scale=Number(e.getAttribute("scale")||1),this.graph.gridEnabled="0"!=e.getAttribute("grid"),this.graph.graphHandler.guidesEnabled="0"!=e.getAttribute("guides"),this.graph.setTooltips("0"!=e.getAttribute("tooltips")),this.graph.setConnectable("0"!=e.getAttribute("connect")),this.graph.foldingEnabled="0"!=e.getAttribute("fold"),this.graph.scrollbars="0"!=e.getAttribute("scrollbars"),this.graph.scrollbars||(this.graph.container.scrollLeft=0,this.graph.container.scrollTop=0,this.graph.view.translate.x=Number(e.getAttribute("dx")||0),this.graph.view.translate.y=Number(e.getAttribute("dy")||0)),this.graph.pageVisible="1"==e.getAttribute("page"),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var n=e.getAttribute("pageScale");this.graph.pageScale=null!=n?n:1.5;var a=e.getAttribute("pageWidth"),i=e.getAttribute("pageHeight");null!=a&&null!=i&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(a),parseFloat(i)),this.outline.outline.pageFormat=this.graph.pageFormat);var s=e.getAttribute("background");null!=s&&0<s.length&&(this.graph.background=s),t.decode(e,this.graph.getModel()),this.updateGraphComponents()}},Editor.prototype.getGraphXml=function(){var e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel());return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),1!=this.graph.view.scale&&e.setAttribute("scale",Math.round(1e3*this.graph.view.scale)/1e3),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),this.graph.scrollbars||e.setAttribute("scrollbars","0"),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var e=this.graph,t=this.outline;if(null!=e.container&&null!=t.outline.container){null!=e.background?"none"==e.background?e.container.style.backgroundColor="transparent":(null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=e.background,e.view.backgroundPageShape.reconfigure()),e.container.style.backgroundColor=e.background):e.container.style.backgroundColor="",e.pageVisible?(e.container.style.backgroundColor="#ebebeb",e.container.style.borderStyle="solid",e.container.style.borderColor="#e5e5e5",e.container.style.borderTopWidth="1px",e.container.style.borderLeftWidth="1px",e.container.style.borderRightWidth="0px",e.container.style.borderBottomWidth="0px"):e.container.style.border="",t.outline.container.style.backgroundColor=e.container.style.backgroundColor,t.outline.pageVisible==e.pageVisible&&t.outline.pageScale==e.pageScale||(t.outline.pageScale=e.pageScale,t.outline.pageVisible=e.pageVisible,t.outline.view.validate()),e.scrollbars&&"hidden"==e.container.style.overflow&&!touchStyle?e.container.style.overflow="auto":e.scrollbars&&!touchStyle||(e.container.style.overflow="hidden");var n=mxClient.IS_IE&&9<=document.documentMode?"url("+this.transparentImage+")":"none";e.container.style.backgroundImage=!e.pageVisible&&e.isGridEnabled()?"url("+this.gridImage+")":n,null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+this.gridImage+")":"none")}},Editor.prototype.init=function(){mxClient.IS_IE6&&mxClient.link("stylesheet",CSS_PATH+"/grapheditor-ie6.css"),mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE),mxConstants.DEFAULT_HOTSPOT=.3;var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=e.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(e,t){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxConstants.SHADOWCOLOR="#d0d0d0",mxConstants.HANDLE_FILLCOLOR="#99ccff",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,mxRubberband.prototype.defaultOpacity=30,mxGraphView.prototype.createBackgroundPageShape=function(e){return new mxRectangleShape(e,this.graph.background||"white","#cacaca")},mxGraphView.prototype.getBackgroundPageBounds=function(){var e=this.getGraphBounds(),t=0<e.width?e.x/this.scale-this.translate.x:0,n=0<e.height?e.y/this.scale-this.translate.y:0,a=e.width/this.scale,i=e.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,l=s.height*o,d=Math.floor(Math.min(0,t)/r),c=Math.floor(Math.min(0,n)/l),m=Math.ceil(Math.max(1,t+a)/r)-d,u=Math.ceil(Math.max(1,n+i)/l)-c;return new mxRectangle(this.scale*(this.translate.x+d*r),this.scale*(this.translate.y+c*l),this.scale*m*r,this.scale*u*l)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(e,t){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=e+"px",this.view.backgroundPageShape.node.style.marginTop=t+"px")};var a=this;mxGraphView.prototype.validateBackground=function(){var e=this.graph.getBackgroundImage();if(null!=e){if(null==this.backgroundImage||this.backgroundImage.image!=e.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var t=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,e)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null);if(this.graph.pageVisible){t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(this.graph.container),this.graph.container.firstChild.style.position="absolute",this.graph.container.insertBefore(this.backgroundPageShape.node,this.graph.container.firstChild),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",this.backgroundPageShape.node.style.backgroundPosition="-1px -1px",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(e){this.graph.dblClick(e)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(e)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}),mxUtils.bind(this,function(e){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))):(this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()),this.backgroundPageShape.node.style.backgroundImage=this.graph.isGridEnabled()?"url("+a.gridImage+")":"none"}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraph.prototype.updatePageBreaks=function(e,t,n){var a=this.view.scale,i=this.view.translate,s=this.pageFormat,o=a*this.pageScale,r=this.view.getBackgroundPageBounds();t=r.width,n=r.height;var l=new mxRectangle(a*i.x,a*i.y,s.width*o,s.height*o),d=(e=e&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(t/l.width)-1:0,c=e?Math.ceil(n/l.height)-1:0,m=r.x+t,u=r.y+n;if(null==this.horizontalPageBreaks&&0<d&&(this.horizontalPageBreaks=[]),null!=this.horizontalPageBreaks){for(var p=0;p<=d;p++){var g=[new mxPoint(r.x+(p+1)*l.width,r.y),new mxPoint(r.x+(p+1)*l.width,u)];if(null!=this.horizontalPageBreaks[p])this.horizontalPageBreaks[p].scale=1,this.horizontalPageBreaks[p].points=g,this.horizontalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,this.scale)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.horizontalPageBreaks[p]=v}for(p=d;p<this.horizontalPageBreaks.length;p++)this.horizontalPageBreaks[p].destroy();this.horizontalPageBreaks.splice(d,this.horizontalPageBreaks.length-d)}if(null==this.verticalPageBreaks&&0<c&&(this.verticalPageBreaks=[]),null!=this.verticalPageBreaks){for(p=0;p<=c;p++){var v;g=[new mxPoint(r.x,r.y+(p+1)*l.height),new mxPoint(m,r.y+(p+1)*l.height)];if(null!=this.verticalPageBreaks[p])this.verticalPageBreaks[p].scale=1,this.verticalPageBreaks[p].points=g,this.verticalPageBreaks[p].redraw();else(v=new mxPolyline(g,this.pageBreakColor,a)).dialect=this.dialect,v.isDashed=this.pageBreakDashed,v.addPipe=!1,v.scale=a,v.init(this.view.backgroundPane),v.redraw(),this.verticalPageBreaks[p]=v}for(p=c;p<this.verticalPageBreaks.length;p++)this.verticalPageBreaks[p].destroy();this.verticalPageBreaks.splice(c,this.verticalPageBreaks.length-c)}},mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0;var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(e,t,n){for(var a=0;a<t.length;a++)if(this.graph.getModel().isVertex(t[a])){var i=this.graph.getCellGeometry(t[a]);if(null!=i&&i.relative)return!1}return s.apply(this,arguments)},mxGuide.prototype.isEnabledForEvent=function(e){return!mxEvent.isAltDown(e)};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,t,n,a,i,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(e){mxEvent.consume(e)}),o};var o=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(e){var t=this.graph.getModel(),n=t.getParent(this.graph.getSelectionCell()),a=o.apply(this,arguments),i=t.getParent(a);if(null==n||n!=a&&n!=i)for(;!this.graph.isCellSelected(a)&&!this.graph.isCellSelected(i)&&t.isVertex(i)&&!this.graph.isValidRoot(i);)a=i,i=this.graph.getModel().getParent(a);return a};var l=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(e){var t=l.apply(this,arguments),n=this.graph.getModel(),a=n.getParent(this.graph.getSelectionCell()),i=n.getParent(e);return(null==a||a!=e&&a!=i)&&(this.graph.isCellSelected(e)||!n.isVertex(i)||this.graph.isValidRoot(i)||(t=!0)),t},mxGraphHandler.prototype.selectDelayed=function(e){var t=e.getCell();null==t&&(t=this.cell);for(var n=this.graph.getModel(),a=n.getParent(t);this.graph.isCellSelected(t)&&n.isVertex(a)&&!this.graph.isValidRoot(a);)t=a,a=n.getParent(t);this.graph.selectCellForEvent(t,e.getEvent())},mxPanningHandler.prototype.getCellForPopupEvent=function(e){for(var t=e.getCell(),n=this.graph.getModel(),a=n.getParent(t);n.isVertex(a)&&!this.graph.isValidRoot(a);)this.graph.isCellSelected(a)&&(t=a),a=n.getParent(a);return t}},Editor.prototype.createUndoManager=function(){var s=this.graph,n=new mxUndoManager,e=function(e,t){n.undoableEditHappened(t.getProperty("edit"))};s.getModel().addListener(mxEvent.UNDO,e),s.getView().addListener(mxEvent.UNDO,e);var t=function(e,t){for(var n=s.getSelectionCellsForChanges(t.getProperty("edit").changes),a=[],i=1;i<n.length;i++)null!=s.view.getState(n[i])&&a.push(n[i]);s.setSelectionCells(a)};return n.addListener(mxEvent.UNDO,t),n.addListener(mxEvent.REDO,t),n},Editor.prototype.initStencilRegistry=function(){mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/general.xml")},mxStencilRegistry.libraries={},mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(e){var t=mxStencilRegistry.stencils[e];if(null==t){var n=mxStencilRegistry.getBasenameForStencil(e);if(null!=n){var a=mxStencilRegistry.libraries[n];if(null!=a){if(null==mxStencilRegistry.packages[n]){mxStencilRegistry.packages[n]=1;for(var i=0;i<a.length;i++){var s=a[i];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length)){var o=mxUtils.load(s);null!=o&&eval.call(window,o.getText())}}}}else mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);t=mxStencilRegistry.stencils[e]}}return t},mxStencilRegistry.getBasenameForStencil=function(e){var t=e.split("."),n=null;if(0<t.length&&"mxgraph"==t[0]){n=t[1];for(var a=2;a<t.length-1;a++)n+="/"+t[a]}return n},mxStencilRegistry.loadStencilSet=function(e,t,n){n=null!=n&&n;var a=mxStencilRegistry.packages[e];if(n||null==a){var i=!1;null==a&&(a=mxUtils.load(e).getXml(),mxStencilRegistry.packages[e]=a,i=!0),mxStencilRegistry.parseStencilSet(a,t,i)}},mxStencilRegistry.parseStencilSet=function(e,t,n){n=null==n||n;var a=e.documentElement,i=a.firstChild,s="",o=a.getAttribute("name");for(null!=o&&(s=o+".");null!=i;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(o=i.getAttribute("name"))){s=s.toLowerCase();var r=o.replace(/ /g,"_");if(n&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(i)),null!=t){var l=i.getAttribute("w"),d=i.getAttribute("h");t(s,r,o,l=null==l?80:parseInt(l,10),d=null==d?80:parseInt(d,10))}}i=i.nextSibling}},OpenFile=function(e){this.producer=null,this.consumer=null,this.done=e},OpenFile.prototype.setConsumer=function(e){this.consumer=e,this.execute()},OpenFile.prototype.setData=function(e,t){this.data=e,this.filename=t,this.execute()},OpenFile.prototype.error=function(e){this.cancel(),mxUtils.alert(e)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.data&&(this.consumer(this.data,this.filename),this.cancel())},OpenFile.prototype.cancel=function(){null!=this.done&&this.done()},Sidebar.prototype.init=function(){var e=STENCIL_PATH;this.addSearchPalette(!0),this.addImagePalette("entry",mxResources.get("entry"),e+"/entry/","_128x128.png",["start","finally","end"],[mxResources.get("start"),mxResources.get("finally"),mxResources.get("end")]),this.addImagePalette("call_management",mxResources.get("call_management"),e+"/call_management/","_128x128.png",["answer","hangup","dial","ext_dial","queue","voicemail","callback"],[mxResources.get("answer"),mxResources.get("hangup"),mxResources.get("dial"),mxResources.get("ext_dial"),mxResources.get("queue"),mxResources.get("voicemail"),mxResources.get("callback")]),this.addImagePalette("agent_management",mxResources.get("agent_management"),e+"/agent_management/","_128x128.png",["login","pause","unpause","logout"],[mxResources.get("login"),mxResources.get("pause"),mxResources.get("unpause"),mxResources.get("logout")]),this.addImagePalette("variable",mxResources.get("variable"),e+"/variable/","_128x128.png",["set","math"],[mxResources.get("set"),mxResources.get("math")]),this.addImagePalette("playback",mxResources.get("playback"),e+"/playback/","_128x128.png",["playback","menu","saydigits","saynumber","sayphonetic","getdigits","getsecretdigits"],[mxResources.get("playback"),mxResources.get("menu"),mxResources.get("saydigits"),mxResources.get("saynumber"),mxResources.get("sayphonetic"),mxResources.get("getdigits"),mxResources.get("getsecretdigits")]),this.addImagePalette("recording",mxResources.get("recording"),e+"/recording/","_128x128.png",["record"],[mxResources.get("record")]),this.addImagePalette("tts","TTS",e+"/tts/","_128x128.png",["tts","ispeechtts","awspolly","lumenvoxtts","sestektts"],["GoogleTTS","ISpeechTTS","AWSPolly","LumenvoxTTS","SestekTTS"]),this.addImagePalette("asr","ASR",e+"/asr/","_128x128.png",["googleasr","ispeechasr","lumenvoxasr","tildeasr","sestekasr"],["GoogleASR","ISpeechASR","LumenvoxASR","TildeASR","SestekASR"]),this.addImagePalette("integrationServer",mxResources.get("integrationServer"),e+"/integration_server/","_128x128.png",["database","sendMail","sendSMS","dialogflow","awslex","sesteknda"],[mxResources.get("database"),mxResources.get("sendMail"),mxResources.get("sendSMS"),"Dialogflow","AWSLex","SestekNDA"]),this.addImagePalette("callflow",mxResources.get("callflow"),e+"/callflow/","_128x128.png",["gotoc","gotoif","gotoiftime","vswitch"],[mxResources.get("gotoc"),mxResources.get("gotoif"),mxResources.get("gotoiftime"),mxResources.get("vswitch")]),this.addImagePalette("stats",mxResources.get("stats"),e+"/stats/","_128x128.png",["goal"],[mxResources.get("goal")]),this.addImagePalette("general",mxResources.get("general"),e+"/general/","_128x128.png",["noop","system","agi","subproject","custom_app"],[mxResources.get("noop"),mxResources.get("system"),mxResources.get("agi"),mxResources.get("subproject"),mxResources.get("custom_app")])},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.thumbWidth=36,Sidebar.prototype.thumbHeight=36,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2,Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Sidebar.prototype.showTooltip=function(c,m,u,p,g,v){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=c){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var e=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px",document.body.appendChild(this.tooltipImage)),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),u>this.maxTooltipWidth||p>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/u,this.maxTooltipHeight/p))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==v||v,this.graph2.addCells(m);var e=this.graph2.getGraphBounds(),t=e.width+2*this.tooltipBorder+4,n=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(n+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=t+"px",this.tooltipTitles&&null!=g&&0<g.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",mxClient.IS_SVG||(this.tooltipTitle.style.position="absolute"),this.tooltipTitle.style.paddingTop="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,g);var a=this.tooltipTitle.offsetHeight+10;n+=a,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-a+"px":(n-=6,this.tooltipTitle.style.top=n-a+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=n+"px";var i=-Math.round(e.x-this.tooltipBorder),s=-Math.round(e.y-this.tooltipBorder),o=document.body,r=document.documentElement,l=(o.clientHeight||r.clientHeight,document.getElementById("vertical-navigation").offsetWidth+this.container.clientWidth),d=Math.max(0,this.getOffset(c).top-this.container.scrollTop-n/2+16);mxClient.IS_SVG?0!=i||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+i+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=i+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=l+"px",this.tooltip.style.top=d+"px",this.tooltipImage.style.left=l-13+"px",this.tooltipImage.style.top=d+n/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?e():this.thread=window.setTimeout(e,this.tooltipDelay),this.currentElt=c}},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},Sidebar.prototype.addEntry=function(e,t){if(null!=this.taglist&&null!=e&&0<e.length)for(var n=e.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),a=0;a<n.length;a++)if(n[a]=n[a].replace(/\.*\d*$/,""),1<n[a].length){var i=this.taglist[n[a]];null==i&&(i={entries:[],dict:new mxDictionary},this.taglist[n[a]]=i),null==i.dict.get(t)&&(i.dict.put(t,t),i.entries.push(t))}return t},Sidebar.prototype.searchEntries=function(e,t,n,a,i){if(null!=this.taglist&&null!=e){for(var s=e.toLowerCase().split(" "),o=new mxDictionary,r=(n+1)*t,l=[],d=0,c=0;c<s.length;c++)if(0<s[c].length){var m=this.taglist[s[c]],u=new mxDictionary;if(null!=m){var p=m.entries;l=[];for(var g=0;g<p.length;g++){m=p[g];if(0==d==(null==o.get(m))&&(u.put(m,m),l.push(m),c==s.length-1&&l.length==r))return void a(l.slice(n*t,r),r,!0)}}else l=[];o=u,d++}var v=l.length;a(l.slice(n*t,(n+1)*t),v,!1)}else a([])},Sidebar.prototype.filterTags=function(e){if(null==e)return null;for(var t=e.split(" "),n=[],a={},i=0;i<t.length;i++)null==a[t[i]]&&(a[t[i]]="1",n.push(t[i]));return n.join(" ")},Sidebar.prototype.cloneCell=function(e,t){var n=e.clone();return null!=t&&(n.value=t),n},Sidebar.prototype.addSearchPalette=function(e){var t=document.createElement("div");t.style.visibility="hidden",this.container.appendChild(t);var r=document.createElement("div");r.className="geSidebar",r.style.boxSizing="border-box",r.style.overflow="hidden",r.style.width="100%",r.style.padding="8px",r.style.paddingTop="14px",r.style.paddingBottom="0px",e||(r.style.display="none");var n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.textOverflow="clip",n.style.paddingBottom="8px",n.style.cursor="default";var a=document.createElement("input");a.setAttribute("placeholder",mxResources.get("searchShapes")),a.setAttribute("type","text"),a.style.fontSize="12px",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.border="solid 1px #d5d5d5",a.style.borderRadius="4px",a.style.width="100%",a.style.outline="none",a.style.padding="6px",n.appendChild(a);var i,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(a.style.height="28px",s.style.top="-4px"):s.style.top="2px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",n.appendChild(s),r.appendChild(n);var l=document.createElement("center"),d=mxUtils.button(mxResources.get("moreResults"),function(){i()});d.style.display="none",d.style.lineHeight="normal",d.style.marginTop="4px",d.style.marginBottom="8px",l.style.paddingTop="4px",l.style.paddingBottom="8px",l.appendChild(d),r.appendChild(l);var c="",m=!1,u=!1,p=0,g=new Object,v=12,h=mxUtils.bind(this,function(){m=!1,this.currentSearch=null;for(var e=r.firstChild;null!=e;){var t=e.nextSibling;e!=n&&e!=l&&e.parentNode.removeChild(e),e=t}});i=mxUtils.bind(this,function(){if(v=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=a.value){if(null!=l.parentNode&&(c!=a.value&&(h(),c=a.value,g=new Object,u=!1,p=0),!m&&!u)){d.setAttribute("disabled","true"),d.style.display="",d.style.cursor="wait",d.innerHTML=mxResources.get("loading")+"...",m=!0;var o=new Object;this.currentSearch=o,this.searchEntries(c,v,p,mxUtils.bind(this,function(e,t,n){if(this.currentSearch==o){e=null!=e?e:[],m=!1,p++,l.parentNode.removeChild(l);for(var a=0;a<e.length;a++){var i=e[a]();null==g[i.innerHTML]&&(g[i.innerHTML]="1",r.appendChild(e[a]()))}if(n?(d.removeAttribute("disabled"),d.innerHTML=mxResources.get("moreResults")):(d.innerHTML=mxResources.get("reset"),d.style.display="none",u=!0),d.style.cursor="",0==e.length&&1==p){var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.color="gray",s.style.padding="0px",s.style.margin="0px 8px 0px 8px",s.style.paddingTop="6px",s.style.textAlign="center",s.style.cursor="default",mxUtils.write(s,mxResources.get("noResultsFor",[c])),r.appendChild(s)}r.appendChild(l)}}),mxUtils.bind(this,function(){d.style.cursor=""}))}}else h(),a.value="",c="",g=new Object,d.style.display="none",u=!1,a.focus()}),mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){13==e.keyCode&&i()})),mxEvent.addListener(a,"focus",function(){a.style.paddingRight="",s.style.display="none"}),mxEvent.addListener(a,"blur",function(){a.style.paddingRight="20px",s.style.display=""}),a.style.paddingRight="20px",mxEvent.addListener(a,"keyup",mxUtils.bind(this,function(e){""==a.value?(u=!0,d.style.display="none"):a.value!=c?(d.style.display="none",u=!1):m||(d.style.display=u?"none":"")})),mxEvent.addListener(a,"mousedown",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0}),mxEvent.addListener(a,"selectstart",function(e){e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0});var o=document.createElement("div");o.appendChild(r),this.container.appendChild(o),this.palettes.search=[t,o]},Sidebar.prototype.createTitle=function(e){var t=document.createElement("a");return t.setAttribute("href","javascript:void(0);"),t.setAttribute("title",mxResources.get("sidebarTooltip")),t.className="geTitle",mxUtils.write(t,e),t},Sidebar.prototype.createThumb=function(e,t,n,a,i,s,o,r,l){this.graph.labelsVisible=null==s||s;var d=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(e);var c=this.graph.getGraphBounds(),m=Math.floor(100*Math.min((t-2*this.thumbBorder)/c.width,(n-2*this.thumbBorder)/c.height))/100;this.graph.view.scaleAndTranslate(m,Math.floor((t-c.width*m)/2/m-c.x),Math.floor((n-c.height*m)/2/m-c.y));var u=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?(u=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML:u=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=d,mxClient.IS_IE6&&(a.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),u.style.position="relative",u.style.overflow="hidden",u.style.cursor="move",u.style.left=this.thumbBorder+"px",u.style.top=this.thumbBorder+"px",u.style.width=t+"px",u.style.height=n+"px",u.style.visibility="",u.style.minWidth="",u.style.minHeight="",a.appendChild(u),this.sidebarTitles&&null!=i&&0!=o){var p=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;a.style.height=this.thumbHeight+p+this.sidebarTitleSize+8+"px";var g=document.createElement("div");g.style.fontSize=this.sidebarTitleSize+"px",g.style.color="#303030",g.style.textAlign="center",g.style.whiteSpace="nowrap",mxClient.IS_IE&&(g.style.height=this.sidebarTitleSize+12+"px"),g.style.paddingTop="4px",mxUtils.write(g,i),a.appendChild(g)}return c},Sidebar.prototype.createItem=function(t,n,a,e,i,s,o){var r=document.createElement("a");r.setAttribute("href","javascript:void(0);"),r.className="geItem",r.style.overflow="hidden";var l=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+l+"px",r.style.height=this.thumbHeight+l+"px",r.style.padding=this.thumbPadding+"px",mxEvent.addListener(r,"click",function(e){mxEvent.consume(e)}),this.createThumb(t,this.thumbWidth,this.thumbHeight,r,n,a,e,i,s);var d=new mxRectangle(0,0,i,s);if(1<t.length||t[0].vertex){var c=this.createDragSource(r,this.createDropHandler(t,!0,o,d),this.createDragPreview(i,s),t,d);this.addClickHandler(r,c,t),c.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=t[0]&&t[0].edge){c=this.createDragSource(r,this.createDropHandler(t,!1,o,d),this.createDragPreview(i,s),t,d);this.addClickHandler(r,c,t)}return mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(e){this.showTooltip(r,t,d.width,d.height,n,a)})),r},Sidebar.prototype.createDropHandler=function(g,v,h,f){return h=null==h||h,mxUtils.bind(this,function(e,t,n,a,i){if(e.isEnabled()){if(0<(g=e.getImportableCells(g)).length){e.stopEditing();var s=null!=n&&e.isValidDropTarget(n,g,t),o=null;if(null==n||s||(n=null),!e.isCellLocked(n||e.getDefaultParent())){e.model.beginUpdate();try{if(a=Math.round(a),i=Math.round(i),v&&e.isSplitTarget(n,g,t)){var r=e.cloneCells(g);e.splitEdge(n,r,null,a-f.width/2,i-f.height/2),o=r}else 0<g.length&&(o=e.importCells(g,a,i,n));if(null!=e.layoutManager){var l=e.layoutManager.getLayout(n);if(null!=l)for(var d=e.view.scale,c=e.view.translate,m=(a+c.x)*d,u=(i+c.y)*d,p=0;p<o.length;p++)l.moveCell(o[p],m,u)}h&&e.fireEvent(new mxEventObject("cellsInserted","cells",o))}finally{e.model.endUpdate()}null!=o&&0<o.length&&(e.scrollCellToVisible(o[0]),e.setSelectionCells(o))}}mxEvent.consume(t)}})},Sidebar.prototype.createDragPreview=function(e,t){var n=document.createElement("div");return n.style.border="1px dashed black",n.style.width=e+"px",n.style.height=t+"px",n},Sidebar.prototype.createDragSource=function(e,t,n){var a=mxUtils.makeDraggable(e,this.editorUi.editor.graph,t,n,0,0,this.editorUi.editor.graph.autoscroll,!0,!0);return a.getDropTarget=function(e,t,n){var a=mxDragSource.prototype.getDropTarget.apply(this,arguments);return e.isValidRoot(a)||(a=null),a},a},Sidebar.prototype.addClickHandler=function(e,a){var i=this.editorUi.editor.graph,s=null;mxEvent.addGestureListeners(e,function(e){s=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e))});var o=a.mouseUp;a.mouseUp=function(e){if(!mxEvent.isPopupTrigger(e)&&null==this.currentGraph&&null!=s){var t=i.tolerance;if(Math.abs(s.x-mxEvent.getClientX(e))<=t&&Math.abs(s.y-mxEvent.getClientY(e))<=t){var n=i.getGridSize();a.drop(i,e,null,n,n)}}o.apply(this,arguments),s=null}},Sidebar.prototype.createVertexTemplateEntry=function(e,t,n,a,i,s,o,r){return r=null!=r&&0<r.length?r:i.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(e,t,n,a,i,s,o)}))},Sidebar.prototype.createXmlDocument=function(e,t,n,a){var i=mxUtils.createXmlDocument().createElement(e);return i.setAttribute("label",t),n.forEach(function(e,t){i.setAttribute(e,a[t]?a[t]:"")}),i},Sidebar.prototype.createVertexTemplate=function(e,t,n,a,i,s,o,r){var l=[],d=[];switch(a){case"answer":l=["timeout"],d=["0"];break;case"start":l=["answer"],d=["yes"];break;case"googleasr":l=["key","google_asr_language","timeout","intKey","beep"],d=["","it-IT","10","#","BEEP"];break;case"tildeasr":l=["uri","appid","appsecret","timeout","intKey","beep"],d=["wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE","","","10","#","BEEP"];break;case"ispeechasr":l=["key","model","ispeech_asr_language","timeout","intKey","beep"],d=["","","it-IT","10","#","BEEP"];break;case"playback":l=["file_id","opts"],d=["0"];break;case"background":l=["file_id","response","digit"],d=["0","5","1"];break;case"menu":l=["file_id","response","digit","retry","variable_id"],d=["0","5","1","1","0"];break;case"getdigits":l=["file_id","response","mindigit","maxdigit","retry","variable_id"],d=["0","5","1","10","1","0"];break;case"getsecretdigits":l=["file_id","response","mindigit","maxdigit","retry","hiddendigitsnum","hiddendigitspos","variable_id"],d=["0","5","1","10","1","0","first","0"];break;case"custom_app":l=["application","options"],d=["",""];break;case"set":l=["variable_id","variable_value"],d=["0",""];break;case"database":l=["odbc_id","query","variable_id"],d=["0","",""];break;case"noop":l=["output"],d=[];break;case"gotoc":l=["context","extension","priority"],d=["","","1"];break;case"system":l=["variable_id","command"],d=[];break;case"agi":l=["command","args"],d=[];break;case"gotoif":l=["condition"],d=[];break;case"gotoiftime":l=["interval_id"],d=["0"];break;case"vswitch":l=["variable_id"],d=["0"];break;case"saydigits":l=["digits","escape_digits"],d=["","#"];break;case"saynumber":l=["number","escape_digits"],d=["","#"];break;case"sayphonetic":l=["text","escape_digits"],d=["","#"];break;case"record":l=["file","recordingFormat","timeout","escape_digits"],d=["","wav","-1","#"];break;case"dial":l=["sip_id","timeout","opts","url"],d=["0","60"];break;case"ext_dial":l=["phone","trunk_name","timeout","opts","url"],d=["","-1","60"];break;case"tts":l=["text","google_tts_language"],d=["","it"];break;case"ispeechtts":l=["text","key","ispeech_tts_language","speed","intKey"],d=["","","euritalianfemale","0","#"];break;case"lumenvoxtts":case"sestektts":l=["text","options"],d=["",""];break;case"lumenvoxasr":l=["grammar","options"],d=["",""];break;case"sestekasr":l=["grammar","options"],d=["/usr/local/unimrcp/data/grammar.xml",""];break;case"awspolly":l=["aws_access_key_id","aws_secret_access_key","aws_polly_region","aws_polly_voice","text","aws_text_type"],d=["","","eu-west-1","Amy","","text"];break;case"awslex":l=["aws_access_key_id","aws_secret_access_key","aws_lex_region","aws_bot_name","text"],d=["","","eu-west-1","",""];break;case"queue":l=["queue_id","opts","url","file_id","timeout","agi","macro","gosub","position"],d=["-1","xX","","","300"];break;case"voicemail":l=["mailbox","options"],d=["",""];break;case"subproject":l=["project_id"],d=["0"];break;case"math":l=["operation","variable_id"],d=["","0"];break;case"queuelog":l=["queuename","agent","queue_event","data1","data2","data3","data4","data5"],d=[];break;case"goal":l=["goalname"],d=[];break;case"callback":l=["name","lastName","phone","list_id","delay","callback_priority"],d=["{CALLERID(name)}","","{CALLERID(num)}","-1","5","2"];break;case"sendSMS":l=["sms_account_id","to","sms_text"],d=["0"];break;case"sendMail":l=["account_id","to","cc","bcc","subject","text"],d=["0"];break;case"sendFax":l=["account_id","to","choose_attachment","attachment_name","attachment_type","attachment_path"],d=["0"];break;case"login":case"unpause":case"logout":l=["findBy"],d=["internal"];break;case"pause":l=["findBy","pause_id"],d=["internal",""];break;case"dialogflow":l=["key","text","dialogflow_language"],d=["","","it"];break;case"sesteknda":l=["ndauth_url","username","password","ndassistant_url","text","project","ndagenerate_audio","custom_action","custom_action_data","ndaactivity_type"],d=["","","","","","",1,"","","message"];break;default:l=[],d=[]}var c=[new mxCell(this.createXmlDocument(a,i,l,d),new mxGeometry(0,0,t,n),e)];return c[0].vertex=!0,this.createVertexTemplateFromCells(c,t,n,i,s,o,r)},Sidebar.prototype.createVertexTemplateFromCells=function(e,t,n,a,i,s,o){return this.createItem(e,a,i,s,t,n,o)},Sidebar.prototype.createEdgeTemplate=function(e,t,n,a,i,s,o){var r=new mxCell(null!=a?a:"",new mxGeometry(0,0,t,n),e);return r.geometry.setTerminalPoint(new mxPoint(0,n),!0),r.geometry.setTerminalPoint(new mxPoint(t,0),!1),r.geometry.relative=!0,r.edge=!0,this.createEdgeTemplateFromCells([r],t,n,i,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(e,t,n,a,i,s){return this.createItem(e,a,i,!0,t,n,s)},Sidebar.prototype.addPaletteFunctions=function(e,t,n,a){this.addPalette(e,t,n,mxUtils.bind(this,function(e){for(var t=0;t<a.length;t++)e.appendChild(a[t](e))}))},Sidebar.prototype.addPalette=function(e,t,n,a){var i=this.createTitle(t);this.container.appendChild(i);var s=document.createElement("div");s.className="geSidebar",mxClient.IS_POINTER&&(s.style.touchAction="none"),mxEvent.addListener(s,"mousemove",mxUtils.bind(this,function(e){mxEvent.getSource(e)==s?s.setAttribute("title",mxResources.get("sidebarTooltip")):s.removeAttribute("title")})),n?(a(s),a=null):s.style.display="none",this.addFoldingHandler(i,s,a);var o=document.createElement("div");return o.appendChild(s),this.container.appendChild(o),null!=e&&(this.palettes[e]=[i,o]),s},Sidebar.prototype.addFoldingHandler=function(n,a,i){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==a.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(e){if("none"==a.style.display){if(s)a.style.display="block";else if(s=!0,null!=i){n.style.cursor="wait";var t=n.innerHTML;n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,i(a),mxClient.NO_FO=e,a.style.display="block",n.style.cursor="",n.innerHTML=t},0)}else a.style.display="block";n.style.backgroundImage="url('"+this.expandedImage+"')"}else n.style.backgroundImage="url('"+this.collapsedImage+"')",a.style.display="none";mxEvent.consume(e)}))},Sidebar.prototype.addImagePalette=function(e,t,s,o,r,n,a){for(var l=[],d=0;d<r.length;d++)mxUtils.bind(this,function(e,t,n){if(null==n){var a=e.lastIndexOf("/"),i=e.lastIndexOf(".");n=e.substring(0<=a?a+1:0,0<=i?i:e.length).replace(/[-_]/g," ")}l.push(this.createVertexTemplateEntry("image;html=1;image="+s+e+o,this.defaultImageWidth,this.defaultImageHeight,r[d],t,!1,!0,this.filterTags(n)))})(r[d],null!=n?n[d]:null,null!=a?a[r[d]]:null);this.addPaletteFunctions(e,t,!1,l)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0),mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{if(null!=navigator&&null!=navigator.language){var e=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===e||"en-ca"===e||"es-mx"===e?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.gridColor="#e0e0e0",mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",Graph=function(e,t,n,a){mxGraph.call(this,e,t,n,a),this.setConnectable(!0),this.setDropEnabled(!1),this.setPanning(!0),this.setTooltips(!mxClient.IS_TOUCH),this.setAllowLoops(!1),this.setMultigraph(!1),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.connectionHandler.targetConnectImage=!0,this.setAllowDanglingEdges(!1),this.connectionHandler.setCreateTarget(!1),this.connectionHandler.isValidSource=function(){return mxConnectionHandler.prototype.isValidSource.apply(this,arguments)&&"2"!=urlParams.connect},this.alternateEdgeStyle="vertical",null==a&&this.loadStylesheet();var i=new mxRubberband(this);this.getRubberband=function(){return i},this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.container.style.cursor="pointer"})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.container.style.cursor="default"})),this.isHtmlLabel=function(e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);return"1"==n.html||"wrap"==n.whiteSpace},this.cellRenderer.getLabelValue=function(e){var t=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return"wrap"==e.style.whiteSpace&&1!=e.style.html&&(t=mxUtils.htmlEntities(t,!1)),t},this.isCellLocked=function(e){return!1},this.connectionHandler.tapAndHoldTolerance=16;var s=this.connectionHandler.tapAndHold;this.connectionHandler.tapAndHold=function(e,t){null==t?this.graph.panningHandler.active||(i.start(e.getGraphX(),e.getGraphY()),this.graph.panningHandler.panningTrigger=!1):tapAndHoldStartsConnection?s.apply(this,arguments):this.graph.isCellSelected(t.cell)&&1<this.graph.getSelectionCount()&&this.graph.removeSelectionCell(t.cell)},touchStyle&&this.initTouch()},mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.loadStylesheet=function(){var e=mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();new mxCodec(e.ownerDocument).decode(e,this.getStylesheet())},Graph.prototype.flipEdge=function(e){if(null!=e){var t=this.view.getState(e),n=null!=t?t.style:this.getCellStyle(e);if(null!=n){var a=mxUtils.getValue(n,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,a,[e])}}},Graph.prototype.setDefaultEdge=function(e){if(null!=e&&this.getModel().isEdge(e)){var t=this.getModel().cloneCells([e])[0];null!=t.geometry&&(t.geometry.points=null);var n=t.getStyle();n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_ENTRY_Y,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_X,null),n=mxUtils.setStyle(n,mxConstants.STYLE_EXIT_Y,null),t.setStyle(n),this.connectionHandler.createEdgeState=function(e){return this.graph.view.createState(t)},this.connectionHandler.factoryMethod=function(){return this.graph.cloneCells([t])[0]}}},Graph.prototype.isCellFoldable=function(e){return this.foldingEnabled&&this.isSwimlane(e)},Graph.prototype.isValidRoot=function(e){return this.isSwimlane(e)},Graph.prototype.createGroupCell=function(){var e=mxGraph.prototype.createGroupCell.apply(this,arguments);return e.setStyle("group"),e},Graph.prototype.getTooltipForCell=function(e){var t="";return this.getModel().isVertex(e)?t+=mxResources.get("description_"+e.value.nodeName)||"":this.getModel().isEdge(e)&&(t=mxGraph.prototype.getTooltipForCell.apply(this,arguments)),t},Graph.prototype.convertValueToString=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("label"):mxGraph.prototype.convertValueToString.apply(this,arguments)},Graph.prototype.cellLabelChanged=function(e,t,n){if(null!=e.value&&"object"==typeof e.value){var a=e.value.cloneNode(!0);a.setAttribute("label",t),t=a}mxGraph.prototype.cellLabelChanged.apply(this,arguments)},Graph.prototype.setLinkForCell=function(e,t){var n=null;null!=e.value&&"object"==typeof e.value?n=e.value.cloneNode(!0):(n=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",e.value);null!=t&&0<t.length?n.setAttribute("link",t):n.removeAttribute("link"),this.model.setValue(e,n)},Graph.prototype.getLinkForCell=function(e){return null!=e.value&&"object"==typeof e.value?e.value.getAttribute("link"):null},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(e,t){this.panningHandler.hideMenu()});var s=!1,o=null;this.updateMouseEvent=function(e){if(mxGraph.prototype.updateMouseEvent.apply(this,arguments),null==e.getState()){var t=this.getCellAt(e.graphX,e.graphY);this.getModel().isEdge(t)&&(e.state=this.view.getState(t),null!=e.state&&null!=e.state.shape&&(this.container.style.cursor=e.state.shape.node.style.cursor))}null==e.getState()&&(this.container.style.cursor="default")},this.fireMouseEvent=function(e,t,n){if(e==mxEvent.MOUSE_DOWN)this.panningHandler.isMenuShowing()?(s=!1,o=null):(o=t.getCell(),s=null!=o?this.isCellSelected(o):this.isSelectionEmpty());else if(e==mxEvent.MOUSE_UP){if(s&&!this.isEditing()){if(!this.panningHandler.isMenuShowing()){var a=mxEvent.getClientX(t.getEvent()),i=mxEvent.getClientY(t.getEvent());this.panningHandler.popup(a+16,i,o,t.getEvent())}return s=!1,o=null,void t.consume()}s=!1,o=null}mxGraph.prototype.fireMouseEvent.apply(this,arguments),e==mxEvent.MOUSE_MOVE&&t.isConsumed()&&(s=!1,o=null)}},function(){if(mxVertexHandler.prototype.rotationEnabled=!0,mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,touchStyle){mxConstants.HANDLE_SIZE=16,mxConstants.LABEL_HANDLE_SIZE=7,mxClient.IS_TOUCH&&(mxVertexHandler.prototype.tolerance=4,mxEdgeHandler.prototype.tolerance=6,Graph.prototype.tolerance=14,Graph.prototype.gridSize=20,mxPanningHandler.prototype.selectOnPopup=!1,mxPanningHandler.prototype.useLeftButtonForPanning=!0,mxPanningHandler.prototype.isPanningTrigger=function(e){var t=e.getEvent();return this.useLeftButtonForPanning&&(this.ignoreCell||null==e.getState())||mxEvent.isControlDown(t)&&mxEvent.isShiftDown(t)||this.usePopupTrigger&&mxEvent.isPopupTrigger(t)});var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(e,t){n.apply(this,arguments),this.graph.isCellSelected(t.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)},Graph.prototype.createHandlers=function(e){this.tooltipHandler=new mxTooltipHandler(this),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=new mxSelectionCellsHandler(this),this.panningHandler=new mxPanningHandler(this),this.panningHandler.panningEnabled=!1,this.connectionHandler=new mxConnectionHandler(this),this.connectionHandler.setEnabled(!1),this.graphHandler=new mxGraphHandler(this)},mxConnectionHandler.prototype.selectCells=function(e,t){touchStyle&&null!=t?this.graph.setSelectionCell(t):this.graph.setSelectionCell(e)};var a=mxGraph.prototype.dblClick;Graph.prototype.dblClick=function(e,t){if(null==t){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));t=this.getCellAt(n.x,n.y)}a.call(this,e,t)};var e=new mxImage(IMAGE_PATH+"/touch-handle.png",16,16);mxVertexHandler.prototype.handleImage=e,mxEdgeHandler.prototype.handleImage=e,mxOutline.prototype.sizerImage=e,(new Image).src=e.src;var t=IMAGE_PATH+"/touch-connector.png",i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(this.connectorImg=mxUtils.createImage(t),this.connectorImg.style.cursor="pointer",this.connectorImg.style.width="29px",this.connectorImg.style.height="29px",this.connectorImg.style.position="absolute",mxClient.IS_TOUCH||(this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state)),this.connectorImg.style.padding="2px",mxEvent.addGestureListeners(this.connectorImg,mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};var s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+4+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};var o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)},(new Image).src=t}else{var r=new mxImage(IMAGE_PATH+"/connector.png",15,15);if(mxConnectionHandler.prototype.connectImage=r,(new Image).src=r.src,"2"==urlParams.connect){r=new mxImage(IMAGE_PATH+"/connector.png",15,15),i=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){i.apply(this,arguments),showConnectorImg&&this.graph.connectionHandler.isEnabled()&&this.graph.isCellConnectable(this.state.cell)&&!this.graph.isValidRoot(this.state.cell)&&1==this.graph.getSelectionCount()&&(mxClient.IS_IE&&!mxClient.IS_SVG?(this.connectorImg=document.createElement("div"),this.connectorImg.style.backgroundImage="url("+r.src+")",this.connectorImg.style.backgroundPosition="center",this.connectorImg.style.backgroundRepeat="no-repeat",this.connectorImg.style.width=r.width+4+"px",this.connectorImg.style.height=r.height+4+"px",this.connectorImg.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):(this.connectorImg=mxUtils.createImage(r.src),this.connectorImg.style.width=r.width+"px",this.connectorImg.style.height=r.height+"px"),this.connectorImg.style.cursor="pointer",this.connectorImg.style.position="absolute",this.connectorImg.setAttribute("title",mxResources.get("connect")),mxEvent.redirectMouseEvents(this.connectorImg,this.graph,this.state),this.connectorImg.style.padding="2px",mxEvent.addListener(this.connectorImg,"mousedown",mxUtils.bind(this,function(e){this.graph.panningHandler.hideMenu();var t=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.graph.connectionHandler.start(this.state,t.x,t.y),this.graph.isMouseDown=!0,mxEvent.consume(e)})),this.graph.container.appendChild(this.connectorImg)),this.redrawTools()};s=mxVertexHandler.prototype.redraw;mxVertexHandler.prototype.redraw=function(){s.apply(this),this.redrawTools()},mxVertexHandler.prototype.redrawTools=function(){null!=this.state&&null!=this.connectorImg&&(mxVertexHandler.prototype.singleSizer?(this.connectorImg.style.left=this.state.x+this.state.width-this.connectorImg.offsetWidth/2+"px",this.connectorImg.style.top=this.state.y-this.connectorImg.offsetHeight/2+"px"):(this.connectorImg.style.left=this.state.x+this.state.width+mxConstants.HANDLE_SIZE/2+2+"px",this.connectorImg.style.top=this.state.y+(this.state.height-this.connectorImg.offsetHeight)/2+"px"))};o=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(e,t){o.apply(this,arguments),null!=this.connectorImg&&(this.connectorImg.parentNode.removeChild(this.connectorImg),this.connectorImg=null)}}}}(),Actions.prototype.init=function(){var t=this.editorUi,l=t.editor,d=l.graph;this.addAction("new",function(){t.projectDesignController.newProject()},CRUD_PERMISSIONS.canEdit),this.addAction("open",function(){t.projectDesignController.openProject()},CRUD_PERMISSIONS.canEdit),this.addAction("save",function(){t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml())),t.editor.modified=!1},CRUD_PERMISSIONS.canEdit,null,"Ctrl+S"),this.addAction("saveAs",function(){t.projectDesignController.saveProjectAs(mxUtils.getPrettyXml(l.getGraphXml()))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+S"),this.addAction("publish",function(){t.editor.setStatus(""),null===t.validate()?(t.projectDesignController.saveOrPublishProject(mxUtils.getPrettyXml(l.getGraphXml()),!0),t.editor.modified=!1):(t.editor.setStatus("...Error publishing! Please check the project and try again!"),setTimeout(function(){t.editor.setStatus("")},3e3))},CRUD_PERMISSIONS.canEdit,null,"Ctrl+Shift+P"),this.addAction("variable",function(){t.projectDesignController.newVariable()},CRUD_PERMISSIONS.canEdit),this.addAction("import",function(){t.projectDesignController.importXML(function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("export",function(){t.exportXML(mxUtils.getPrettyXml(l.getGraphXml()))},null,null,"Ctrl+E"),this.addAction("editFile",function(){t.projectDesignController.editXML(mxUtils.getPrettyXml(l.getGraphXml()),function(e){l.setGraphXml(mxUtils.parseXml(e).documentElement)})},CRUD_PERMISSIONS.canEdit),this.addAction("print",function(){mxUtils.printScreen(d)},null,"sprite-print","Ctrl+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){l.undoManager.undo()},null,"sprite-undo","Ctrl+Z"),this.addAction("redo",function(){l.undoManager.redo()},null,"sprite-redo","Ctrl+Y"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut","Ctrl+X"),this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy","Ctrl+C"),this.addAction("paste",function(){mxClipboard.paste(d)},!1,"sprite-paste","Ctrl+V"),this.addAction("delete",function(){d.removeCells()},null,null,"Delete"),this.addAction("duplicate",function(){var e=d.gridSize;d.setSelectionCells(d.moveCells(d.getSelectionCells(),e,e,!0))},null,null,"Ctrl+D"),this.addAction("selectVertices",function(){d.selectVertices()},null,null,"Ctrl+Shift+V"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,"Ctrl+Shift+E"),this.addAction("selectAll",function(){d.selectAll()},null,null,"Ctrl+A"),this.addAction("home",function(){d.home()},null,null,"Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,"Page Up"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,"Page Down"),this.addAction("expand",function(){d.foldCells(!1)},null,null,"Enter"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,"Backspace"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,"Ctrl+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,"Ctrl+B"),this.addAction("group",function(){d.setSelectionCell(d.groupCells(null,0))},null,null,"Ctrl+G"),this.addAction("ungroup",function(){d.setSelectionCells(d.ungroupCells())},null,null,"Ctrl+U"),this.addAction("removeFromGroup",function(){d.removeCellsFromParent()}),this.addAction("editLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null==t&&(t=""),null!=(t=mxUtils.prompt(mxResources.get("enterValue"),t))&&d.setLinkForCell(e,t)}),this.addAction("openLink",function(){var e=d.getSelectionCell(),t=d.getLinkForCell(e);null!=t&&window.open(t)}),this.addAction("autosize",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];d.getModel().getChildCount(n)?d.updateGroupBounds([n],20):d.updateCellSize(n)}}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var e=d.getView().getState(d.getSelectionCell()),t="wrap";null!=e&&"wrap"==e.style[mxConstants.STYLE_WHITE_SPACE]&&(t=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,t)}),this.addAction("rotation",function(){var e="0",t=d.getView().getState(d.getSelectionCell());null!=t&&(e=t.style[mxConstants.STYLE_ROTATION]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)",e))&&d.setCellStyles(mxConstants.STYLE_ROTATION,e)}),this.addAction("tilt",function(){var e=d.getSelectionCells();if(null!=e){d.getModel().beginUpdate();try{for(var t=0;t<e.length;t++){var n=e[t];if(d.getModel().isVertex(n)&&0==d.getModel().getChildCount(n)){var a=d.getCellGeometry(n);if(null!=a){(a=a.clone()).x+=a.width/2-a.height/2,a.y+=a.height/2-a.width/2;var i=a.width;a.width=a.height,a.height=i,d.getModel().setGeometry(n,a);var s=d.view.getState(n);if(null!=s){var o=s.style[mxConstants.STYLE_DIRECTION]||"east";"east"==o?o="south":"south"==o?o="west":"west"==o?o="north":"north"==o&&(o="east"),d.setCellStyles(mxConstants.STYLE_DIRECTION,o,[n])}}}}}finally{d.getModel().endUpdate()}}},null,null,"Ctrl+R"),this.addAction("actualSize",function(){d.zoomTo(1)}),this.addAction("zoomIn",function(){d.zoomIn()},null,null,"Add"),this.addAction("zoomOut",function(){d.zoomOut()},null,null,"Subtract"),this.addAction("fitWindow",function(){d.fit()}),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=d.container.clientHeight-20,i=Math.floor(100*Math.min(n/e.width/t,a/e.height/t))/100;d.zoomTo(i),d.container.scrollLeft=Math.round(d.view.translate.x*i-Math.max(10,(d.container.clientWidth-e.width*t*i)/2)),d.container.scrollTop=Math.round(d.view.translate.y*i-Math.max(10,(d.container.clientHeight-e.height*t*i)/2))})),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var e=d.pageFormat,t=d.pageScale,n=d.container.clientWidth-20,a=Math.floor(100*n/e.width/t)/100;d.zoomTo(a),d.container.scrollLeft=Math.round(d.view.translate.x*a-Math.max(10,(d.container.clientWidth-e.width*t*a)/2)),d.container.scrollTop=Math.round(d.view.translate.y*a-Math.max(10,(d.container.clientHeight-e.height*t*a)/2))})),this.put("customZoom",new Action(mxResources.get("custom"),function(){var e=mxUtils.prompt(mxResources.get("enterValue")+" (%)",parseInt(100*d.getView().getScale()));null!=e&&0<e.length&&!isNaN(parseInt(e))&&d.zoomTo(parseInt(e)/100)}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),l.updateGraphComponents()},null,null,"Ctrl+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("navigation",function(){d.foldingEnabled=!d.foldingEnabled,d.view.revalidate()})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),(e=this.addAction("scrollbars",function(){if(d.scrollbars=!d.scrollbars,l.updateGraphComponents(),d.scrollbars){var e=d.view.translate.x,t=d.view.translate.y;d.view.translate.x=0,d.view.translate.y=0,d.sizeDidChange(),d.container.scrollLeft-=Math.round(e*d.view.scale),d.container.scrollTop-=Math.round(t*d.view.scale)}else{var n=d.view.translate;d.view.setTranslate(n.x-d.container.scrollLeft/d.view.scale,n.y-d.container.scrollTop/d.view.scale),d.container.scrollLeft=0,d.container.scrollTop=0,d.sizeDidChange()}},!mxClient.IS_TOUCH)).setToggleAction(!0),e.setSelectedCallback(function(){return"auto"==d.container.style.overflow}),(e=this.addAction("pageView",mxUtils.bind(this,function(){d.pageVisible=!d.pageVisible,d.pageBreaksVisible=d.pageVisible,d.preferPageSize=d.pageBreaksVisible,d.view.validate(),d.sizeDidChange(),l.updateGraphComponents(),l.outline.update(),mxUtils.hasScrollbars(d.container)&&(d.pageVisible?(d.container.scrollLeft-=20,d.container.scrollTop-=20):(d.container.scrollLeft+=20,d.container.scrollTop+=20))}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connect",function(){d.setConnectable(!d.connectionHandler.isEnabled())},null,null,"Ctrl+Q")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),this.addAction("help",function(){window.open("https://wiki.xcallymotion.com/display/XMV/Cally+Square")}),this.put("about",new Action(mxResources.get("about")+" Cally Square",function(){window.open("http://callysquare.com/")},null,null,null));var n=mxUtils.bind(this,function(e,t){this.addAction(e,function(){d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,t)})});n("bold",mxConstants.FONT_BOLD),n("italic",mxConstants.FONT_ITALIC),n("underline",mxConstants.FONT_UNDERLINE),this.addAction("shadow",function(){d.toggleCellStyles(mxConstants.STYLE_SHADOW)}),this.addAction("dashed",function(){d.toggleCellStyles(mxConstants.STYLE_DASHED)}),this.addAction("rounded",function(){d.toggleCellStyles(mxConstants.STYLE_ROUNDED)}),this.addAction("curved",function(){d.toggleCellStyles(mxConstants.STYLE_CURVED)}),this.addAction("style",function(){var e=d.getSelectionCells();if(null!=e&&0<e.length){var t=d.getModel(),n=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("style")+")",t.getStyle(e[0])||"");null!=n&&d.setCellStyle(n,e)}}),this.addAction("setAsDefaultEdge",function(){d.setDefaultEdge(d.getSelectionCell())}),this.addAction("addWaypoint",function(){var e=d.getSelectionCell();if(null!=e&&d.getModel().isEdge(e)){var t=l.graph.selectionCellsHandler.getHandler(e);if(t instanceof mxEdgeHandler){var n=d.view.translate,a=d.view.scale,i=n.x,s=n.y,o=d.getModel().getParent(e),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r&&(i+=r.x,s+=r.y),t.addPointAt(t.state,d.panningHandler.triggerX/a-i,d.panningHandler.triggerY/a-s)}}}),this.addAction("removeWaypoint",function(){var e=t.actions.get("removeWaypoint");null!=e.handler&&e.handler.removePoint(e.handler.state,e.index)}),this.addAction("image",function(){var e="",t=d.getView().getState(d.getSelectionCell());if(null!=t&&(e=t.style[mxConstants.STYLE_IMAGE]||e),null!=(e=mxUtils.prompt(mxResources.get("enterValue")+" ("+mxResources.get("url")+")",e))&&0<e.length){var n=new Image;n.onload=function(){!function(e,t,n){var a=null,i=d.getSelectionCells();d.getModel().beginUpdate();try{if(0==i.length){var s=d.getGridSize();a=i=[d.insertVertex(d.getDefaultParent(),null,"",s,s,t,n)]}if(d.setCellStyles(mxConstants.STYLE_IMAGE,e,i),d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i),1==d.getSelectionCount()&&null!=t&&null!=n){var o=i[0],r=d.getModel().getGeometry(o);null!=r&&((r=r.clone()).width=t,r.height=n,d.getModel().setGeometry(o,r))}}finally{d.getModel().endUpdate()}null!=a&&(d.setSelectionCells(a),d.scrollCellToVisible(a[0]))}(e,n.width,n.height)},n.onerror=function(){mxUtils.alert(mxResources.get("fileNotFound"))},n.src=e}})},Actions.prototype.addAction=function(e,t,n,a,i){return this.put(e,new Action(mxResources.get(e),t,n,a,i))},Actions.prototype.put=function(e,t){return this.actions[e]=t},Actions.prototype.get=function(e){return this.actions[e]},mxUtils.extend(Action,mxEventSource),Action.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.setToggleAction=function(e){this.toggleAction=e},Action.prototype.setSelectedCallback=function(e){this.selectedCallback=e},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(e){this.editorUi=e,this.menus=new Object,this.init(),(new Image).src=IMAGE_PATH+"/checkmark.gif"},Menus.prototype.init=function(){var i=this.editorUi.editor.graph;this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,t){for(var n=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],a=0;a<n.length;a++){this.styleChange(e,n[a],[mxConstants.STYLE_FONTFAMILY],[n[a]],null,t).firstChild.nextSibling.style.fontFamily=n[a]}e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,t)}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(e,t){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],a=0;a<n.length;a++)this.styleChange(e,n[a],[mxConstants.STYLE_FONTSIZE],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(pt)","12",mxConstants.STYLE_FONTSIZE,t)}))),this.put("linewidth",new Menu(mxUtils.bind(this,function(e,t){for(var n=[1,2,3,4,8,12,16,24],a=0;a<n.length;a++)this.styleChange(e,n[a]+"px",[mxConstants.STYLE_STROKEWIDTH],[n[a]],null,t);e.addSeparator(t),this.promptChange(e,mxResources.get("custom"),"(px)","1",mxConstants.STYLE_STROKEWIDTH,t)}))),this.put("line",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("straight"),[mxConstants.STYLE_EDGE],[null],null,t),this.styleChange(e,mxResources.get("entityRelation"),[mxConstants.STYLE_EDGE],["entityRelationEdgeStyle"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("horizontal"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","horizontal"],null,t),this.styleChange(e,mxResources.get("vertical"),[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW],["elbowEdgeStyle","vertical"],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("manual"),[mxConstants.STYLE_EDGE],["segmentEdgeStyle"],null,t),this.styleChange(e,mxResources.get("automatic"),[mxConstants.STYLE_EDGE],["orthogonalEdgeStyle"],null,t)}))),this.put("lineend",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_ENDARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("endFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_ENDSIZE,t)}))),this.put("linestart",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("classic"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_CLASSIC],null,t),this.styleChange(e,mxResources.get("openArrow"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OPEN],null,t),this.styleChange(e,mxResources.get("block"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("oval"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_OVAL],null,t),this.styleChange(e,mxResources.get("diamond"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND],null,t),this.styleChange(e,mxResources.get("diamondThin"),[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_DIAMOND_THIN],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("none"),[mxConstants.STYLE_STARTARROW],[mxConstants.NONE],null,t),e.addSeparator(t),e.addItem(mxResources.get("transparent"),null,function(){i.toggleCellStyles("startFill",!0)},t,null,!0),e.addSeparator(t),this.promptChange(e,mxResources.get("size"),"(px)",mxConstants.DEFAULT_MARKERSIZE,mxConstants.STYLE_STARTSIZE,t)}))),this.put("spacing",new Menu(mxUtils.bind(this,function(e,t){var n=this.editorUi.actions.get("shadow").enabled,a=this.get("line").enabled;(n||e.showDisabled)&&(this.promptChange(e,mxResources.get("top"),"(px)","0",mxConstants.STYLE_SPACING_TOP,t,n),this.promptChange(e,mxResources.get("right"),"(px)","0",mxConstants.STYLE_SPACING_RIGHT,t,n),this.promptChange(e,mxResources.get("bottom"),"(px)","0",mxConstants.STYLE_SPACING_BOTTOM,t,n),this.promptChange(e,mxResources.get("left"),"(px)","0",mxConstants.STYLE_SPACING_LEFT,t,n),e.addSeparator(t),this.promptChange(e,mxResources.get("global"),"(px)","0",mxConstants.STYLE_SPACING,t,n),this.promptChange(e,mxResources.get("perimeter"),"(px)","0",mxConstants.STYLE_PERIMETER_SPACING,t,n)),(a||e.showDisabled)&&(e.addSeparator(t),this.promptChange(e,mxResources.get("sourceSpacing"),"(px)","0",mxConstants.STYLE_SOURCE_PERIMETER_SPACING,t,a),this.promptChange(e,mxResources.get("targetSpacing"),"(px)","0",mxConstants.STYLE_TARGET_PERIMETER_SPACING,t,a))}))),this.put("format",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItem(e,"style",t)}))),this.put("text",new Menu(mxUtils.bind(this,function(e,t){var n=this.get("text").enabled;e.addSeparator(t),this.addSubmenu("fontFamily",e,t),this.addSubmenu("fontSize",e,t),this.addMenuItems(e,["-","bold","italic","underline","-"],t),this.addSubmenu("alignment",e,t),this.addMenuItem(e,"wordWrap",t),e.addSeparator(t),this.promptChange(e,mxResources.get("textOpacity"),"(%)","100",mxConstants.STYLE_TEXT_OPACITY,t,n),e.addItem(mxResources.get("hide"),null,function(){i.toggleCellStyles(mxConstants.STYLE_NOLABEL,!1)},t,null,n)}))),this.put("alignment",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("leftAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("rightAlign"),[mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("topAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottomAlign"),[mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM],null,t),e.addSeparator(t),this.addSubmenu("position",e,t),this.addSubmenu("spacing",e,t),e.addSeparator(t);var n=this.get("text").enabled;e.addItem(mxResources.get("vertical"),null,function(){i.toggleCellStyles(mxConstants.STYLE_HORIZONTAL,!0)},t,null,n)}))),this.put("position",new Menu(mxUtils.bind(this,function(e,t){this.styleChange(e,mxResources.get("left"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_RIGHT],null,t),this.styleChange(e,mxResources.get("center"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_CENTER],null,t),this.styleChange(e,mxResources.get("right"),[mxConstants.STYLE_LABEL_POSITION,mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_LEFT],null,t),e.addSeparator(t),this.styleChange(e,mxResources.get("top"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP,mxConstants.ALIGN_BOTTOM],null,t),this.styleChange(e,mxResources.get("middle"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_MIDDLE],null,t),this.styleChange(e,mxResources.get("bottom"),[mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_TOP],null,t)}))),this.put("direction",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("flipH"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},t),e.addItem(mxResources.get("flipV"),null,function(){i.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},t),this.addMenuItems(e,["-","tilt","rotation"],t)}))),this.put("align",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("leftAlign"),null,function(){i.alignCells(mxConstants.ALIGN_LEFT)},t),e.addItem(mxResources.get("center"),null,function(){i.alignCells(mxConstants.ALIGN_CENTER)},t),e.addItem(mxResources.get("rightAlign"),null,function(){i.alignCells(mxConstants.ALIGN_RIGHT)},t),e.addSeparator(t),e.addItem(mxResources.get("topAlign"),null,function(){i.alignCells(mxConstants.ALIGN_TOP)},t),e.addItem(mxResources.get("middle"),null,function(){i.alignCells(mxConstants.ALIGN_MIDDLE)},t),e.addItem(mxResources.get("bottomAlign"),null,function(){i.alignCells(mxConstants.ALIGN_BOTTOM)},t)}))),this.put("layout",new Menu(mxUtils.bind(this,function(e,t){e.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(e,!0,!0)}),t),e.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(i,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(e,!0,!0)}),t)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["home","-","exitGroup","enterGroup","-","expand","collapse"],t)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["toFront","toBack","-"],t),this.addSubmenu("layout",e,t),e.addSeparator(t),this.addMenuItems(e,["-","group","ungroup","removeFromGroup"],t)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,n){this.addMenuItems(t,["actualSize"],n),t.addSeparator();for(var e=[.25,.5,.75,1,2,4],a=0;a<e.length;a++)!function(e){t.addItem(100*e+"%",null,function(){i.zoomTo(e)},n)}(e[a]);this.addMenuItems(t,["-","zoomIn","zoomOut","-","fitWindow","customZoom","-","fitPage","fitPageWidth"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["new","open","-","save","saveAs","publish","-","variable","-","import","export","-","editFile","description","-","print"],t)}))),this.put("edit",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","selectVertices","selectEdges","selectAll"])}))),this.put("help",new Menu(mxUtils.bind(this,function(e,t){this.addMenuItems(e,["help","-","about"])})))},Menus.prototype.put=function(e,t){this.menus[e]=t},Menus.prototype.get=function(e){return this.menus[e]},Menus.prototype.addSubmenu=function(e,t,n){var a=this.get(e).enabled;if(t.showDisabled||a){var i=t.addItem(mxResources.get(e),null,null,n,null,a);this.addMenu(e,t,i)}},Menus.prototype.addMenu=function(e,t,n){var a=this.get(e);null!=a&&(t.showDisabled||a.enabled)&&this.get(e).execute(t,n)},Menus.prototype.styleChange=function(e,t,n,a,i,s){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{for(var t=0;t<n.length;t++)e.setCellStyles(n[t],a[t])}finally{e.getModel().endUpdate()}}),s,i)},Menus.prototype.promptChange=function(e,t,a,i,s,n,o){return e.addItem(t,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=i,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[s]||t),null!=(t=mxUtils.prompt(mxResources.get("enterValue")+(0<a.length?" "+a:""),t))&&0<t.length&&e.setCellStyles(s,t)}),n,null,o)},Menus.prototype.addMenuItem=function(e,t,n){var a=this.editorUi.actions.get(t);if(null==a||!e.showDisabled&&!a.enabled)return null;var i=e.addItem(a.label,null,a.funct,n,null,a.enabled);return a.toggleAction&&a.isSelected()&&this.addCheckmark(i),this.addShortcut(i,a),i},Menus.prototype.addShortcut=function(e,t){if(null!=t.shortcut){var n=e.firstChild.nextSibling.nextSibling,a=document.createElement("span");a.style.color="gray",mxUtils.write(a,t.shortcut),n.appendChild(a)}},Menus.prototype.addCheckmark=function(e){var t=e.firstChild.nextSibling;t.style.backgroundImage="url("+IMAGE_PATH+"/checkmark.gif)",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="2px 50%"},Menus.prototype.addMenuItems=function(e,t,n){for(var a=0;a<t.length;a++)"-"==t[a]?e.addSeparator(n):this.addMenuItem(e,t[a],n)},Menus.prototype.createPopupMenu=function(e,t,n){var a=this.editorUi.editor.graph;if(e.smartSeparators=!0,a.isSelectionEmpty()?this.addMenuItems(e,["undo","redo","-","paste","-"]):(this.addMenuItems(e,["delete","-","cut","copy","-","duplicate"]),1==a.getSelectionCount()&&a.getModel().isEdge(a.getSelectionCell())&&this.addMenuItems(e,["setAsDefaultEdge"]),e.addSeparator()),0<a.getSelectionCount()){if(this.addMenuItems(e,["toFront","toBack","-"]),a.getModel().isEdge(a.getSelectionCell())){var i=!1;if(null!=(t=a.getSelectionCell())&&a.getModel().isEdge(t)){var s=a.selectionCellsHandler.getHandler(t);if(s instanceof mxEdgeHandler&&null!=s.bends&&2<s.bends.length){var o=s.getHandleForEvent(new mxMouseEvent(n)),r=this.editorUi.actions.get("removeWaypoint");r.handler=s,i=0<(r.index=o)&&o<s.bends.length}}this.addMenuItems(e,["-",i?"removeWaypoint":"addWaypoint"])}else 1<a.getSelectionCount()&&(e.addSeparator(),this.addMenuItems(e,["group"]));if(e.addSeparator(),1==a.getSelectionCount())null!=a.getLinkForCell(a.getSelectionCell())&&this.addMenuItems(e,["openLink"])}else this.addMenuItems(e,["-","selectVertices","selectEdges","-","selectAll"])},Menus.prototype.createMenubar=function(e){var t=new Menubar(this.editorUi,e),n=[];n=CRUD_PERMISSIONS.canEdit?["file","edit","view","format","text","arrange","help"]:["file","view","help"];for(var a=0;a<n.length;a++)t.addMenu(mxResources.get(n[a]),this.get(n[a]).funct);return t},Menubar.prototype.hideMenu=function(){null!=this.currentMenu&&this.currentMenu.hideMenu()},Menubar.prototype.addMenu=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geItem",mxUtils.write(n,e),this.addMenuHandler(n,t),this.container.appendChild(n),n},Menubar.prototype.getOffset=function(e){return{left:(e=e.getBoundingClientRect()).left+window.scrollX,top:e.top+window.scrollY}},Menubar.prototype.addMenuHandler=function(i,s){if(null!=s){var o=!0,t=mxUtils.bind(this,function(e){if(o&&null==i.enabled||i.enabled){this.editorUi.editor.graph.panningHandler.hideMenu();var t=new mxPopupMenu(s);t.div.className+=" geMenubarMenu",t.smartSeparators=!0,t.showDisabled=!0,t.autoExpand=!0,t.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(t,arguments),t.destroy(),this.currentMenu=null,this.currentElt=null});var n=this.getOffset(i).left,a=this.getOffset(i).top+i.offsetHeight;t.popup(n,a,null,e),this.currentMenu=t,this.currentElt=i}o=!0,mxEvent.consume(e)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(e){null!=this.currentMenu&&this.currentElt!=i&&(this.hideMenu(),t(e))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){o=this.currentElt!=i})),mxEvent.addListener(i,"click",t)}},mxUtils.extend(Menu,mxEventSource),Menu.prototype.setEnabled=function(e){this.enabled!=e&&(this.enabled=e,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(e,t){this.funct(e,t)},Toolbar.prototype.init=function(){CRUD_PERMISSIONS.canEdit?this.addItems(["save","publish","-","print","undo","redo","-","copy","cut","paste","delete","-","duplicate","-","actualSize","zoomIn","zoomOut","-"]):this.addItems(["print","actualSize","zoomIn","zoomOut","-"])},Toolbar.prototype.hideMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.currentMenu.destroy(),this.currentMenu=null)},Toolbar.prototype.addMenu=function(e,t,n,a){var i=this.editorUi.menus.get(a),s=this.addMenuFunction(e,t,n,i.funct);return i.addListener("stateChanged",function(){s.setEnabled(i.enabled)}),s},Toolbar.prototype.addMenuFunction=function(e,t,n,a){var i=n?this.createLabel(e):this.createButton(e);return this.initElement(i,t),this.addMenuHandler(i,n,a),this.container.appendChild(i),i},Toolbar.prototype.addSeparator=function(){var e=document.createElement("div");return e.className="geSeparator",this.container.appendChild(e),e},Toolbar.prototype.addItems=function(e){for(var t=0;t<e.length;t++){var n=e[t];"-"==n?this.addSeparator():this.addItem("geSprite-"+n.toLowerCase(),n)}},Toolbar.prototype.addItem=function(e,t){var n=this.editorUi.actions.get(t),a=null;return null!=n&&((a=this.addButton(e,n.label,n.funct)).setEnabled(n.enabled),n.addListener("stateChanged",function(){a.setEnabled(n.enabled)})),a},Toolbar.prototype.addButton=function(e,t,n){var a=this.createButton(e);return this.initElement(a,t),this.addClickHandler(a,n),this.container.appendChild(a),a},Toolbar.prototype.addSelectionHandler=function(n){var a=this.editorUi.editor.graph,e=function(){for(var e=!a.isSelectionEmpty(),t=0;t<n.length;t++)n[t].setEnabled(e)};a.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.addEdgeSelectionHandler=function(a){var i=this.editorUi.editor.graph,e=function(){var e=!1;if(!i.isSelectionEmpty())for(var t=i.getSelectionCells(),n=0;n<t.length;n++)if(i.getModel().isEdge(t[n])){e=!0;break}for(n=0;n<a.length;n++)a[n].setEnabled(e)};i.getSelectionModel().addListener(mxEvent.CHANGE,e),e()},Toolbar.prototype.initElement=function(e,t){e.setAttribute("tabindex","0"),null!=t&&e.setAttribute("title",t),this.addEnabledState(e)},Toolbar.prototype.addEnabledState=function(t){var n=t.className;t.setEnabled=function(e){t.enabled=e,t.className=e?n:n+" geDisabled"},t.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(t,n){null!=n&&mxEvent.addListener(t,"click",function(e){t.enabled&&n(e),mxEvent.consume(e)})},Toolbar.prototype.createButton=function(e){var t=document.createElement("a");t.setAttribute("href","javascript:void(0);"),t.className="geButton";var n=document.createElement("div");return n.className="geSprite "+e,t.appendChild(n),t},Toolbar.prototype.createLabel=function(e,t){var n=document.createElement("a");return n.setAttribute("href","javascript:void(0);"),n.className="geLabel",mxUtils.write(n,e),n},Toolbar.prototype.addMenuHandler=function(t,n,a,i){if(null!=a){var s=this.editorUi.editor.graph,o=null;mxEvent.addListener(t,"click",mxUtils.bind(this,function(e){(null==t.enabled||t.enabled)&&(s.panningHandler.hideMenu(),(o=new mxPopupMenu(a)).div.className+=" geToolbarMenu",o.showDisabled=i,o.labels=n,o.autoExpand=!0,o.popup(t.offsetLeft,t.offsetTop+t.offsetHeight+34,null,e),this.currentMenu=o),mxEvent.consume(e)}))}},Dialog.prototype.close=function(){null!=this.onDialogClose&&(this.onDialogClose(),this.onDialogClose=null),this.container.parentNode.removeChild(this.container),this.bg.parentNode.removeChild(this.bg)},angular.module("motion").run(["$templateCache",function(e){"use strict";e.put("app/auth/services/hotdesk/dialog.html",'<md-dialog aria-label="Telephone">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="LOGIN.TELEPHONES">Telephones</span>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-select ng-model="vm.name" placeholder="Select a telephone">\n <md-option value="{{telephone.name}}" ng-repeat="telephone in vm.telephones.rows">{{telephone.fullname}}</md-option>\n </md-select>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.closeDialog(vm.name)" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.name">\n <span translate="LOGIN.SELECT">SELECT</span>\n </md-button>\n \x3c!-- <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="LOGIN.CANCEL">Cancel</span>\n </md-button> --\x3e\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-card/templates/template-1/template-1.html",'<div class="template-1">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-10/template-10.html",'<div class="template-10 p-16">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h2" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n </div>\n\n <div class="text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-2/template-2.html",'<div class="template-2">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="text p-16" ng-if="card.text">\n {{card.text}}\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-3/template-3.html",'<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between">\n <div layout="column" layout-align="space-between">\n <div class="info">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h3 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n </div>\n\n <div class="cta">\n <md-button class="m-0">{{card.cta}}</md-button>\n </div>\n </div>\n\n <div class="media pl-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-4/template-4.html",'<div class="template-4">\n <div class="info white-fg ph-16 pv-24">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-5/template-5.html",'<div class="template-5 p-16" layout="row" layout-align="space-between start">\n <div class="info">\n <div class="title secondary-text" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="event h2" ng-if="card.event">\n {{card.event}}\n </div>\n </div>\n\n <div class="media ml-16">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-6/template-6.html",'<div class="template-6">\n <div class="content pv-24 ph-16">\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="title h2" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="text pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-7/template-7.html",'<div class="template-7" layout="row" layout-align="space-between">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div class="p-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="text h4 pt-8" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n\n <div>\n <md-divider></md-divider>\n <div class="p-8" layout="row">\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n <md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon>\n </div>\n </div>\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-8/template-8.html",'<div class="template-8">\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="content pv-24 ph-16">\n <div class="title h1" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n <div class="buttons pt-16">\n <md-button class="m-0">{{card.button1}}</md-button>\n <md-button class="m-0 md-accent">{{card.button2}}</md-button>\n </div>\n\n <div class="text pt-16" ng-if="card.text">\n {{card.text}}\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-card/templates/template-9/template-9.html",'<div class="template-9">\n <div class="header p-16" layout="row" layout-align="start center">\n <div ng-if="card.avatar">\n <img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}">\n </div>\n\n <div class="info">\n <div class="title" ng-if="card.title">\n {{card.title}}\n </div>\n\n <div class="subtitle secondary-text" ng-if="card.subtitle">\n {{card.subtitle}}\n </div>\n\n </div>\n </div>\n\n <div class="text ph-16 pb-16" ng-if="card.text">\n {{card.text}}\n </div>\n\n <div class="media">\n <img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image">\n </div>\n\n <div class="buttons m-8">\n <md-button class="md-icon-button mr-16" aria-label="Favorite">\n <md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Share">\n <md-icon md-font-icon="icon-share" class="s24"></md-icon>\n </md-button>\n </div>\n\n</div>'),e.put("app/core/directives/ms-click-to-call/ms-click-to-call.html",'<section ng-if="type !== \'button\'">\n <span ng-if="!showMenu()">{{target}}</span>\n\n <md-menu ng-if="showMenu()">\n <a aria-label="Target" ng-click="$mdOpenMenu($event)">\n <span ng-if="prefix">{{prefix}}-</span>{{target}}\n </a>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>\n\n<section ng-if="type === \'button\'">\n <md-button ng-if="!showMenu()" ng-disabled="true" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu ng-if="showMenu()">\n <md-button class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW CALL" ng-click="$mdOpenMenu($event)" aria-label="NEW CALL">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="call(prefix ? prefix + target : target)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{prefix ? prefix + \'-\' + target : target}})\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="transfer(target)">\n'+" {{'DASHBOARDS.TRANSFER_NUMBER' | translate}} ({{prefix ? prefix + '-' + target : target}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n</section>"),e.put("app/core/directives/ms-dual-multiselect/ms-dual-multiselect.html",'<div ng-cloak layout-gt-sm="row" layout="column">\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="query" type="text" placeholder="{{options.labelSearch || \'Search...\'}}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="options.readOnly ? \'read-only-mode\' : \'\'" ng-disabled="options.readOnly" ng-repeat="item in options.items | filter: query | orderBy: options.orderBy" ng-click="canTransfer(item, options, false)">\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="options.line4">{{getLine(item, options.line4)}}\n </p>\n </div>\n <md-icon ng-show="!options.readOnly" md-font-icon="icon-arrow-right-bold" aria-label="swap"></md-icon>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <span class="h4" flex>{{options.labelAll || \'All Items\'}} ({{options.items.length}})</span>\n <md-icon ng-show="options.showSelectAndDeselectAll && !options.readOnly" md-font-icon="icon-chevron-double-right" aria-label="swap" ng-click="transfer(options.items, options.selectedItems, -1, false)"></md-icon>\n </div>\n </div>\n\n <div flex="10" layout="row" layout-align="center center">\n <md-icon md-font-icon="icon-swap-horizontal" aria-label="swap"></md-icon>\n </div>\n\n <div flex-gt-sm="50" flex="45">\n <md-input-container class="md-icon-float md-block margin-0">\n <md-icon md-font-icon="icon-magnify" aria-label="swap"></md-icon>\n <input ng-model="selectedQuery" type="text" placeholder="{{options.labelSearch || \'Search...\'}}">\n </md-input-container>\n <md-content class="border h-300">\n <md-list class="md-dense no-padding" layout-fill layout-align="center center">\n <md-list-item class="md-3-line" ng-class="options.readOnly || !item.isValid ? \'read-only-mode\' : \'\'" ng-disabled="options.readOnly" ng-repeat="item in options.selectedItems | filter: selectedQuery | orderBy: options.orderBy" ng-click="canTransfer(item, options, true)">\n <md-icon ng-class="options.readOnly || !item.isValid ? \'hidden\' : \'\'" md-font-icon="icon-arrow-left-bold" aria-label="swap"></md-icon>\n <div class="md-list-item-text" layout="column">\n <h3 ng-if="options.line1">{{getLine(item, options.line1)}}</h3>\n <h4 ng-if="options.line2">{{getLine(item, options.line2)}}</h4>\n <p ng-if="options.line3">{{getLine(item, options.line3)}}</p>\n <p class="ms-dual-multiselect-line-xs" ng-if="options.line4">{{getLine(item, options.line4)}}\n </p>\n </div>\n <md-divider></md-divider>\n </md-list-item>\n </md-list>\n </md-content>\n <div class="margin-10" layout="row">\n <md-icon ng-show="options.showSelectAndDeselectAll && !options.readOnly" md-font-icon="icon-chevron-double-left" aria-label="swap" flex ng-click="transfer(options.selectedItems, options.items, -1, true)"></md-icon>\n <span class="h4">{{options.labelSelected || \'Selected Items\'}} ({{options.selectedItems.length}})</span>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-font-family/ms-font-family.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-repeat="font in fonts" ng-value="font.value" <span ng-style="{\'font-family\': font.value}">{{font.option}}</span>\n </md-option>\n</md-select>'),e.put("app/core/directives/ms-info-bar/ms-info-bar.html",'<div id="ms-info-bar" layout="row" layout-align="start center" flex>\n <div id="ms-info-bar-message" ng-transclude flex></div>\n <md-button id="ms-info-bar-close" class="md-icon-button" aria-label="Close" ng-click="removeInfoBar()">\n <md-icon md-font-icon="icon-close s20"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-material-color-picker/ms-material-color-picker.html",'<md-menu md-position-mode="target-right target">\n\n <div ng-click="$mdOpenMenu($event)">\n <ms-color-picker-button>\n <md-button aria-label="Row Color" md-menu-origin ng-click="$mdOpenMenu($event)" ng-class="vm.selectedColor.class">\n\n <span ng-show="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n <span ng-show="!vm.selectedColor.palette">\n Select Color\n </span>\n </md-button>\n </ms-color-picker-button>\n </div>\n\n <md-menu-content class="ms-material-color-picker-menu-content" layout-column>\n\n <header ng-class="vm.selectedColor.class || \'md-accent-bg\'" class="md-whiteframe-4dp" layout="row" layout-align="space-between center">\n <md-button md-prevent-menu-close ng-click="vm.activateHueSelection(false,false)" class="md-icon-button" ng-class="{\'hidden\':!vm.selectedPalette}" aria-label="Palette">\n <md-icon md-font-icon="icon-arrow-left" class="s20"></md-icon>\n </md-button>\n\n <span ng-if="vm.selectedColor.palette">\n {{vm.selectedColor.palette}} {{vm.selectedColor.hue}}\n </span>\n\n <span ng-if="!vm.selectedColor.palette">\n Select Color\n </span>\n\n <md-button class="remove-color-button md-icon-button" ng-click="vm.removeColor()" aria-label="Remove Color">\n <md-icon md-font-icon="icon-delete" class="s20"></md-icon>\n </md-button>\n </header>\n\n <div class="colors" ms-scroll>\n <div ng-show="!vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+palette+\'-500-bg\'" ng-repeat="(palette, hues) in vm.palettes" ng-click="vm.activateHueSelection(palette,hues)" layout="row" layout-align="start end" md-prevent-menu-close md-ink-ripple>\n <span class="label">\n {{palette}}\n </span>\n </div>\n </div>\n\n <div ng-show="vm.selectedPalette" layout="row" layout-wrap>\n <div class="color" ng-class="\'md-\'+vm.selectedPalette+\'-\'+hue+\'-bg\'" ng-repeat="(hue, values) in vm.selectedHues" ng-click="vm.selectColor(vm.selectedPalette,hue)" layout="row" layout-align="start end" md-ink-ripple>\n <span class="label">\n {{hue}}\n </span>\n <i ng-if="vm.selectedPalette == vm.selectedColor.palette && hue == vm.selectedColor.hue" class="s16 icon-check">\n </i>\n </div>\n </div>\n\n </div>\n\n </md-menu-content>\n</md-menu>'),e.put("app/core/directives/ms-navigation/templates/horizontal.html",'<div class="navigation-toggle" hide-gt-sm>\n <md-button class="md-icon-button" ng-click="vm.toggleHorizontalMobileMenu()" aria-label="Toggle Mobile Navigation">\n <md-icon md-font-icon="icon-menu"></md-icon>\n </md-button>\n</div>\n\n<ul class="horizontal">\n <li ng-repeat="node in vm.navigation" ms-navigation-horizontal-node="node" ng-class="{\'has-children\': vm.hasChildren}" ng-include="\'navigation-horizontal-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested horizontal navigation template --\x3e\n<script type="text/ng-template" id="navigation-horizontal-nested.html">\n\n <div ms-navigation-horizontal-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-horizontal-button" ng-if="!node.uisref && node.title"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-horizontal-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg"\n ng-class="{\'active md-accent-bg md-accent-fg\': vm.isActive}"\n ng-if="node.uisref && node.title">\n <i class="icon s18 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg" style="background: {{node.badge.color}}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s18 arrow" ng-if="vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-horizontal-node="node"\n ng-class="{\'has-children\': vm.hasChildren}"\n ng-include="\'navigation-horizontal-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("app/core/directives/ms-navigation/templates/vertical.html",'<ul>\n <li ng-repeat="node in vm.navigation" ms-navigation-node="node" ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}" ng-include="\'navigation-nested.html\'"></li>\n</ul>\n\n\x3c!-- Nested navigation template --\x3e\n<script type="text/ng-template" id="navigation-nested.html">\n\n <div ms-navigation-item layout="row" ng-if="!vm.isHidden()">\n\n <div class="ms-navigation-button" ng-if="!node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </div>\n\n <a class="ms-navigation-button" ui-sref="{{node.uisref}}" ui-sref-active="active md-accent-bg" ng-if="node.uisref && node.title">\n <i class="icon s16 {{node.icon}}" ng-if="node.icon"></i>\n <span class="title" translate="{{node.translate}}" flex>{{node.title}}</span>\n <span class="badge white-fg margin-right-20" ng-style="{\'background\': node.badge.color}" ng-if="node.badge">{{node.badge.content}}</span>\n <i class="icon-chevron-right s16 arrow" ng-if="vm.collapsable && vm.hasChildren"></i>\n </a>\n\n </div>\n\n <ul ng-if="vm.hasChildren && !vm.isHidden()">\n <li ng-repeat="node in node.children" ms-navigation-node="node"\n ng-class="{\'collapsed\': vm.collapsed, \'has-children\': vm.hasChildren}"\n ng-include="\'navigation-nested.html\'"></li>\n </ul>\n\n<\/script>\n\x3c!-- / Nested navigation template --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-dialpad.html",'\x3c!-- Dialpad --\x3e\n<md-content ng-if="vm_pb.showDialpad" class="num-pad" layout="column">\n <section layout="row" layout-align="start center">\n <span><img class="num-pad-logo" layout-padding src="/api/settings/1/logo" alt="logo" /></span>\n <span class="md-subhead">Dialpad</span>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm_pb.closeDialpad()">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </section>\n <md-divider></md-divider>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 1, l: []}, {n: 2, l: [\'a\', \'b\', \'c\']}, {n: 3, l: [\'d\', \'e\', \'f\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 4, l: [\'g\', \'h\', \'i\']}, {n: 5, l: [\'j\', \'k\', \'l\']}, {n: 6, l: [\'m\', \'n\', \'o\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: 7, l: [\'p\', \'q\', \'r\', \'s\']}, {n: 8, l: [\'t\', \'u\', \'v\']}, {n: 9, l: [\'w\', \'x\', \'y\', \'z\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n </section>\n <section layout="row">\n <div class="span4" ng-repeat="item in ::[{n: \'*\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: 0, l: [\'+\']}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num">\n <div class="txt">\n {{item.n}} <span class="small">\n <p>\n <span ng-repeat="l in ::item.l">{{l | uppercase}}</span>\n </p>\n </span>\n </div>\n </div>\n </div>\n <div class="span4" ng-repeat="item in ::[{n: \'#\', l: []}]" ng-click="vm_pb.type(item.n, true)">\n <div class="num" layout="column" layout-align="center center">\n <div class="txt" layout="column" layout-align="center center">\n {{item.n}}\n </div>\n </div>\n </div>\n </section>\n</md-content>\n\x3c!-- Dialpad --\x3e\n\x3c!-- Input Area --\x3e\n<div layout="row" layout-align="start center">\n <div layout="row" layout-align="center center">\n \x3c!-- START Ringing Tone--\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Ringing" ng-click="vm_pb.conf.ringingMute = !vm_pb.conf.ringingMute; vm_pb.initDevice(\'ringing\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.ringingMute ? \'icon-bell-off\' : \'icon-bell-ring\'}}" class="icon s14" ng-class="vm_pb.conf.ringingMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.RINGING">Ringing</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Ringing Tone --\x3e\n\n \x3c!-- START Speaker --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Speaker" ng-click="vm_pb.conf.speakerMute = !vm_pb.conf.speakerMute; vm_pb.initDevice(\'speaker\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.speakerMute ? \'icon-volume-off\' : \'icon-volume\'}}" class="icon s14" ng-class="vm_pb.conf.speakerMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.SPEAKER">Speaker</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Speaker --\x3e\n\n \x3c!-- START Microphone --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Microphone" ng-click="vm_pb.conf.microphoneMute = !vm_pb.conf.microphoneMute; vm_pb.initDevice(\'microphone\')" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="{{vm_pb.conf.microphoneMute ? \'icon-microphone-off\' : \'icon-microphone\'}}" class="icon s14" ng-class="vm_pb.conf.microphoneMute ? \'red-fg\' : \'grey-fg\'">\n <md-tooltip><span translate="TOOLBAR.MICROPHONE">Microphone</span></md-tooltip>\n </md-icon>\n </md-button>\n \x3c!-- END Microphone --\x3e\n\n \x3c!-- START Registered --\x3e\n <span>\n <span class="quantity-indicator md-red-500-bg" ng-class="vm_pb.registered ? \'md-green-500-bg\' : \'md-red-500-bg\'"></span>\n <md-tooltip><span>{{vm_pb.conf.license ? (vm_pb.registered ? \'TOOLBAR.REGISTERED\' : \'TOOLBAR.NOT_REGISTERED\') : \'TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD\' | translate}}\n <timer ng-if="vm_pb.registered" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n </md-tooltip>\n </span>\n \x3c!-- END Registered --\x3e\n </div>\n <div layout="column" layout-align="center start">\n <div layout="row" layout-align="start center">\n \x3c!-- START Target --\x3e\n <angucomplete-alt id="ms-target-wrap" pause="10" local-data="vm_pb.calls" search-fields="target" title-field="target" minlength="0" input-class="input-number" disable-input="!vm_pb.registered" match-class="highlight" template-url="assets/ms-phonebar/ms-phonebar-input.html" input-changed="vm_pb.targetChanged" selected-object="vm_pb.targetSelected" clear-selected="true" ng-keypress="vm_pb.typeWrapper($event)" focus-first="true" />\n \x3c!-- END Target --\x3e\n\n \x3c!-- Auto Answer --\x3e\n <div ng-if="vm_pb.conf.autoAnswer" class="red-fg" style="padding-left: 10px;">\n <span class="font-size-20">A<span class="font-size-16">A</span></span>\n </div>\n \x3c!-- Auto Answer --\x3e\n\n <md-button class="md-fab md-mini white-bg width-30 height-30" aria-label="Dialpad" ng-click="vm_pb.toggleDialpad()" ng-disabled="!vm_pb.registered">\n <md-icon md-font-icon="icon-apps" class="icon grey-fg s16"></md-icon>\n </md-button>\n <md-button ng-if="vm_pb.target" class="md-fab md-mini white-bg width-25 height-25" aria-label="Call" style="margin-left: 0px;" ng-click="vm_pb.call()">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n\x3c!-- START 3WC --\x3e\n<md-button ng-if="vm_pb.canGoInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="3Way" ng-click="vm_pb.start3WayConf(); $event.stopPropagation();">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon orange-fg s14"></md-icon>\n <md-tooltip><span translate="TOOLBAR.CONFERENCE">Conference</span></md-tooltip>\n</md-button>\n\x3c!-- END 3Way --\x3e\n\x3c!-- Input Area --\x3e\n\n<div class="toolbar-separator"></div>\n\n\x3c!-- Sessions Area --\x3e\n<div class="sessions" layout="row" layout-align="start center" flex>\n <div layout="row" layout-align="center center" ng-if="!vm_pb.conf.license">\n <md-icon md-font-icon="icon-account-alert" class="icon s36 red-fg"></md-icon>\n <span layout-margin translate="TOOLBAR.WEBRTC_LICENSE_NOT_ENABELD"></span>\n </div>\n\n <div ng-repeat="session in vm_pb.sessions" class="session" layout="row" ng-click="(vm_pb.sessions.length > 1) && vm_pb.selectSession(session)">\n <md-button ng-if="vm_pb.conf.recording && session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Record" ng-click="vm_pb.record(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s14" ng-class="session.monitor ? \'red-fg\' : \'grey-fg\'"></md-icon>\n </md-button>\n <div layout="column" layout-align="center start">\n <span class="session-info">{{ (session.user == session.name) ? session.user : (session.name + \' \' + session.user) }}</span>\n <span class="session-info" layout="row" layout="start center">\n <timer interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n\n \x3c!-- START Answer --\x3e\n <md-button ng-if="session.incoming && !session.confirmed" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="vm_pb.answer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone" class="icon green-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Answer --\x3e\n\n \x3c!-- START Hangup --\x3e\n <md-button class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Terminate" ng-click="vm_pb.terminate(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-hangup" class="icon red-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hangup --\x3e\n\n \x3c!-- START Hold/Unhold --\x3e\n <md-button ng-if="session.confirmed && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Hold" ng-click="(session.localHold ? vm_pb.unhold(session) : vm_pb.hold(session)); $event.stopPropagation();">\n <md-icon md-font-icon="{{session.localHold ? \'icon-play\' : \'icon-pause\'}}" class="icon grey-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Hold/Unhold --\x3e\n\n \x3c!-- START Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length == 1 && !vm_pb.isInConference" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer" ng-click="vm_pb.refer(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END transfer --\x3e\n\n \x3c!-- START Attended Transfer --\x3e\n <md-button ng-if="session.confirmed && !session.localHold && vm_pb.sessions.length>1" class="md-fab md-mini white-bg width-25 height-25 margin-5" aria-label="Refer Attended" ng-click="vm_pb.referAttended(session); $event.stopPropagation();">\n <md-icon md-font-icon="icon-phone-forward" class="icon purple-fg s12"></md-icon>\n </md-button>\n \x3c!-- END Attended Transfer --\x3e\n </div>\n</div>\n\x3c!-- Sessions Area --\x3e'),e.put("assets/ms-phonebar/ms-phonebar-input.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">\n <input id="ms-target" ng-model="searchStr" ng-disabled="disableInput" type="text" placeholder="{{placeholder}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)" />\n <div class="angucomplete-dropdown" ng-show="showDropdown && !(!searching && (!results || results.length == 0))">\n <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="{{result.originalObject.inbound ? \'icon-arrow-bottom-left\' : \'icon-arrow-top-right\'}}" class="icon no-margin s22"></md-icon>\n <span style="margin-left: 8px;">({{result.originalObject.time}}) - <span class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></span></span>\n </div>\n </div>\n </div>\n</div>'),e.put("assets/ms-phonebar/ms-phonebar.html",'<div layout="row" layout-align="start center" flex>\n \x3c!-- Audio stream --\x3e\n <audio id="remote-audio" autoplay hidden=true></audio>\n \x3c!-- Audio stream --\x3e\n\n \x3c!-- WebRtc PhoneBar --\x3e\n <div class="phonebar-container" ng-include="\'assets/ms-phonebar/ms-phonebar-dialpad.html\'" layout="row" layout-align="start center" flex></div>\n \x3c!-- WebRtc PhoneBar --\x3e\n</div>'),e.put("assets/ms-phonebar/prefix/dialog.html",'<md-dialog aria-label="Prefix">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.PREFIXES">Prefixes</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog(-1)">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-radio-group ng-model="vm.prefix">\n <md-radio-button ng-repeat="prefix in vm.prefixes.rows" value="{{prefix.prefix}}" class="md-primary">{{prefix.name}}</md-radio-button>\n <md-radio-button ng-if="!vm.required" ng-value="null" class="md-primary">no prefix</md-radio-button>\n </md-radio-group>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.call()" class="send-button md-accent md-raised" aria-label="call" ng-disabled="!vm.prefix && vm.required">\n <span translate="TOOLBAR.CALL">CALL</span>\n </md-button>\n <md-button ng-click="vm.closeDialog(-1)" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/record/dialog.html",'<md-dialog aria-label="Recording" ng-init="vm.onInit()">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.RECORDING">Recording</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding">\n <md-icon class="no-margin" md-font-icon="icon-plus" aria-label="Add" ng-click="vm.addRecording()"></md-icon>\n </md-button>\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-table-container>\n <table md-table layout-padding>\n <thead md-head>\n <tr md-row>\n <th md-column><span translate="TOOLBAR.FILENAME">File name</span></th>\n <th md-column><span translate="TOOLBAR.STATUS">Status</span></th>\n <th md-column><span translate="TOOLBAR.ACTIONS">Actions</span></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.session.monitors.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="TOOLBAR.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="monitor in vm.session.monitors">\n <td md-cell>{{monitor.filename}}</td>\n <td md-cell class="no-padding">\n <md-icon md-font-icon="icon-radiobox-marked" class="icon s16" ng-class="(monitor.status == \'rec\') ? \'red-fg ms-blink\' : \'grey-fg\'"></md-icon>\n </td>\n <td md-cell class="no-padding">\n <md-button class="md-fab md-mini white-bg width-35 height-35 margin-5" aria-label="Record" ng-click="(monitor.status == \'rec\') ? vm.stop(monitor) : vm.start(monitor)">\n'+" <md-icon md-font-icon=\"{{monitor.status == 'rec' ? 'icon-stop' : 'icon-play'}}\" class=\"icon s16\" ng-class=\"monitor.status == 'rec' ? 'grey-fg' : 'red-fg'\"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n </form>\n</md-dialog>"),e.put("assets/ms-phonebar/referAttended/dialog.html",'<md-dialog aria-label="Transfer">\n <form ng-cloak>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div flex>\n <span class="title" translate="TOOLBAR.ATTENDED_TRANSFER">Transfer</span>\n </div>\n <div layout="row" layout-align="end center">\n <md-button class="md-icon-button no-margin no-padding" ng-click="vm.closeDialog()">\n <md-icon class="no-margin" md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <label translate="TOOLBAR.TARGET">Target</label>\n <md-input-container class="md-block">\n <md-select ng-model="vm.target">\n <md-option ng-repeat="session in vm.sessions" ng-value="session.user">\n {{ session.name }}\n </md-option>\n </md-select>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row">\n <md-button ng-click="vm.transfer()" class="send-button md-accent md-raised" aria-label="transfer" ng-disabled="!vm.target && !vm.sessionId">\n <span translate="TOOLBAR.TRANSFER">TRANSFER</span>\n </md-button>\n <md-button ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="cancel">\n <span translate="TOOLBAR.CANCEL">Cancel</span>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("assets/ms-phonebar/settings/settings.html",'<md-dialog class="md-phonebar-dialog" aria-label="{{vm.name}}">\n <form name="settingsForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="TOOLBAR.SETTINGS">Settings</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content class="no-padding" ms-scroll>\n <md-tabs md-no-pagination md-stretch-tabs="always">\n <md-tab label="{{ \'TOOLBAR.PROFILE\' | translate}}">\n <md-content layout-padding layout="column">\n <span><span translate="TOOLBAR.FULLNAME">Fullname</span>: {{vm.conf.fullname}}</span>\n <span><span translate="TOOLBAR.NAME">Name</span>: {{vm.conf.name}}</span>\n <span><span translate="TOOLBAR.INTERNAL">Internal</span>: {{vm.conf.internal}}</span>\n <span><span translate="TOOLBAR.BROWSER">Browser</span>: {{vm.conf.browserName}} {{vm.conf.browserVersion}}</span>\n <span><span translate="TOOLBAR.OS">OS</span>: {{vm.conf.osName}} {{vm.conf.osVersion}}</span>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.SERVICES\' | translate}}">\n <md-content layout-padding>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.conf.autoAnswer" aria-label="Auto Answer">\n <span translate="TOOLBAR.AUTOANSWER">Auto Answer</span>\n <span>{{ vm.conf.autoAnswerDelay }} [s]</span>\n </md-switch>\n </md-input-container>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.AUDIO\' | translate}}">\n <md-content layout-padding>\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.RINGINGDEVICE">Ringing Device</label>\n <md-select name="ringingDevice" ng-model="vm.conf.ringingId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'ringingDevice\'].$error" ng-show="settingsForm[\'ringingDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.ringingMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.ringingVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audiooutput\' }).length">\n <label translate="TOOLBAR.SPEAKERDEVICE">Speaker Device</label>\n <md-select name="speakerDevice" ng-model="vm.conf.speakerId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audiooutput\' }">{{ device.label || (\'Speaker \' + ($index + 1)) }}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'speakerDevice\'].$error" ng-show="settingsForm[\'speakerDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between cetner">\n <md-switch ng-model="vm.conf.speakerMute" aria-label="Mute">\n Mute\n </md-switch>\n\n <md-slider-container flex="80">\n <md-slider flex step="0.1" min="0" max="1" ng-model="vm.conf.speakerVolume" aria-label="volume"></md-slider>\n </md-slider-container>\n </div>\n </div>\n\n <div class="border brad-5" layout-margin>\n <md-input-container class="md-block" ng-if="(vm.devices | filter: { kind: \'audioinput\' }).length">\n <label translate="TOOLBAR.MICROPHONEDEVICE">Microphone Device</label>\n <md-select name="microphoneDevice" ng-model="vm.conf.microphoneId" required>\n <md-option ng-value="device.deviceId" ng-repeat="device in vm.devices | filter: { kind: \'audioinput\' }">{{ device.label || (\'Microphone \' + ($index + 1))}}</md-option>\n </md-select>\n <div ng-messages="settingsForm[\'microphoneDevice\'].$error" ng-show="settingsForm[\'microphoneDevice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.FIELD_REQUIRED">Field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.conf.microphoneMute" aria-label="Mute">\n Mute\n </md-switch>\n </div>\n </div>\n </md-content>\n </md-tab>\n <md-tab label="{{ \'TOOLBAR.REQUIREMENTS\' | translate}}">\n <md-content layout-padding>\n <md-list>\n <md-list-item>\n <h3 translate="TOOLBAR.LICENSE">License</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.license ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.license ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.BROWSER_COMPATIBILITY">Browser Compatibility</h3>\n <md-icon class="md-secondary" ng-class="vm.isCompatibleBrowser() ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.isCompatibleBrowser() ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.HTTPS">HTTPS</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.protocol === \'https\' ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.protocol === \'https\' ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.WEBRTCSUPPORT">WebRTC Support</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.isWebRTCSupported ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.isWebRTCSupported ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.MICROPHONE">Microphone</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasMicrophone ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasMicrophone ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n <md-list-item>\n <h3 translate="TOOLBAR.SPEAKER">Speaker</h3>\n <md-icon class="md-secondary" ng-class="vm.conf.hasSpeakers ? \'green-fg\' : \'red-fg\'" md-font-icon="{{vm.conf.hasSpeakers ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </md-list-item>\n </md-list>\n </md-content>\n </md-tab>\n </md-tabs>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveSettings()" class="send-button md-accent md-raised" ng-disabled="settingsForm.$invalid || settingsForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/core/directives/ms-search-bar/ms-search-bar.html",'<div flex layout="row" layout-align="start center">\n <label for="ms-search-bar-input">\n <md-button class="ms-search-bar-expander md-icon-button" aria-label="Expand Search Bar" ng-click="MsSearchBar.expand()" ng-if="!MsSearchBar.resultsLoading || MsSearchBar.collapsed">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </md-button>\n <div class="ms-search-bar-loader" layout="row" layout-align="center center" ng-if="MsSearchBar.resultsLoading && !MsSearchBar.collapsed">\n <md-progress-circular class="md-accent" md-diameter="32" md-mode="indeterminate"></md-progress-circular>\n </div>\n </label>\n <input id="ms-search-bar-input" type="text" placeholder="Search" flex ng-model="MsSearchBar.query" ng-model-options="MsSearchBar.queryOptions" ng-blur="MsSearchBar.blurCollapse()" ng-keydown="MsSearchBar.handleKeydown($event)">\n <md-button class="ms-search-bar-collapser md-icon-button" ng-click="MsSearchBar.collapse()" aria-label="Collapse Search Bar">\n <md-icon md-font-icon="icon-close" class="icon s24"></md-icon>\n </md-button>\n\n <div class="ms-search-bar-results" ng-if="MsSearchBar.results" ms-scroll>\n <div class="no-results" ng-if="MsSearchBar.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsSearchBar.results" ng-click="MsSearchBar.handleResultClick(result)" ng-mouseenter="MsSearchBar.handleMouseenter($index)" ng-mousedown="MsSearchBar.absorbEvent($event)" ng-class="{\'selected\': $index == MsSearchBar.selectedResultIndex}" md-ink-ripple>\n <div layout="row" layout-align="start center">\n <div class="icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="icon {{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n <div class="description" ng-if="result.description">{{result.description}}</div>\n </div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/core/directives/ms-shortcuts/ms-shortcuts.html",'<div class="shortcuts-container" layout="row" layout-align="space-between center" flex ng-class="{\'mobile-bar-active\': MsShortcuts.mobileBarActive}">\n\n <div class="flex-noshrink" layout="row" layout-align="start center" flex>\n <div class="shortcuts hide show-gt-xs" layout="row" layout-align="start center" ms-scroll ng-if="MsShortcuts.shortcuts.length > 0" ng-sortable="MsShortcuts.sortableOptions">\n <div ng-repeat="shortcut in MsShortcuts.shortcuts" layout="row" layout-align="center center">\n <md-button class="md-icon-button shortcut" aria-label="{{shortcut.title}}" ui-sref="{{shortcut.uisref}}">\n <md-icon ng-if="shortcut.icon" md-font-icon="{{shortcut.icon}}" class="icon s24"></md-icon>\n <div ng-if="!shortcut.icon" class="first-letter">{{shortcut.title.charAt(0)}}</div>\n <md-tooltip md-direction="bottom">{{shortcut.title}}</md-tooltip>\n </md-button>\n </div>\n </div>\n\n \x3c!-- <md-menu md-offset="8 56" class="shortcut-menu hide show-gt-xs">\n <md-button class="md-icon-button add-shortcut-button" aria-label="Add shortcut"\n ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24"></md-icon>\n <md-tooltip md-direction="bottom">Click to add/remove shortcut</md-tooltip>\n </md-button>\n\n <md-menu-content>\n <div id="ms-shortcut-add-menu">\n <div class="shortcut-search" layout="row" layout-align="start center">\n <div class="search-icon" layout="row" layout-align="center center"\n ng-if="!MsShortcuts.resultsLoading">\n <md-icon md-menu-align-target md-font-icon="icon-magnify" class="icon s24"></md-icon>\n </div>\n <div class="shortcut-loader" layout="row" layout-align="center center"\n ng-if="MsShortcuts.resultsLoading">\n <md-progress-circular class="md-accent" md-diameter="20" md-mode="indeterminate">\n </md-progress-circular>\n </div>\n\n <input type="text" placeholder="Search" flex\n ng-model="MsShortcuts.query"\n ng-model-options="MsShortcuts.queryOptions"\n ng-keydown="MsShortcuts.handleKeydown($event)">\n </div>\n\n <div class="results" ng-if="MsShortcuts.results" ms-scroll>\n <div class="no-results" ng-if="MsShortcuts.results.length === 0">No Results!</div>\n\n <div class="result" ng-repeat="result in MsShortcuts.results"\n ng-click="MsShortcuts.handleResultClick(result)"\n ng-mouseenter="MsShortcuts.handleMouseenter($index)"\n ng-mousedown="MsShortcuts.absorbEvent($event)"\n ng-class="{\'selected\': $index == MsShortcuts.selectedResultIndex}"\n md-prevent-menu-close="md-prevent-menu-close"\n md-ink-ripple>\n <div layout="row" layout-align="start space-between">\n <div layout="row" layout-align="start center" flex>\n <div class="icon icon-container" layout="row" layout-align="center center">\n <i ng-if="result.icon" class="{{result.icon}}"></i>\n <div ng-if="!result.icon" class="square md-accent-bg"></div>\n </div>\n <div>\n <div class="title">{{result.title}}</div>\n </div>\n </div>\n <md-icon md-font-icon="icon-pin" class="icon s18"\n ng-class="{\'fade-text\': !result.hasShortcut}"></md-icon>\n </div>\n </div>\n </div>\n </div>\n </md-menu-content>\n </md-menu> --\x3e\n </div>\n\n <md-button class="md-icon-button toggle-mobile-menu hide-gt-xs" aria-label="Add shortcut" ng-click="MsShortcuts.toggleMobileBar()">\n <md-icon md-menu-origin md-font-icon="icon-star" class="icon amber-600-fg s24" ng-hide="MsShortcuts.mobileBarActive"></md-icon>\n <md-icon md-menu-origin md-font-icon="icon-close" class="icon s24" ng-hide="!MsShortcuts.mobileBarActive"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/horizontal/horizontal.html",'<div class="ms-stepper-horizontal">\n <div class="ms-stepper-navigation-wrapper">\n <div class="ms-stepper-navigation" layout="row" layout-align="center center">\n <md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(step.stepNumber), \'valid\': MsStepper.isStepValid(step.stepNumber), \'disabled\': MsStepper.isStepDisabled(step.stepNumber), \'optional\': MsStepper.isStepOptional(step.stepNumber)}" ng-click="MsStepper.gotoStep(step.stepNumber)" ng-disabled="MsStepper.isStepDisabled(step.stepNumber)" ng-repeat="step in MsStepper.steps | filter:MsStepper.filterHiddenStep" layout="row" layout-align="start center">\n\n <div class="step md-accent-bg" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(step.stepNumber) || MsStepper.isStepOptional(step.stepNumber)">\n {{$index + 1}}\n </span>\n <span ng-if="MsStepper.isStepValid(step.stepNumber) && !MsStepper.isStepOptional(step.stepNumber)">\n <i class="icon icon-check s18"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" translate="{{step.stepTitleTranslate}}">{{step.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(step.stepNumber)">Optional</div>\n </div>\n </md-button>\n </div>\n </div>\n\n <div class="ms-stepper-steps" ng-transclude></div>\n\n <div class="ms-stepper-controls" layout="row" layout-align="center center">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <div class="ms-stepper-dots">\n <span ng-repeat="step in MsStepper.steps" ng-hide="MsStepper.isStepHidden(step.stepNumber)" ng-class="{\'selected md-accent-bg\':MsStepper.currentStepNumber === $index + 1}">\n </span>\n </div>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n </div>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/step/vertical-step.html",'<md-button class="ms-stepper-navigation-item" ng-class="{\'current\': MsStepper.isStepCurrent(stepInfo.stepNumber), \'valid\': MsStepper.isStepValid(stepInfo.stepNumber), \'disabled\': MsStepper.isStepDisabled(stepInfo.stepNumber), \'optional\': MsStepper.isStepOptional(stepInfo.stepNumber)}" ng-click="MsStepper.gotoStep(stepInfo.stepNumber)" ng-disabled="MsStepper.isStepDisabled(stepInfo.stepNumber)" ng-hide="MsStepper.isStepHidden(stepInfo.stepNumber)" aria-label="Stepper navigation button" layout="row" layout-align="start center">\n\n <div class="step" layout="row" layout-align="center center">\n <span ng-if="!MsStepper.isStepValid(stepInfo.stepNumber) || MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-checkbox-blank-circle-outline s18 md-accent-fg"></i>\n </span>\n <span ng-if="MsStepper.isStepValid(stepInfo.stepNumber) && !MsStepper.isStepOptional(stepInfo.stepNumber)">\n <i class="icon icon-check-circle s18 md-accent-fg"></i>\n </span>\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="title" ng-if="stepInfo.stepTitleTranslate">{{stepInfo.stepTitleTranslate | translate }}</div>\n <div class="title" ng-if="!stepInfo.stepTitleTranslate">{{stepInfo.stepTitle}}</div>\n <div class="subtitle" ng-if="MsStepper.isStepOptional(stepInfo.stepNumber)">Optional</div>\n </div>\n</md-button>\n\n<div class="ms-stepper-step-content" ng-transclude></div>\n\n<div class="ms-stepper-controls" layout="row" layout-align="start center" ng-show="MsStepper.isStepCurrent(stepInfo.stepNumber)">\n <md-button class="md-accent md-raised" ng-disabled="MsStepper.isFirstStep()" ng-click="MsStepper.gotoPreviousStep()">\n Back\n </md-button>\n\n <md-button class="md-accent md-raised" ng-if="!MsStepper.isLastStep()" ng-disabled="!MsStepper.isStepValid(MsStepper.currentStepNumber)" ng-click="MsStepper.gotoNextStep()">\n Next\n </md-button>\n\n <md-button type="submit" class="md-accent md-raised" ng-click="MsStepper.resetForm()" ng-if="MsStepper.isLastStep()" ng-disabled="!MsStepper.isFormValid()">\n Submit\n </md-button>\n</div>'),e.put("app/core/directives/ms-stepper/templates/vertical/vertical.html",'<div class="ms-stepper-vertical">\n <div class="ms-stepper-vertical-line"></div>\n <div class="ms-stepper-steps" ng-transclude></div>\n</div>'),e.put("app/core/directives/ms-tab-scroll/ms-tab-scroll.html",'<div layout="row">\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'left\')" ng-if="vm.canScroll(\'left\') == true">\n <md-icon md-font-icon="icon-chevron-left" class="icon s26"></md-icon>\n </md-button>\n <div id="bar-container" layout="row" class="bar-container">\n <div ng-transclude id="tab-container" layout="row" layout-align="start center" class="scroll-container">\n </div>\n </div>\n <md-button class="md-icon-button md-mini width-25 no-margin scroll-arrow" ng-click="vm.onTabScroll(\'right\')" ng-if="vm.canScroll(\'right\') == true">\n <md-icon md-font-icon="icon-chevron-right" class="icon s26"></md-icon>\n </md-button>\n</div>'),e.put("app/core/directives/ms-timezone/ms-timezone.html",'<md-select ng-model="ngModel" class="no-margin">\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-repeat="t in timezone | orderBy:\'utcOffset\'" value="{{t.name}}">{{t.name}} ({{t.offsetStr}})</md-option>\n</md-select>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-counter/ms-widget-engine.counter.html",'<div class="pt-8 pb-32" layout="column" layout-align="center center" layout-fill ng-controller="MsWidgetEngineCounterController as vm">\n <div ng-class="\'font-size-\' + (vm.fontSize * 3)" ng-style="{\'color\': widget.foreground}">\n {{ vm.getCount(widget) }}\n </div>\n <div ng-class="\'font-size-\' + vm.fontSize" ng-style="{\'color\': widget.foreground}">{{ \'TOOLS.\' + widget.attrs[0].value | uppercase | translate }}<span ng-if="vm.filtered">*</span></div>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-multibar-chart/ms-widget-engine.multibar-chart.html",'<div ng-controller="MsWidgetEngineMultibarChartController as vm" ng-init="vm.getMultiBarChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getMultiBarChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="bar" class="chart-horizontal-bar" chart-data="vm.multiBarChart.data" chart-options="vm.multiBarChart.options" chart-series="vm.multiBarChart.series" chart-labels="vm.multiBarChart.labels">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-pie-chart/ms-widget-engine.pie-chart.html",'<div ng-controller="MsWidgetEnginePieChartController as vm" ng-init="vm.getPieChart(widget)" layout="column" layout-fill>\n\n <span ng-show="false">{{ vm.getPieChart(widget)}}</span>\n\n <canvas style="overflow:scroll" id="pie" class="chart-pie" chart-data="vm.pieChart.data" chart-labels="vm.pieChart.labels" chart-options="vm.pieChart.options">\n </canvas>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine-web-report/ms-widget-engine.web-report.html",'<div ng-controller="MsWidgetEngineWebReportController as vm" ng-init="vm.onInit(widget)">\n <dl ng-if="vm.error">\n <dt class="text-bold">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt>Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.title}}</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm.onInit(widget)" aria-label="refresh">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <span ng-if="vm.refresh && vm.countDown" class="md-subhead blue-fg">{{vm.countDown}}</span>\n </div>\n </md-toolbar>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span>No Data</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n</div>'),e.put("app/core/directives/ms-widget-engine/ms-widget-engine.html",'<div gridster="vm.config">\n <ul>\n <li gridster-item="widget" ng-repeat="widget in vm.config.widgets">\n <md-card layout-fill>\n <md-toolbar class="height-40" ng-style="{\'background-color\': widget.background, \'color\': widget.foreground }">\n <div class="md-toolbar-tools height-40 no-margin" layout="row" layout-align="start center">\n <a ng-href="{{widget.link ? widget.link : \'javascript:void(0)\'}}" ng-style="{\'color\': widget.foreground}" class="text-truncate" flex>\n {{ widget.title || \'No Title\' }}\n </a>\n <md-button ng-if="!vm.config.preview" class="draggable md-icon-button width-30 no-margin no-padding" aria-label="Move">\n <md-tooltip><span translate="TOOLS.MOVE_WIDGET">Move</span></md-tooltip>\n <md-icon md-font-icon="icon-cursor-move" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu ng-if="!vm.config.preview">\n <md-button ng-click="$mdOpenMenu($event)" class="md-icon-button width-30 no-margin no-padding" aria-label="More">\n <md-icon md-font-icon="icon-dots-vertical" class="s20" ng-style="{\'color\': widget.foreground}"></md-icon>\n </md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-click="vm.onEdit({widget: widget})" translate="TOOLS.EDIT_WIDGET">Edit</md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.onDelete({widget: widget})" translate="TOOLS.DELETE_WIDGET">Delete</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n </div>\n </md-toolbar>\n <md-card-content class="resizable" layout="column" layout-align="center center" flex ng-style="{\'background-color\': widget.background, \'color\': widget.foreground}">\n <div ng-switch="widget.type" layout-fill>\n <iframe ng-switch-when="iframe|custom" ng-switch-when-separator="|" ng-src="{{vm.getTrustedURL(widget.attrs[0].value)}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n <ds-widget-clock ng-class="\'font-size-\' + (widget.attrs[2].value || 12)" ng-switch-when="clock" digital-format="widget.attrs[0].value" gmt-offset="widget.attrs[1].value" data-show-digital show-gmt-info></ds-widget-clock>\n <div ng-switch-default layout-fill>\n <div ng-include="widget.templateUrl" layout-fill></div>\n </div>\n </div>\n </md-card-content>\n </md-card>\n </li>\n </ul>\n</div>'),e.put("app/core/layouts/content-only.html",'<div id="layout-content-only" class="template-layout" layout="column" flex>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n</div>'),e.put("app/core/layouts/content-with-toolbar.html",'<div id="layout-content-with-toolbar" class="template-layout" layout="column" flex>\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <md-content id="content" class="animate-slide-up md-hue-2" ui-view="content" flex></md-content>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n</div>'),e.put("app/core/layouts/horizontal-navigation.html",'<div id="layout-horizontal-navigation" class="template-layout" layout="column" flex>\n\n <div id="toolbar-navigation-container" class="md-whiteframe-1dp" layout="column" layout-align="space-between start">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n <div id="horizontal-navigation" ui-view="navigation" layout="row" layout-align="start end" flex></div>\n </div>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar-2.html",'<div id="layout-vertical-navigation-fullwidth-toolbar-2" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation-fullwidth-toolbar.html",'<div id="layout-vertical-navigation-fullwidth-toolbar" class="template-layout" layout="column" flex>\n\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp md-accent" ui-view="toolbar"></md-toolbar>\n\n <div id="main-container" layout="row" flex>\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n </div>\n\n\n</div>'),e.put("app/core/layouts/vertical-navigation.html",'<div id="header" ui-view="header"></div>\n\n<div id="layout-vertical-navigation" class="template-layout" layout="row" flex>\n\n <md-sidenav id="vertical-navigation" class="md-primary-bg" md-is-locked-open="$mdMedia(\'gt-sm\')" md-component-id="navigation" ms-scroll ui-view="navigation" ng-if="!vm.isAgent()"></md-sidenav>\n\n <div id="content-container" flex layout="column">\n <md-toolbar id="toolbar" class="md-menu-toolbar md-whiteframe-1dp" ui-view="toolbar"></md-toolbar>\n\n <md-content id="content" class="animate-slide-up md-hue-2" ms-scroll ui-view="content" flex></md-content>\n </div>\n\n <md-sidenav id="quick-panel" class="md-sidenav-right md-whiteframe-4dp" md-component-id="quick-panel" ms-scroll ui-view="quickPanel"></md-sidenav>\n\n</div>\n\n<div id="footer" ui-view="footer"></div>'),e.put("app/core/theme-options/theme-options.html",'<div class="ms-theme-options-button md-primary-bg" ng-click="toggleOptionsSidenav()">\n <md-icon md-font-icon="icon-cog" class="white-text"></md-icon>\n</div>\n\n<md-sidenav md-component-id="motion-theme-options" class="md-sidenav-right">\n\n <div class="ms-theme-options-list" layout="column">\n <div class="theme-option layout-options">\n <div class="option-title">Layout Style:</div>\n <md-radio-group layout="row" layout-align="start start" layout-wrap ng-model="vm.layoutStyle" ng-change="vm.updateLayoutStyle()">\n <md-radio-button ng-repeat="layoutStyle in vm.layoutStyles" ng-value="layoutStyle.value">\n <div layout="column" layout-align="center center">\n <img ng-src="{{layoutStyle.figure}}">\n <span class="text-center font-size-12 mt-8">{{layoutStyle.label}}</span>\n </div>\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option">\n <div class="option-title">Layout Mode:</div>\n <md-radio-group layout="row" layout-align="start center" ng-model="vm.layoutMode" ng-change="vm.updateLayoutMode()">\n <md-radio-button ng-repeat="layoutMode in vm.layoutModes" ng-value="layoutMode.value">\n {{layoutMode.label}}\n </md-radio-button>\n </md-radio-group>\n </div>\n\n <md-divider></md-divider>\n\n <div class="theme-option color-palettes">\n <div class="option-title">Color Palette:</div>\n <div layout="row" layout-align="start start" layout-wrap>\n <md-button ng-repeat="(themeName, theme) in vm.themes.list" class="md-raised theme-button" layout="row" layout-align="center center" aria-label="{{themeName}}" ng-click="vm.setActiveTheme(themeName)" ng-style="{\'background-color\': theme.primary.color,\'border-color\': theme.accent.color,\'color\': theme.primary.contrast1}" ng-class="{active: vm.getActiveTheme().name === themeName}">\n <md-icon ng-style="{\'color\': theme.primary.contrast1}" md-font-icon="icon-palette" class="icon s32"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n</md-sidenav>'),e.put("app/errors/404/error-404.html",'<div id="error-404" layout="column" layout-align="center center">\n <div class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR404.CODE">404</div>\n\n <div class="message" translate="ERROR404.MESSAGE">Sorry but we couldn’t find the page you are looking for</div>\n <ms-search-bar on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300">Search for anything</ms-search-bar>\n\n \x3c!-- <div class="search md-whiteframe-1dp" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-magnify" class="icon s24"></md-icon>\n <input ng-model="vm.search" type="text" placeholder="Search for anything" translate translate-attr-placeholder="ERROR404.SEARCH" flex>\n </div> --\x3e\n\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR404.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/errors/500/error-500.html",'<div id="error-500" layout="column" layout-align="center center">\n <div ng-if="!vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code" translate="ERROR500.CODE">500</div>\n <div class="message" translate="ERROR500.MESSAGE">Well, you broke the internet!</div>\n <div class="sub-message" translate="ERROR500.SUBMESSAGE">Just kidding, looks like we have an internal issue, please try again in couple minutes\n </div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n <md-button class="md-raised md-warn" ng-click="vm.sendReport()" translate="ERROR500.REPORT">Report this problem</md-button>\n </div>\n <pre ng-if="!vm.send">\n {{vm.error}}\n </pre>\n <div ng-if="vm.send" class="content" layout="column" layout-align="center center">\n <div class="error-code">#{{vm.code}}</div>\n <div class="message" translate="ERROR500.JIRA_MESSAGE">Your request has been received and will be processed shortly.</div>\n <div class="sub-message" translate="ERROR500.JIRA_SUBMESSAGE">Sorry for the inconvenience. If you have any questions or concerns, please do not hesitate to contact us.</div>\n <a class="md-button md-raised md-primary back-link" href="/" translate="ERROR500.GO_BACK">Go back to dashboard</a>\n </div>\n</div>'),e.put("app/footer/layouts/vertical-navigation/footer.html",'<div layout="row" layout-align="start center">\n <ms-info-bar ng-if="!vm.cookieAlertHide" on-close="vm.cookieAlertOnClose()" class="grey-100-bg">\n <div layout="row" layout-align="start center">\n <span translate="FOOTER.COOKIE_LAW" flex class="text-center grey-600-fg"></span>\n </div>\n </ms-info-bar>\n</div>'),e.put("app/forgot/forgot.html",'<div id="forgot-password" class="flex-scrollable" layout="column" ms-scroll ng-init="vm.onInit()">\n <div id="forgot-password-form-wrapper" layout="column" layout-align="center center">\n <div id="forgot-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="FORGOTPASSWORD.TITLE">Recover your password</div>\n\n <form name="forgotPasswordForm" novalidate>\n <md-input-container class="md-block" md-no-float>\n <input type="email" name="email" ng-model="vm.form.email" placeholder="Email address" translate translate-attr-placeholder="FORGOTPASSWORD.EMAIL_ADRESS" ng-pattern="/^.+@.+\\..+$/" required>\n <div ng-messages="forgotPasswordForm.email.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FORGOTPASSWORD.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.forgotPassword()" class="md-raised md-accent submit-button" aria-label="RESET MY PASSWORD" ng-disabled="forgotPasswordForm.$invalid || forgotPasswordForm.$pristine" translate="FORGOTPASSWORD.SEND_RESET_LINK" translate-attr-aria-label="FORGOTPASSWORD.SEND_RESET_LINK">\n SEND RESET LINK\n </md-button>\n </form>\n\n <div class="login" layout="row" layout-align="center center">\n <a class="link" ui-sref="app.login" translate="FORGOTPASSWORD.GO_BACK">Go back to login</a>\n </div>\n </div>\n </div>\n</div>'),e.put("app/header/layouts/vertical-navigation/header.html",'\x3c!-- <div layout="row" layout-align="start center">\n <ms-info-bar ng-if="vm.currentUser.role == \'admin\' && !vm.newsAlertHide" on-close="vm.newsAlertOnClose()" class="green-600-bg white-fg">\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text-outline" class="icon margin-right-10 s20"></md-icon>\n <div flex hide-xs translate="HEADER.NEWS"></div>\n </div>\n </ms-info-bar>\n</div> --\x3e'),e.put("app/login/login.html",'<div id="login" class="flex-scrollable" layout="column" ms-scroll>\n <div id="login-form-wrapper" layout="column" layout-align="center center">\n <div id="login-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n \x3c!-- <img src="assets/images/logos/login.png" alt="motion_logo_login" /> --\x3e\n\n <div class="md-subhead padding-top-45" translate="LOGIN.TITLE">Log in to your account</div>\n\n <form name="loginForm" novalidate ng-if="!vm.progressLogin">\n <md-input-container class="md-block" md-no-float>\n <input type="input" name="name" ng-model="vm.form.name" autofocus aria-label="username" translate translate-attr-placeholder="LOGIN.USERNAME" required>\n <div ng-messages="loginForm.name.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" aria-label="password" translate translate-attr-placeholder="LOGIN.PASSWORD" required>\n <div ng-messages="loginForm.password.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="LOGIN.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="remember-forgot-password" layout="row" layout-xs="column" layout-align="end center">\n \x3c!-- <md-checkbox class="remember-me" ng-model="data.cb1" aria-label="Remember Me">\n <span translate="LOGIN.REMEMBER_ME">Remember Me</span>\n </md-checkbox> --\x3e\n <a ui-sref="app.forgot" class="forgot-password md-accent-color" style="cursor:pointer;" translate="LOGIN.FORGOT_PASSWORD">Forgot Password?</a>\n </div>\n\n <b layout="row" layout-align="center center" class="md-padding" ng-if="vm.message">\n <font color="red">{{vm.message}}</font>\n </b>\n <md-button type="submit" ng-click="vm.login()" class="md-raised md-accent submit-button" aria-label="LOGIN" translate="LOGIN.LOG_IN" translate-attr-aria-label="LOGIN.LOG_IN">\n LOG IN\n </md-button>\n </form>\n\n <md-progress-circular ng-if="vm.progressLogin" md-diameter="96"></md-progress-circular>\n\n <div class="separator">\n <span class="text" translate="LOGIN.OR">OR</span>\n </div>\n\n <md-button ng-click="vm.loginOauth(\'google\')" class="md-raised google">\n <div layout="row" layout-align="center center">\n <span>\n <md-icon md-font-icon="icon-google-plus" class="s16"></md-icon>\n <span translate="LOGIN.WITH_GOOGLE">Log in with Google</span>\n </span>\n </div>\n </md-button>\n </div>\n </div>\n</div>'),e.put("app/main/apps/analytics/views/extractedReports/create/dialog.html",'<md-dialog class="extractedReport-dialog" aria-label="New ExtractedReport">\n <form name="extractedReportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.REPORTNAME">ReportName</label>\n <input type="" name="name" ng-model="vm.extractedReport.name" ng-required="true" autofocus>\n\n <div ng-messages="extractedReportForm[\'name\'].$error" ng-show="extractedReportForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.REPORTNAME_REQUIRED">ReportName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="basename" ng-model="vm.extractedReport.basename" ng-required="true">\n\n <div ng-messages="extractedReportForm[\'basename\'].$error" ng-show="extractedReportForm[\'basename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newExtractedReport" ng-click="vm.saveExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid || extractedReportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newExtractedReport" ng-click="vm.addNewExtractedReport()" class="send-button md-accent md-raised" ng-disabled="extractedReportForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_EXTRACTEDREPORT" translate-attr-aria-label="ANALYTICS.ADD_EXTRACTEDREPORT">\n ADD EXTRACTEDREPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newExtractedReport" ng-click="vm.deleteExtractedReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/extractedReports/extractedReports.html",'<div id="extractedReports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.EXTRACTEDREPORTS">ExtractedReports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedExtractedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedExtractedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-extractedReports-count">\n <span>{{vm.selectedExtractedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="EXTRACTEDREPORTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllExtractedReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectExtractedReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedExtractedReports" csv-label="true" filename="extractedReports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedExtractedReports($event)" aria-label="delete selected" translate translate-attr-label="EXTRACTEDREPORTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- EXTRACTEDREPORT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedExtractedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getExtractedReports">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.REPORTNAME\' | translate }}</th>\n <th md-column md-order-by="basename">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'ANALYTICS.TYPE\' | translate }}</th>\n <th md-column md-order-by="startDate">{{ \'ANALYTICS.DATE_RANGE_FROM\' | translate }}</th>\n <th md-column md-order-by="endDate">{{ \'ANALYTICS.DATE_RANGE_TO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.GENERATED_AT\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'ANALYTICS.STATUS\' | translate }}</th>\n <th md-column md-order-by="output">{{ \'ANALYTICS.OUTPUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.extractedReports.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="extractedReport" md-select-id="id" ng-repeat="extractedReport in vm.extractedReports.rows">\n <td md-cell ng-if="extractedReport.userpic"><img class="avatar" alt="{{extractedReport.name}}" ng-src="api/users/{{extractedReport.id}}/avatar" /></td>\n <td md-cell ng-if="!extractedReport.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{extractedReport.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="id ">{{extractedReport.id}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="name ">{{extractedReport.name}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="basename ">{{extractedReport.basename}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="type ">{{extractedReport.type}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="startDate ">{{extractedReport.startDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="endDate ">{{extractedReport.endDate | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="createdAt ">{{extractedReport.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="status ">{{extractedReport.status}}</td>\n <td ng-click="vm.createOrEditExtractedReport($event, extractedReport)" md-cell class="output ">{{extractedReport.output}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(extractedReport, $event)" translate="ANALYTICS.EDIT_EXTRACTEDREPORT">\n Edit ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(extractedReport, $event)" translate="ANALYTICS.DOWNLOAD_EXTRACTEDREPORT">\n Download ExtractedReport\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(extractedReport, $event)" translate="ANALYTICS.DELETE_EXTRACTEDREPORT">\n Delete ExtractedReport\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.extractedReports.count}}" md-on-paginate="vm.getExtractedReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / EXTRACTEDREPORT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/metrics/create/dialog.html",'<md-dialog class="metric-dialog" aria-label="New Metric">\n <form name="metricForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.metric.name" ng-required="true" autofocus>\n\n <div ng-messages="metricForm[\'name\'].$error" ng-show="metricForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select name="table" ng-model="vm.metric.table" required>\n <md-option ng-value="\'report_agent\'">Agent Report</md-option>\n <md-option ng-value="\'report_call\'">Call Report</md-option>\n <md-option ng-value="\'cm_contacts\'">Contacts</md-option>\n <md-option ng-value="\'report_square\'">CSquare Report</md-option>\n <md-option ng-value="\'report_square_details\'">CSquare Details Report</md-option>\n <md-option ng-value="\'cm_hopper\'">Dialer Hopper Processing</md-option>\n <md-option ng-value="\'cm_hopper_history\'">Dialer Hopper Logs</md-option>\n <md-option ng-value="\'cm_hopper_final\'">Dialer Hopper Final</md-option>\n <md-option ng-value="\'report_integration\'">Integration Report</md-option>\n <md-option ng-value="\'report_jscripty_sessions\'">Jscripty Sessions</md-option>\n <md-option ng-value="\'report_jscripty_questions\'">Jscripty Questions</md-option>\n <md-option ng-value="\'report_jscripty_answers\'">Jscripty Answers</md-option>\n <md-option ng-value="\'cm_lists\'">Lists</md-option>\n <md-option ng-value="\'report_member\'">Member Report</md-option>\n <md-option ng-value="\'report_queue\'">Queue Report</md-option>\n <md-option ng-value="\'users\'">Users</md-option>\n <md-option ng-value="\'voice_recordings\'">Voice Recordings</md-option>\n </md-select>\n <div ng-messages="metricForm[\'table\'].$error" ng-show="metricForm[\'table\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.METRIC">Metric</label>\n <input type="text" name="metric" ng-model="vm.metric.metric" ng-required="true">\n\n <div ng-messages="metricForm[\'metric\'].$error" ng-show="metricForm[\'metric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.metric.description">\n\n <div ng-messages="metricForm[\'description\'].$error" ng-show="metricForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMetric" ng-click="vm.saveMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid || metricForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMetric" ng-click="vm.addNewMetric()" class="send-button md-accent md-raised" ng-disabled="metricForm.$invalid" aria-label="ADD" translate="ANALYTICS.ADD_METRIC" translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n ADD METRIC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMetric" ng-click="vm.deleteMetric($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/metrics/metrics.html",'<div id="metrics" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.METRICS">Metrics</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMetrics.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMetrics =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-metrics-count">\n <span>{{vm.selectedMetrics.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="METRICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMetrics()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMetrics()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMetrics" csv-label="true" filename="metrics.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMetrics($event)" aria-label="delete selected" translate translate-attr-label="METRICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- METRIC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMetrics" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMetrics">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="table">{{ \'ANALYTICS.TABLE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.metrics.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="metric" md-select-id="id" ng-repeat="metric in vm.metrics.rows">\n <td md-cell ng-if="metric.userpic"><img class="avatar" alt="{{metric.name}}" ng-src="api/users/{{metric.id}}/avatar" /></td>\n <td md-cell ng-if="!metric.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{metric.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="id ">{{metric.id}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="name ">{{metric.name}}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="table ">{{ vm.arraytable[metric.table].option }}</td>\n <td ng-click="vm.createOrEditMetric($event, metric)" md-cell class="description ">{{metric.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(metric, $event)" translate="ANALYTICS.EDIT_METRIC">\n Edit Metric\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(metric, $event)" translate="ANALYTICS.DELETE_METRIC">\n Delete Metric\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.metrics.count}}" md-on-paginate="vm.getMetrics" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / METRIC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD METRIC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-metric-button" ng-click="vm.createOrEditMetric($event)" aria-label="add metric" translate translate-attr-aria-label="ANALYTICS.ADD_METRIC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD METRIC BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/copy/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.COPY_REPORT">Copy Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label translate="ANALYTICS.SELECT_NODE">Select Node</label>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.copyReport()" class="send-button md-accent md-raised" ng-disabled="!vm.currentNode" aria-label="COPY" translate="ANALYTICS.COPY_REPORT" translate-attr-aria-label="ANALYTICS.COPY_REPORT">\n COPY REPORT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/create/dialog.html",'<md-dialog class="report-dialog" aria-label="New Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newReport">\n <label translate="ANALYTICS.TABLE">Table</label>\n <md-select ng-model="vm.report.table" required>\n <md-option ng-repeat="table in vm.tables | orderBy:\'name\'" ng-value="table.name">{{table.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.table.$error" ng-show="reportForm.table.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TABLE_REQUIRED">Table field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.report.description">\n <div ng-messages="reportForm.description.$error" ng-show="reportForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-autocomplete ng-if="vm.newReport" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="table in vm.tables | filter:vm.searchText" md-item-text="table.name" md-min-length="0" md-selected-item-change="vm.selectedTableChange(table)" placeholder="Select the table to Join">\n <md-item-template>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{table.name}}</span>\n </md-item-template>\n <md-not-found>\n No states matching "{{vm.searchText}}" were found.\n </md-not-found>\n </md-autocomplete>\n\n <md-card ng-if="vm.newReport" md-theme="default" md-theme-watch ng-repeat="table in vm.joinTables">\n <md-card-title>\n <md-card-title-text layout="row">\n <div layout="row" flex="50">\n <span class="md-subhead">{{table.name}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-button class="md-icon-button" ng-click="vm.removeJoin($index)">\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n <md-select ng-model="table.parentKey" placeholder="Select the parent key" ng-init="table.parentFields = []; vm.getFields(table, \'parentFields\', vm.report.table)" required>\n <md-option ng-repeat="field in table.parentFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.foreignKey" placeholder="Select the foreign key" ng-init="table.foreignFields = []; vm.getFields(table, \'foreignFields\', table.name)" required>\n <md-option ng-repeat="field in table.foreignFields" ng-value="field">{{field}}</md-option>\n </md-select>\n <md-select ng-model="table.type" placeholder="Select join type" required>\n <md-option ng-repeat="join in vm.joinTypes" ng-value="join.key">{{join.value}}</md-option>\n </md-select>\n </md-card-content>\n </md-card>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReport" ng-click="vm.saveReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReport" ng-click="vm.addNewReport()" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid || reportForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORT" translate-attr-aria-label="ANALYTICS.ADD_REPORT">\n ADD REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReport" ng-click="vm.deleteReport($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/condition/group.html",'<md-card class="padding-horizontal-15 padding-top-15">\n <div layout="row" ng-if="vm_rc.crudPermissions.canEdit">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.OPERATOR">Operator</label>\n <md-select ng-model="group.operator" required>\n <md-option value="AND">AND</md-option>\n <md-option value="OR">OR</md-option>\n </md-select>\n <div ng-messages="conditionsForm.operator.$error" ng-show="conditionsForm.operator.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addCondition(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.CONDITION\' | translate}}\n </md-button>\n </md-input-container>\n <md-input-container class="md-block">\n <md-button class="md-raised md-accent" ng-click="vm_rc.addGroup(group.rules)">\n <md-icon md-font-icon="icon-plus"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n <div flex></div>\n <md-input-container class="md-block" ng-if="parent">\n <md-button class="md-raised md-warn" ng-click="vm_rc.deleteConfirm(parent, index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon> {{\'ANALYTICS.GROUP\' | translate}}\n </md-button>\n </md-input-container>\n </div>\n <div layout="column" ng-repeat="rule in group.rules track by $index">\n <div layout="row" ng-if="!rule.group">\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.COLUMN">COLUMN</label>\n <md-select name="field" ng-model="rule.field" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-optgroup label="{{vm_rc.report.table}}">\n <md-option ng-repeat="column in vm_rc.columns" value="{{vm_rc.report.table}}.{{column}}">{{column}}</md-option>\n </md-optgroup>\n <md-optgroup ng-if="vm_rc.report.joins" ng-repeat="join in vm_rc.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="conditionsForm.field.$error" ng-show="conditionsForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="ANALYTICS.CONDITION">CONDITION</label>\n <md-select name="condition" ng-model="rule.condition" ng-disabled="!vm_rc.crudPermissions.canEdit" required>\n <md-option ng-repeat="condition in vm_rc.conditions" ng-value="condition">{{condition}}</md-option>\n </md-select>\n <div ng-messages="conditionsForm.condition.$error" ng-show="conditionsForm.condition.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm_rc.isValueByCondition(rule.condition)" class="md-block" flex>\n <label translate="ANALYTICS.VALUE">VALUE</label>\n <input type="text" name="value" ng-model="rule.value" ng-disabled="!vm_rc.crudPermissions.canEdit" required md-autofocus>\n <div ng-messages="conditionsForm.value.$error" ng-show="conditionsForm.value.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm_rc.crudPermissions.canEdit" flex>\n <md-button class="md-fab md-mini md-warn" aria-label="Delete row" ng-click="vm_rc.deleteConfirm(group.rules, $index, $event)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </md-input-container>\n </div>\n <div ng-if="rule.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="parent=group.rules;index=$index;group=rule.group"></div>\n </div>\n</md-card>'),e.put("app/main/apps/analytics/views/reports/edit/field/dialog.html",'<md-dialog class="reportField-dialog" aria-label="New Report Field">\n <form name="reportFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <pre></pre>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.reportField.type" ng-change="vm.reportField.field = undefined" required>\n <md-option value="column">Select a column</md-option>\n <md-option value="metric">Select an existing metric</md-option>\n <md-option value="custom">Write a custom metric</md-option>\n </md-select>\n <div ng-messages="reportForm.type.$error" ng-show="reportForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-switch on="vm.reportField.type">\n <md-input-container class="md-block" ng-switch-when="column">\n <label translate="ANALYTICS.COLUMN">Column Name</label>\n <md-select name="column" ng-model="vm.reportField.field" required>\n <md-optgroup label="{{vm.report.table}}">\n <md-option ng-repeat="column in vm.columns" value="{{vm.report.table}}.{{column}}">{{column}}</md-option>\n \x3c!-- <md-option ng-repeat="column in vm.columns" ng-value="">{{column}}</md-option> --\x3e\n </md-optgroup>\n <md-optgroup ng-if="vm.report.joins" ng-repeat="join in vm.report.joins" label="{{join.foreignTable}}">\n <md-option ng-repeat="field in join.foreignTableFields" value="{{join.foreignTable}}.{{field}}">{{field}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="reportForm.column.$error" ng-show="reportForm.column.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.COLUMN_REQUIRED">Column field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="metric">\n <label translate="ANALYTICS.METRIC_NAME">Metric Name</label>\n <md-select name="metric" ng-model="vm.reportField.MetricId" required>\n <md-option ng-repeat="metric in vm.metrics" ng-value="metric.id">{{metric.name}}</md-option>\n </md-select>\n <div ng-messages="reportForm.metric.$error" ng-show="reportForm.metric.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-switch-when="custom">\n <label translate="ANALYTICS.CUSTOM_METRIC">Custom Metric</label>\n <input type="text" name="field" ng-model="vm.reportField.field" required md-autofocus>\n <div ng-messages="reportFieldForm.field.$error" ng-show="reportFieldForm.field.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.CUSTOM_METRIC_REQUIRED">Custom Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.reportField.alias" ng-required="vm.reportField.type === \'custom\' || vm.reportField.type === \'metric\'">\n <div ng-messages="reportFieldForm.alias.$error" ng-show="reportFieldForm.alias.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FUNCTION">Function</label>\n <md-select name="function" ng-model="vm.reportField.function">\n <md-option ng-value="null">No Function</md-option>\n <md-option ng-repeat="function in vm.sqlUtil.getFunctions" ng-value="function.value">{{function.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.reportField.type !== \'metric\'">\n <label translate="ANALYTICS.FORMAT">Format</label>\n <md-select name="format" ng-model="vm.reportField.format">\n <md-option ng-value="null">No Format</md-option>\n <md-option ng-repeat="format in vm.sqlUtil.getFormats" ng-value="format.value">{{format.value}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.GROUP_BY">Group By</label>\n <md-select name="groupBy" ng-model="vm.reportField.groupBy">\n <md-option ng-repeat="gb in vm.sqlUtil.getGroupBy" ng-value="gb.value">{{gb.value ? \'Yes\' : \'No\'}}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.ORDER_BY">Order By</label>\n <md-select name="orderBy" ng-model="vm.reportField.orderBy">\n <md-option ng-value="null">No Order</md-option>\n <md-option ng-repeat="ob in vm.sqlUtil.getOrderBy" ng-value="ob.value">{{ob.value}}</md-option>\n </md-select>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newReportField" ng-click="vm.saveReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="SAVE" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newReportField" ng-click="vm.addNewReportField()" class="send-button md-accent md-raised" ng-disabled="reportFieldForm.$invalid || reportFieldForm.$pristine" aria-label="ADD" translate="ANALYTICS.ADD_REPORTFIELD" translate-attr-aria-label="ANALYTICS.ADD_REPORTFIELD">\n ADD REPORT FIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newReportField" ng-click="vm.deleteReportField($event)" aria-label="DELETE" translate translate-attr-aria-label="ANALYTICS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="ANALYTICS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/edit/view.html",'<div id="analytics-report" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-reports-button md-icon-button" aria-label="Go to reports" ng-click="vm.gotoReports()" translate translate-attr-aria-label="ANALYTICS.GO_TO_ANALYTICSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="report-image" hide-xs>\n <img ng-src="assets/images/business/reports.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.report.id}} {{vm.report.name}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="ANALYTICS.CREATED_AT"></span> <span>{{vm.report.createdAt | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span>{{vm.report.description}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div>\n <md-button type="submit" ng-click="vm.saveReport()" ng-disabled="generalForm.$pristine && conditionsForm.$pristine" class="send-button md-accent md-raised" translate="ANALYTICS.SAVE" translate-attr-aria-label="ANALYTICS.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input type="text" name="name" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.name" required md-autofocus>\n <div ng-messages="generalForm.name.$error" ng-show="generalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-disabled="!vm.crudPermissions.canEdit" ng-model="vm.report.description">\n <div ng-messages="generalForm.description.$error" ng-show="generalForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container fields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportFieldsController as vm_rf" ng-init="vm_rf.init(vm.report, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="start start">\n <div class="md-subhead" translate="ANALYTICS.FIELDS">\n <span translate="ANALYTICS.FIELDS">FIELDS</span>\n </div>\n <div class="h4">\n <span translate="ANALYTICS.TABLE">TABLE</span> <span class="text-bold">{{vm.report.table}}</span>\n </div>\n <div class="h4" ng-if="vm.report.joins && vm.report.joins.length && vm.isArray(vm.report.joins)">\n <span>Join</span> <span class="text-bold">{{ vm.mapArray(vm.report.joins, \'foreignTable\') }}</span>\n </div>\n </div>\n </div>\n <div flex></div>\n <ms-search-bar on-search="vm_rf.query.filter = query" on-collapse="vm_rf.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-if="vm_rf.crudPermissions.canEdit" ng-click="vm_rf.createOrEditReportField($event)" aria-label="add field" translate translate-attr-label="ANALYTICS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_rf.selectedReportFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_rf.selectedReportFields.length}} {{vm_rf.selectedReportFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_rf.deleteSelectedReportFields($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select="vm_rf.crudPermissions.canDelete" multiple ng-model="vm_rf.selectedReportFields" md-progress="vm_rf.promise">\n <thead md-head md-order="vm_rf.query.sort" md-on-reorder="vm_rf.getReportFields">\n <tr md-row>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical"></md-icon>\n </th>\n <th md-column>Type</th>\n <th md-column>Column or Metric</th>\n <th md-column>Alias</th>\n <th md-column>Function</th>\n <th md-column>Format</th>\n <th md-column>Group By</th>\n <th md-column>Order By</th>\n <th md-column width="10px" ng-if="vm_rf.crudPermissions.canEdit"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_rf.sortableTable">\n <tr md-row md-select="reportField" md-select-id="id" ng-repeat="reportField in vm_rf.reportFields.rows">\n <td md-cell class="handle" ng-if="vm_rf.crudPermissions.canEdit">\n <md-icon md-font-icon="icon-drag-vertical" class="s16">\n </td>\n <td md-cell>\n <div ng-if="reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-shape-plus s16"></div>\n <div ng-if="!reportField.MetricId && reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-pencil-box-outline s16"></div>\n <div ng-if="!reportField.MetricId && !reportField.custom" ng-click="vm_rf.createOrEditReportField($event, reportField)" class="icon icon-view-column s16"></div>\n </td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.MetricId ? vm_rf.getMetricName(reportField.MetricId) : reportField.field}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)">{{reportField.alias}}</td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.function">{{reportField.function}}</span><span ng-if="!reportField.function">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.format">{{reportField.format}}</span><span ng-if="!reportField.format">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.groupBy">YES</span><span ng-if="!reportField.groupBy">--</span></td>\n <td md-cell ng-click="vm_rf.createOrEditReportField($event, reportField)"><span class="text-boxed blue-bg white-fg" ng-if="reportField.orderBy">{{reportField.orderBy}}</span><span ng-if="!reportField.orderBy">--</span></td>\n <td md-cell class="actions" ng-if="vm_rf.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_rf.createOrEditReportField($event, reportField)" translate="ANALYTICS.EDIT_REPORTFIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_rf.deleteConfirm(reportField, $event)" translate="ANALYTICS.DELETE_REPORTFIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="ANALYTICS.CONDITIONS">CONDITIONS</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container conditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ReportConditionsController as vm_rc" ng-init="vm_rc.init(vm.report, vm.crudPermissions)">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="ANALYTICS.CONDITION">CONDITION</div>\n </div>\n <form name="conditionsForm" novalidate>\n <div ng-if="vm_rc.report.condition.group" ng-include="\'app/main/apps/analytics/views/reports/edit/condition/group.html\'" ng-init="group=vm_rc.report.condition.group"></div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.previewReport()">\n <md-tab-label>\n <span translate="ANALYTICS.PREVIEW">PREVIEW</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab md-on-select="vm.queryReport()">\n <md-tab-label>\n <span>Query</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="report-detail-form-container result md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text">SQL</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <div ng-if="!vm.error">\n {{vm.queryResult}}\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/analytics/views/reports/preview/dialog.html",'<md-dialog aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Preview Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n <div ng-if="!vm.error" class="h2 secondary-text" translate="ANALYTICS.LIMITED_RESULT">LIMITED RESULT</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.rows.length">\n <td md-cell colspan="{{vm.columns.length}}"><span translate="ANALYTICS.NO_DATA">NO DATA</span></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/reports.html",'<div id="reports" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-chart-line" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="ANALYTICS.REPORTS">Reports</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedReports.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedReports =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="ANALYTICS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-reports-count">\n <span>{{vm.selectedReports.length}}</span>\n <span translate="ANALYTICS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ANALYTICS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllReports()" translate="ANALYTICS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectReports()" translate="ANALYTICS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedReports" csv-label="true" filename="reports.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom" class="md-icon-button" ng-click="vm.deleteSelectedReports($event)" aria-label="delete selected" translate translate-attr-label="ANALYTICS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div layout="column" flex="30">\n <md-card class="padding-top-5 padding-horizontal-10 padding-bottom-0">\n \x3c!-- SEARCH --\x3e\n <div layout="row" layout-align="start center">\n <label for="searchFolder" class="m-0">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="margin-horizontal-0 margin-bottom-0 margin-top-10" flex>\n <input id="searchFolder" placeholder="Search folder" type="text" ng-model="vm.search" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="ANALYTICS.SEARCH_FOR_FOLDER">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeDefaultConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeCustomConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flow-init flow-file-added="vm.importReport($file, $event, $flow)">\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" aria-label="import report" translate translate-attr-label="ANALYTICS.IMPORT_REPORT" flow-btn>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom" class="md-icon-button" ng-click="vm.createOrEditReport($event)" aria-label="add report" translate translate-attr-label="ANALYTICS.ADD_REPORT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedReports" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ \'ANALYTICS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'ANALYTICS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'ANALYTICS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'ANALYTICS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="id">{{report.id}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="name">{{report.name}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="description">{{report.description}}</td>\n <td ng-click="!vm.crudPermissions.canEdit ? vm.currentNode.custom && vm.editstate(report, $event) : vm.currentNode.custom && vm.createOrEditReport($event, report)" md-cell class="createdAt">{{report.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="ANALYTICS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.copydialog(report, $event)" translate="ANALYTICS.COPY_REPORT">\n Copy Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.previewdialog(report, $event)" translate="ANALYTICS.PREVIEW_REPORT">\n Preview Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.rundialog(report, $event)" translate="ANALYTICS.RUN_REPORT">\n Run Report\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(report, $event)" translate="ANALYTICS.DOWNLOAD_JSON_REPORT">\n Download Json Report\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete && vm.currentNode.custom">\n </md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && vm.currentNode.custom">\n <md-button ng-click="vm.editstate(report, $event)" translate="ANALYTICS.EDIT_REPORT">\n Edit Report\n </md-button>\n </md-menu-item>\n\n <md-menu-item ng-if="vm.crudPermissions.canDelete && vm.currentNode.custom">\n <md-button ng-click="vm.deleteconfirm(report, $event)" translate="ANALYTICS.DELETE_REPORT">\n Delete Report\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.reports.count}}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/analytics/views/reports/run/dialog.html",'<md-dialog class="report-dialog" aria-label="Run Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.RUN_REPORT">Run Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.NAME">Name</label>\n <input name="name" ng-model="vm.export.name" required md-autofocus>\n <div ng-messages="reportForm.name.$error" ng-show="reportForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="ANALYTICS.FORMAT">FORMAT</label>\n <md-select name="format" ng-model="vm.export.output" required>\n <md-option value="csv">CSV</md-option>\n <md-option value="xlsx">Excel (XLSX)</md-option>\n <md-option value="pdf">PDF</md-option>\n <md-option value="web">Web</md-option>\n </md-select>\n <div ng-messages="reportForm.format.$error" ng-show="reportForm.format.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeFrom" mdp-placeholder="Date Range From" mdp-format="YYYY-MM-DD" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.dateRangeFrom.$error" ng-show="reportForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="maxDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MAX_INVALID">Date Range From Max field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div class="md-block" flex>\n <mdp-date-picker mdp-open-on-click required name="dateRangeTo" mdp-placeholder="Date Range To" mdp-format="YYYY-MM-DD" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.dateRangeTo.$error" ng-show="reportForm.dateRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_REQUIRED">Date Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_TO_INVALID">Date Range From field is invalid</span>\n </div>\n <div ng-message="minDate">\n <span translate="ANALYTICS.ERRORS.DATE_RANGE_FROM_MIN_INVALID">Date Range From Min field is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n </div>\n <div layout="row">\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeFrom" mdp-placeholder="Time Range From" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-max-date="vm.dateRangeTo" ng-model="vm.export.startDate">\n <div ng-messages="reportForm.timeRangeFrom.$error" ng-show="reportForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex>\n <mdp-time-picker required name="timeRangeTo" mdp-placeholder="Time Range To" mdp-format="HH:mm:ss" mdp-auto-switch="true" mdp-min-date="vm.dateRangeFrom" ng-model="vm.export.endDate">\n <div ng-messages="reportForm.timeRangeTo.$error" ng-show="reportForm.timeRangeTo.$touched" role="alert">\n <div ng-message="required">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range From field is required</span>\n </div>\n <div ng-message="format">\n <span translate="ANALYTICS.ERRORS.TIME_RANGE_TO_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.runReport($event)" class="send-button md-accent md-raised" ng-disabled="reportForm.$invalid" aria-label="RUN" translate="ANALYTICS.RUN_REPORT" translate-attr-aria-label="ANALYTICS.RUN_REPORT">\n RUN REPORT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.refreshDate()" aria-label="REFRESH" translate translate-attr-aria-label="ANALYTICS.REFRESH">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n <md-tooltip><span translate="ANALYTICS.REFRESH">REFRESH</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/analytics/views/reports/run/web/dialog.html",'<md-dialog class="web-dialog" aria-label="Show Report">\n <form name="reportForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="ANALYTICS.PREVIEW_REPORT">Web Report</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <div class="pb-16" layout="row" layout-align="start center">\n <div ng-if="vm.error" class="h2 secondary-text" translate="ANALYTICS.ERROR">ERROR</div>\n </div>\n <dl ng-if="vm.error">\n <dt class="text-bold" translate="ANALYTICS.QUERY_ERROR">Query Error</dt>\n <dd>{{vm.error.sql}}</dd>\n <dt translate="ANALYTICS.MESSAGE">Message</dt>\n <dd>{{vm.error.msg}}</dd>\n </dl>\n <md-table-container ng-if="!vm.error">\n <table md-table md-progress="vm.promise">\n <thead md-head>\n <tr md-row>\n <th md-column ng-repeat="column in vm.columns">{{column.alias || column.field}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="row in vm.results.rows">\n <td md-cell ng-repeat="(key, value) in row">{{ vm.valueReplacer(key, value) }}</td>\n </tr>\n <tr md-row ng-if="!vm.results.rows.length">\n <td md-cell colspan="{{vm.columns.length}}">\n <div layout="row" layout-align="center center">\n <span translate="ANALYTICS.NO_DATA">NO DATA</span>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'ANALYTICS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'ANALYTICS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'ANALYTICS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.results.count}}" md-on-paginate="vm.getResults" md-page-select></md-table-pagination>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div flex></div>\n <md-button type="submit" ng-click="vm.closeDialog()" class="md-raised" aria-label="CLOSE" translate="ANALYTICS.CLOSE" translate-attr-aria-label="ANALYTICS.CLOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/create/dialog.html",'<md-dialog class="odbc-dialog" aria-label="New Odbc">\n <form name="odbcForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.odbc.name" ng-required="true" autofocus>\n\n <div ng-messages="odbcForm[\'name\'].$error" ng-show="odbcForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DSN">DSN</label>\n <input type="text" name="dsn" ng-model="vm.odbc.dsn" ng-required="true">\n\n <div class="hint"><span translate="CALLYSQUARE.HELP.DSN"></span></div>\n <div ng-messages="odbcForm[\'dsn\'].$error" ng-show="odbcForm[\'dsn\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DSN_REQUIRED">DSN field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.odbc.description">\n\n <div ng-messages="odbcForm[\'description\'].$error" ng-show="odbcForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOdbc" ng-click="vm.saveOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid || odbcForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOdbc" ng-click="vm.addNewOdbc()" class="send-button md-accent md-raised" ng-disabled="odbcForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_ODBC" translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n ADD ODBC\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOdbc" ng-click="vm.deleteOdbc($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/odbcs/odbcs.html",'<div id="odbcs" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.ODBC">ODBC</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedODBC.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedODBC =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-odbcs-count">\n <span>{{vm.selectedODBC.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ODBC.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllODBC()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectODBC()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedODBC" csv-label="true" filename="odbcs.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedODBC($event)" aria-label="delete selected" translate translate-attr-label="ODBC.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ODBC TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedODBC" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getODBC">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="dsn">{{ \'CALLYSQUARE.DSN\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.odbcs.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="odbc" md-select-id="id" ng-repeat="odbc in vm.odbcs.rows">\n <td md-cell ng-if="odbc.userpic"><img class="avatar" alt="{{odbc.name}}" ng-src="api/users/{{odbc.id}}/avatar" /></td>\n <td md-cell ng-if="!odbc.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{odbc.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="id ">{{odbc.id}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="name ">{{odbc.name}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="dsn ">{{odbc.dsn}}</td>\n <td ng-click="vm.createOrEditOdbc($event, odbc)" md-cell class="description ">{{odbc.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(odbc, $event)" translate="CALLYSQUARE.EDIT_ODBC">\n Edit Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestOdbc(odbc, $event)" translate="CALLYSQUARE.TEST_ODBC">\n Test Odbc\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(odbc, $event)" translate="CALLYSQUARE.DELETE_ODBC">\n Delete Odbc\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.odbcs.count}}" md-on-paginate="vm.getODBC" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ODBC TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ODBC BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-odbc-button" ng-click="vm.createOrEditOdbc($event)" aria-label="add odbc" translate translate-attr-aria-label="CALLYSQUARE.ADD_ODBC">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ODBC BUTTON --\x3e\n</div>'),e.put("app/main/apps/callysquare/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{vm.title | translate}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-disabled="!vm.newProject">\n <div ng-messages="projectForm.name.$error" ng-show="projectForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description">\n <div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.openFromEditor" class="md-block">\n \x3c!-- Added to check if I\'m opening the dialog directly from the square editor --\x3e\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="ADD" translate="CALLYSQUARE.ADD_PROJECT" translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/dialog/dialog.html",'<md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">\n <form name="dialogForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT"></span> <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block" ng-repeat="attribute in vm.attributes" ng-switch="attribute.name">\n <label translate="CALLYSQUARE.{{attribute.name | uppercase}}">{{attribute.name | ucfirst }}</label>\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type" ng-required="attribute.required">\n <md-option ng-if="attribute.defaultValue" ng-value="\'\'"> - None - </md-option>\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START SELECT INPUT --\x3e\n <md-select name="{{attribute.name}}" ng-model="attribute.value" ng-disabled="!vm.crudPermissions.canEdit" ng-switch-when-separator="|" ng-switch-when="sip_id" ng-required="attribute.required">\n <md-optgroup label="{{\'CALLYSQUARE.AGENTS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'agent\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.TELEPHONES\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'telephone\'" ng-disabled="v.canSelect === false">{{v.option}}</md-option>\n </md-optgroup>\n <md-optgroup label="{{\'CALLYSQUARE.USERS\' | translate}}">\n <md-option value="{{v.value}}" ng-repeat="v in vm.values[attribute.name]" ng-if="v.group === \'admin\' || v.group === \'user\'">{{v.option}}</md-option>\n </md-optgroup>\n <md-option ng-if="!vm.values[attribute.name].length" value="-1">No {{attribute.name}} available!</md-option>\n </md-select>\n \x3c!-- END SELECT INPUT --\x3e\n\n \x3c!-- START NUMBER INPUT --\x3e\n <div ng-switch-when="timeout">\n <div ng-switch="vm.cellName">\n <input ng-switch-when-separator="|" ng-switch-when="answer|ext_dial|dial|queue" type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="record|ispeechasr|googleasr" type="number" step="any" name="{{attribute.name}}" min="-1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-default type="number" step="any" name="{{attribute.name}}" min="0" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n </div>\n </div>\n <input ng-switch-when-separator="|" ng-switch-when="speed" type="number" step="any" name="{{attribute.name}}" min="-10" max="-10" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="maxdigit|mindigit|digit" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n <input ng-switch-when-separator="|" ng-switch-when="retry|response|hiddendigitsnum|priority" type="number" step="any" name="{{attribute.name}}" min="1" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit" string-to-number>\n \x3c!-- END NUMBER INPUT --\x3e\n\n \x3c!-- START TEXTAREA INPUT --\x3e\n <textarea name="{{attribute.name}}" ng-model="attribute.value" ng-switch-when-separator="|" ng-switch-when="query|sms_text|condition|text|custom_action_data" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n \x3c!-- END TEXTAREA INPUT --\x3e\n\n \x3c!-- START URL INPUT --\x3e\n <input ng-switch-when-separator="|" ng-switch-when="ndauth_url|ndassistant_url" type="url" name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required">\n \x3c!-- END URL INPUT --\x3e\n\n \x3c!-- START TEXT INPUT --\x3e\n <input ng-switch-default name="{{attribute.name}}" ng-model="attribute.value" ng-required="attribute.required" ng-disabled="!vm.crudPermissions.canEdit">\n \x3c!-- END TEXT INPUT--\x3e\n\n <div class="hint" ng-if="attribute.help">\n <span translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"></span>\n </div>\n <div ng-messages="dialogForm[attribute.name].$error" ng-show="dialogForm[attribute.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED">The field is required</span>\n </div>\n </div>\n </md-input-container>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="vm.crudPermissions.canEdit">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="dialogForm.$invalid || dialogForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/edit/edit.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="editForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.EDIT_XML"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label>XML</label>\n <textarea name="preproduction" ng-model="vm.project.preproduction"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="editForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/import/import.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.IMPORT_XML"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="xml-uploader" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-file-added="vm.fileAdded($file)" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="CALLYSQUARE.DROP_TO_UPLOAD_MESSAGE">You can also drop files here to upload. Only XML - Max. 5MB</span>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" ng-disabled="importForm.$invalid" aria-label="CLOSE" translate="CALLYSQUARE.CLOSE" translate-attr-aria-label="CALLYSQUARE.CLOSE">\n CLOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/info/info.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="descriptionFrom" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.UPDATE_INFO"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.DESCRIPTION">Description</label>\n <input name="description" ng-model="vm.project.description" md-autofocus>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NOTES">Description</label>\n <textarea name="notes" ng-model="vm.project.notes"></textarea>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="descriptionFrom.$invalid" aria-label="SAVE" translate="CALLYSQUARE.UPDATE_INFO" translate-attr-aria-label="CALLYSQUARE.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/open/open.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="openForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.OPEN_PROJECT"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.PROJECT">Project</label>\n <md-select name="id" ng-model="vm.id" required>\n <md-option value="{{p.id}}" ng-repeat="p in vm.projects">{{p.name}}</md-option>\n </md-select>\n <div ng-messages="openForm.id.$error" ng-show="openForm.id.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.PROJECT_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.closeDialog(true)" class="send-button md-accent md-raised" ng-disabled="openForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.OPEN_PROJECT" translate-attr-aria-label="CALLYSQUARE.OPEN">\n OPEN\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/permissionadd/permissionadd.html",'<md-dialog class="projects-dialog" aria-label="projects">\n <form name="projectsForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CALLYSQUARE.PERMISSIONADD_PROJECTS">Add User Permissions</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/saveAs/saveAs.html",'<md-dialog class="project-dialog" aria-label="New dialog">\n <form name="newForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title"><span translate="CALLYSQUARE.COPY_PROJECT"></span></span></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.NAME">Name</label>\n <input name="name" ng-model="vm.project.name" required md-autofocus>\n <div ng-messages="newForm.name.$error" ng-show="newForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.newWindow" aria-label="{{\'CALLYSQUARE.OPEN_NEW_WINDOW\' | translate }}"><span translate="CALLYSQUARE.OPEN_NEW_WINDOW"></span></md-switch>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.save()" class="send-button md-accent md-raised" ng-disabled="newForm.$invalid" aria-label="SAVE" translate="CALLYSQUARE.COPY_PROJECT" translate-attr-aria-label="CALLYSQUARE.COPY">\n COPY\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/projects/edit/view.html",'<div id="callysquare-project" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="CALLYSQUARE.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/cprojects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}} {{vm.project.name}}\n </div>\n <div class="subtitle secondary-text text-truncate">\n <span ng-if="vm.project.description">{{vm.project.description}} - </span><span translate="CALLYSQUARE.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-if="vm.crudPermissions.canEdit" ng-click="vm.updateInfo($event)" class="md-fab md-yellow-700-bg md-icon-button" aria-label="edit">\n <md-icon md-font-icon="icon-tooltip-edit"></md-icon>\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content class="callysquare-content">\n\n <div id="geEditor" class="geEditor"></div>\n\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-vector-square" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CALLYSQUARE.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="CALLYSQUARE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CALLYSQUARE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CALLYSQUARE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CALLYSQUARE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="notes">{{ \'CALLYSQUARE.NOTES\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="notes ">{{project.notes}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, ev)" translate="CALLYSQUARE.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(project, ev)" translate="CALLYSQUARE.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button class="md-fab md-accent md-icon-button" id="add-project-button" ng-if="vm.crudPermissions.canEdit" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="CALLYSQUARE.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n\n</div>'),e.put("app/main/apps/callysquare/views/squareRecordings/create/dialog.html",'<md-dialog class="squareRecording-dialog" aria-label="New SquareRecording">\n <form name="squareRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CALLYSQUARE.FILENAME">Filename</label>\n <input type="" name="filename" ng-model="vm.squareRecording.filename" ng-required="true" autofocus>\n\n <div ng-messages="squareRecordingForm[\'filename\'].$error" ng-show="squareRecordingForm[\'filename\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CALLYSQUARE.ERRORS.FILENAME_REQUIRED">Filename field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSquareRecording" ng-click="vm.saveSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid || squareRecordingForm.$pristine" aria-label="SAVE" translate="CALLYSQUARE.SAVE" translate-attr-aria-label="CALLYSQUARE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSquareRecording" ng-click="vm.addNewSquareRecording()" class="send-button md-accent md-raised" ng-disabled="squareRecordingForm.$invalid" aria-label="ADD" translate="CALLYSQUARE.ADD_SQUARERECORDING" translate-attr-aria-label="CALLYSQUARE.ADD_SQUARERECORDING">\n ADD SQUARERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSquareRecording" ng-click="vm.deleteSquareRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="CALLYSQUARE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CALLYSQUARE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/callysquare/views/squareRecordings/squareRecordings.html",'<div id="squareRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-sitemap" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CALLYSQUARE.SQUARERECORDINGS">SquareRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CALLYSQUARE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSquareRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSquareRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CALLYSQUARE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-squareRecordings-count">\n <span>{{vm.selectedSquareRecordings.length}}</span>\n <span translate="CALLYSQUARE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SQUARERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSquareRecordings()" translate="CALLYSQUARE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSquareRecordings()" translate="CALLYSQUARE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSquareRecordings" csv-label="true" filename="squareRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSquareRecordings($event)" aria-label="delete selected" translate translate-attr-label="SQUARERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SQUARERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSquareRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSquareRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="filename">{{ \'CALLYSQUARE.FILENAME\' | translate }}</th>\n <th md-column md-order-by="projectName">{{ \'CALLYSQUARE.PROJECT\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'CALLYSQUARE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'CALLYSQUARE.PHONE\' | translate }}</th>\n <th md-column md-order-by="extension">{{ \'CALLYSQUARE.EXTEN\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'CALLYSQUARE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CALLYSQUARE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.squareRecordings.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="CALLYSQUARE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="squareRecording" md-select-id="id" ng-repeat="squareRecording in vm.squareRecordings.rows">\n <td md-cell ng-if="squareRecording.userpic"><img class="avatar" alt="{{squareRecording.name}}" ng-src="api/users/{{squareRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!squareRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{squareRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="filename ">{{squareRecording.filename}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="projectName ">{{squareRecording.projectName}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="uniqueid ">{{squareRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="callerid ">{{squareRecording.callerid}}</td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="extension ">{{squareRecording.extension}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="squareRecording.id" model="\'squareRecording\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSquareRecording($event, squareRecording)" md-cell class="createdAt ">{{squareRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CALLYSQUARE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(squareRecording, $event)" translate="CALLYSQUARE.DOWNLOAD_SQUARERECORDING">\n Download SquareRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(squareRecording, $event)" translate="CALLYSQUARE.DELETE_SQUARERECORDING">\n Delete SquareRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CALLYSQUARE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CALLYSQUARE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CALLYSQUARE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.squareRecordings.count}}" md-on-paginate="vm.getSquareRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SQUARERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/chatQueues.html",'<div id="chatQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATQUEUES">ChatQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatQueues-count">\n <span>{{vm.selectedChatQueues.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatQueues()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatQueues()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatQueues" csv-label="true" filename="chatQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatQueues($event)" aria-label="delete selected" translate translate-attr-label="CHATQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHATQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'CHAT.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatQueue" md-select-id="id" ng-repeat="chatQueue in vm.chatQueues.rows">\n <td md-cell ng-if="chatQueue.userpic"><img class="avatar" alt="{{chatQueue.name}}" ng-src="api/users/{{chatQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!chatQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="id ">{{chatQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="name ">{{chatQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatQueue, ev) : vm.createOrEditChatQueue($event, chatQueue)" md-cell class="strategy ">{{ vm.arraystrategy[chatQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(chatQueue, $event)" translate="CHAT.EDIT_CHATQUEUE">\n Edit ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(chatQueue, $event)" translate="CHAT.TEAMADD_CHATQUEUE">\n teamadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatQueue, $event)" translate="CHAT.AGENTADD_CHATQUEUE">\n agentadd ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chatQueue, $event)" translate="CHAT.DELETE_CHATQUEUE">\n Delete ChatQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(chatQueue, $event)" translate="CHAT.GOTOREALTIME_CHATQUEUE">\n goToRealtime ChatQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatQueues.count}}" md-on-paginate="vm.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatQueue-button" ng-click="vm.createOrEditChatQueue($event)" aria-label="add chatQueue" translate translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatQueues/create/dialog.html",'<md-dialog class="chatQueue-dialog" aria-label="New ChatQueue">\n <form name="chatQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newChatQueue">\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="chatQueueForm[\'name\'].$error" ng-show="chatQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="chatQueueForm[\'strategy\'].$error" ng-show="chatQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="chatQueueForm[\'timeout\'].$error" ng-show="chatQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description">\n\n <div ng-messages="chatQueueForm[\'description\'].$error" ng-show="chatQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatQueue" ng-click="vm.saveChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid || chatQueueForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatQueue" ng-click="vm.addNewChatQueue()" class="send-button md-accent md-raised" ng-disabled="chatQueueForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATQUEUE" translate-attr-aria-label="CHAT.ADD_CHATQUEUE">\n ADD CHATQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatQueue" ng-click="vm.deleteChatQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/agentadd/agentadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATQUEUE">Add Agent to chatQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/teamadd/teamadd.html",'<md-dialog class="chatQueue-dialog" aria-label="chatQueue" ng-init="vm.onInit()">\n <form name="chatQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatQueues/edit/view.html",'<div id="chat-chatQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatQueues-button md-icon-button" aria-label="Go to chatQueues" ng-click="vm.gotoChatQueues()" translate translate-attr-aria-label="CHAT.GO_TO_CHATQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatQueue-image" hide-xs>\n <img ng-src="assets/images/business/chatQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatQueue.id}}\n <span ng-if="vm.chatQueue.name">{{vm.chatQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.chatQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="CHAT.TEAMADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="CHAT.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="CHAT.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.chatQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/chatWebsites.html",'<div id="chatWebsites" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-hangouts" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CHAT.CHATWEBSITES">ChatWebsites</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CHAT.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChatWebsites.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChatWebsites =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CHAT.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chatWebsites-count">\n <span>{{vm.selectedChatWebsites.length}}</span>\n <span translate="CHAT.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHATWEBSITES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChatWebsites()" translate="CHAT.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChatWebsites()" translate="CHAT.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChatWebsites" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChatWebsites($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHATWEBSITE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChatWebsites" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatWebsites">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="address">{{ \'CHAT.MOTIONADDRESS\' | translate }}</th>\n <th md-column md-order-by="remote">{{ \'CHAT.MOTIONPROXY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatWebsites.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chatWebsite" md-select-id="id" ng-repeat="chatWebsite in vm.chatWebsites.rows">\n <td md-cell ng-if="chatWebsite.userpic"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="api/users/{{chatWebsite.id}}/avatar" /></td>\n <td md-cell ng-if="!chatWebsite.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chatWebsite.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="id ">{{chatWebsite.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="name ">{{chatWebsite.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="key ">{{chatWebsite.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="address ">{{chatWebsite.address}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="remote ">{{chatWebsite.remote}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)" md-cell class="description ">{{chatWebsite.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(chatWebsite, $event)" translate="CHAT.EDIT_CHATWEBSITE">\n Edit ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(chatWebsite, $event)" translate="CHAT.INTERACTIONS_CHATWEBSITE">\n Interactions ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.offlinemessagesgoto(chatWebsite, $event)" translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE">\n OfflineMessages ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(chatWebsite, $event)" translate="CHAT.AGENTADD_CHATWEBSITE">\n AgentAdd ChatWebsite\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chatWebsite, $event)" translate="CHAT.DELETE_CHATWEBSITE">\n Delete ChatWebsite\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatWebsites.count}}" md-on-paginate="vm.getChatWebsites" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHATWEBSITE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHATWEBSITE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chatWebsite-button" ng-click="vm.createOrEditChatWebsite($event)" aria-label="add chatWebsite" translate translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHATWEBSITE BUTTON --\x3e\n</div>'),e.put("app/main/apps/chat/views/chatWebsites/create/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus ng-disabled="!vm.newChatWebsite">\n\n <div ng-messages="chatWebsiteForm[\'name\'].$error" ng-show="chatWebsiteForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'key\'].$error" ng-show="chatWebsiteForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true">\n\n <div ng-messages="chatWebsiteForm[\'address\'].$error" ng-show="chatWebsiteForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.chatWebsite.remote" md-maxlength="255" ng-required="true">\n\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="chatWebsiteForm[\'remote\'].$error" ng-show="chatWebsiteForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="chatWebsiteForm[\'ListId\'].$error" ng-show="chatWebsiteForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteForm[\'IntervalId\'].$error" ng-show="chatWebsiteForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description">\n\n <div ng-messages="chatWebsiteForm[\'description\'].$error" ng-show="chatWebsiteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatWebsite" ng-click="vm.saveChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid || chatWebsiteForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatWebsite" ng-click="vm.addNewChatWebsite()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATWEBSITE" translate-attr-aria-label="CHAT.ADD_CHATWEBSITE">\n ADD CHATWEBSITE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatWebsite" ng-click="vm.deleteChatWebsite($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/agentadd/agentadd.html",'<md-dialog class="chatWebsite-dialog" aria-label="chatWebsite" ng-init="vm.onInit()">\n <form name="chatWebsiteForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CHAT.AGENTADD_CHATWEBSITE">Add Agent to chatWebsite</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/agent/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'agent\'].$error" ng-show="chatWebsiteFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/amazonlex/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.ACCESSKEYID">accesskeyid</label>\n <input type="text" name="accesskeyid" ng-model="vm.amazonlex.accesskeyid" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'accesskeyid\'].$error" ng-show="chatWebsiteFormApp[\'accesskeyid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.ACCESSKEYID_REQUIRED">accesskeyid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SECRETACCESSKEY">secretaccesskey</label>\n <input type="text" name="secretaccesskey" ng-model="vm.amazonlex.secretaccesskey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'secretaccesskey\'].$error" ng-show="chatWebsiteFormApp[\'secretaccesskey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SECRETACCESSKEY_REQUIRED">secretaccesskey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LEXREGION">lexregion</label>\n <md-select name="lexregion" ng-model="vm.amazonlex.lexregion" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'us-east-1\'">US East (N. Virginia)</md-option>\n <md-option ng-value="\'us-west-2\'">US West (Oregon)</md-option>\n <md-option ng-value="\'eu-west-1\'">EU (Ireland)</md-option>\n <md-option ng-value="\'ap-southeast-2\'">Asia Pacific (Sydney)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'lexregion\'].$error" ng-show="chatWebsiteFormApp[\'lexregion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LEXREGION_REQUIRED">lexregion field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.BOTNAME">botname</label>\n <input type="text" name="botname" ng-model="vm.amazonlex.botname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'botname\'].$error" ng-show="chatWebsiteFormApp[\'botname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.BOTNAME_REQUIRED">botname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.amazonlex.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/autoreply/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'times\'].$error" ng-show="chatWebsiteFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="chatWebsiteFormApp[\'text\'].$error" ng-show="chatWebsiteFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/close/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'disposition\'].$error" ng-show="chatWebsiteFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/dialogflow/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.dialogflow.key" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'key\'].$error" ng-show="chatWebsiteFormApp[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LANGUAGE">language</label>\n <md-select name="language" ng-model="vm.dialogflow.language" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'da\'">Danish</md-option>\n <md-option ng-value="\'en\'">English</md-option>\n <md-option ng-value="\'de\'">German</md-option>\n <md-option ng-value="\'it\'">Italian</md-option>\n <md-option ng-value="\'es\'">Spanish</md-option>\n <md-option ng-value="\'fr\'">French</md-option>\n <md-option ng-value="\'id\'">Indonesian</md-option>\n <md-option ng-value="\'ja\'">Japanese</md-option>\n <md-option ng-value="\'ko\'">Korean (South Korea)</md-option>\n <md-option ng-value="\'nl\'">Dutch</md-option>\n <md-option ng-value="\'no\'">Norwegian</md-option>\n <md-option ng-value="\'pt\'">Portuguese (European)</md-option>\n <md-option ng-value="\'pt-br\'">Portuguese (Nrazilian)</md-option>\n <md-option ng-value="\'ru\'">Russian</md-option>\n <md-option ng-value="\'sv\'">Swedish</md-option>\n <md-option ng-value="\'th\'">Thai</md-option>\n <md-option ng-value="\'uk\'">Ukrainian</md-option>\n <md-option ng-value="\'zh-CN\'">Chinese (Simplified)</md-option>\n <md-option ng-value="\'zh-HK\'">Chinese (Hong Kong)</md-option>\n <md-option ng-value="\'zh-TW\'">Chinese (Traditional)</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'language\'].$error" ng-show="chatWebsiteFormApp[\'language\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LANGUAGE_REQUIRED">language field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WELCOMEMESSAGE">welcomemessage</label>\n <textarea name="welcomemessage" ng-model="vm.dialogflow.welcomemessage" md-maxlength="255"></textarea>\n <div class="hint"><span translate="CHAT.HELP.WELCOMEMESSAGE"></span></div>\n\n <div ng-messages="chatWebsiteFormApp[\'welcomemessage\'].$error" ng-show="chatWebsiteFormApp[\'welcomemessage\'].$touched" role="alert">\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WELCOMEMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>welcomemessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotoif/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'condition\'].$error" ng-show="chatWebsiteFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'truepriority\'].$error" ng-show="chatWebsiteFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'falsepriority\'].$error" ng-show="chatWebsiteFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/gotop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'priority\'].$error" ng-show="chatWebsiteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/noop/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'value\'].$error" ng-show="chatWebsiteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/queue/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'queue\'].$error" ng-show="chatWebsiteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'timeout\'].$error" ng-show="chatWebsiteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/system/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="chatWebsiteFormApp[\'command\'].$error" ng-show="chatWebsiteFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'variable\'].$error" ng-show="chatWebsiteFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/apps/tag/dialog.html",'<md-dialog class="chatWebsite-dialog" aria-label="New ChatWebsite">\n <form name="chatWebsiteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="chatWebsiteFormApp[\'tag\'].$error" ng-show="chatWebsiteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveChatWebsiteApp()" class="send-button md-accent md-raised" ng-disabled="chatWebsiteFormApp.$invalid || chatWebsiteFormApp.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatCannedAnswers/dialog.html",'<md-dialog class="chatCannedAnswer-dialog" aria-label="New ChatCannedAnswer">\n <form name="chatCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">Key</label>\n <input type="" name="key" ng-model="vm.chatCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatCannedAnswerForm[\'key\'].$error" ng-show="chatCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.VALUE">Value</label>\n <textarea name="value" ng-model="vm.chatCannedAnswer.value" required></textarea>\n\n <div ng-messages="chatCannedAnswerForm[\'value\'].$error" ng-show="chatCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatCannedAnswer.description">\n\n <div ng-messages="chatCannedAnswerForm[\'description\'].$error" ng-show="chatCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatCannedAnswer" ng-click="vm.saveChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid || chatCannedAnswerForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatCannedAnswer" ng-click="vm.addNewChatCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="chatCannedAnswerForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATCANNEDANSWER" translate-attr-aria-label="CHAT.ADD_CHATCANNEDANSWER">\n ADD CHATCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatCannedAnswer" ng-click="vm.deleteChatCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/chatDispositions/dialog.html",'<md-dialog class="chatDisposition-dialog" aria-label="New ChatDisposition">\n <form name="chatDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatDisposition.name" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="chatDispositionForm[\'name\'].$error" ng-show="chatDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatDisposition" ng-click="vm.saveChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid || chatDispositionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatDisposition" ng-click="vm.addNewChatDisposition()" class="send-button md-accent md-raised" ng-disabled="chatDispositionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATDISPOSITION" translate-attr-aria-label="CHAT.ADD_CHATDISPOSITION">\n ADD CHATDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatDisposition" ng-click="vm.deleteChatDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/offlineMessages/dialog.html",'<md-dialog class="offlineMessage-dialog" aria-label="New OfflineMessage">\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-content flex layout-padding>\n <pre>{{vm.message.body}}</pre>\n </md-content>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/proactive/dialog.html",'<md-dialog class="chatProactiveAction-dialog" aria-label="New ChatProactiveAction">\n <form name="chatProactiveActionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="" name="name" ng-model="vm.chatProactiveAction.name" ng-required="true" autofocus>\n\n <div ng-messages="chatProactiveActionForm[\'name\'].$error" ng-show="chatProactiveActionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TYPE">Type</label>\n <md-select name="type" ng-model="vm.chatProactiveAction.type">\n\n <md-option ng-value="\'mouseOver\'"> {{ \'CHAT.MOUSEOVER\' | translate }} </md-option>\n\n <md-option ng-value="\'timeout\'"> {{ \'CHAT.TIMEOUT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="chatProactiveActionForm[\'type\'].$error" ng-show="chatProactiveActionForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'mouseOver\'" class="md-block">\n <label translate="CHAT.SELECTOR">Selector</label>\n <input type="" name="selector" ng-model="vm.chatProactiveAction.selector" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'selector\'].$error" ng-show="chatProactiveActionForm[\'selector\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SELECTOR_REQUIRED">Selector field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatProactiveAction.type === \'timeout\'" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatProactiveAction.timeout" min="1" ng-required="true">\n\n <div ng-messages="chatProactiveActionForm[\'timeout\'].$error" ng-show="chatProactiveActionForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newChatProactiveAction" ng-click="vm.saveChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid || chatProactiveActionForm.$pristine" aria-label="SAVE" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newChatProactiveAction" ng-click="vm.addNewChatProactiveAction()" class="send-button md-accent md-raised" ng-disabled="chatProactiveActionForm.$invalid" aria-label="ADD" translate="CHAT.ADD_CHATPROACTIVEACTION" translate-attr-aria-label="CHAT.ADD_CHATPROACTIVEACTION">\n ADD CHATPROACTIVEACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newChatProactiveAction" ng-click="vm.deleteChatProactiveAction($event)" aria-label="DELETE" translate translate-attr-aria-label="CHAT.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CHAT.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/chat/views/chatWebsites/edit/view.html",'<div id="chat-chatWebsite" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-chatWebsites-button md-icon-button" aria-label="Go to chatWebsites" ng-click="vm.gotoChatWebsites()" translate translate-attr-aria-label="CHAT.GO_TO_CHATWEBSITES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="chatWebsite-image" hide-xs>\n <img ng-src="assets/images/business/chatWebsites.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.chatWebsite.id}}\n <span ng-if="vm.chatWebsite.name">{{vm.chatWebsite.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CHAT.CREATED_AT"></span> <span>{{vm.chatWebsite.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.chatWebsite, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CHAT.AGENTADD_CHATWEBSITE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveChatWebsite()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (scriptForm.$invalid) || (intervalForm.$invalid) || (dispositionForm.$invalid) || (appearanceForm.$invalid) || (onlinestatusForm.$invalid) || (offlinestatusForm.$invalid) || (closingformForm.$invalid) || (unmanagedstatusForm.$invalid) || (interactionForm.$invalid) || (whitelabelForm.$invalid) || (logoForm.$invalid) || (agentAvatarForm.$invalid) || (customerAvatarForm.$invalid) || (systemAvatarForm.$invalid) || (chatFormOnlineForm.$invalid) || (chatFormOfflineForm.$invalid) || (proactiveForm.$invalid) || (chatDispositionsForm.$invalid) || (chatCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid) || (offlineMessagesForm.$invalid)" translate="CHAT.SAVE" translate-attr-aria-label="CHAT.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chatWebsite.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.KEY">key</label>\n <input type="text" name="key" ng-model="vm.chatWebsite.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONADDRESS">MotionAddress</label>\n <input type="url" name="address" ng-model="vm.chatWebsite.address" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'address\'].$error" ng-show="generalForm[\'address\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_REQUIRED">MotionAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MUST_VALID_URL">MotionAddress must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.MOTIONADDRESS_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionAddress must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.LIST">List</label>\n <md-select name="ListId" ng-model="vm.chatWebsite.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.fidelity" class="md-block">\n <label translate="CHAT.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.chatWebsite.timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.chatWebsite.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chatWebsite.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="CHAT.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.chatWebsite.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.queueTransfer == true" class="md-block">\n <label translate="CHAT.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.chatWebsite.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentTransfer == true" class="md-block">\n <label translate="CHAT.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.chatWebsite.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container script md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteScriptController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite)" class="content" md-background-bg>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SCRIPT">SCRIPT</div>\n </div>\n\n <form name="scriptForm" flex="100" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm_ac.chatWebsite.token" autofocus ng-disabled="true">\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm_ac.chatWebsite.remote" required>\n <div class="hint"><span translate="CHAT.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="scriptForm[\'remote\'].$error" ng-show="scriptForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MOTIONPROXY_REQUIRED">Motion Proxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="CHAT.ERRORS.MOTIONPROXY_MUST_VALID_URL">Motion Proxy must be a valid url e.g.: http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.WEBSITESCRIPT">WebsiteScript</label>\n <div>\n <pre style="font-size: 13px;">\n {{vm_ac.start}} {{vm_ac.script}} {{vm_ac.end}}\n </pre>\n </div>\n <div class="hint"><span translate="CHAT.HELP.COPYSCRIPTTOCLIPBOARD"></span></div>\n </md-input-container>\n </form>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container interval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERVAL">INTERVAL</div>\n </div>\n <form name="intervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.chatWebsite.IntervalId" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Always</md-option>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="intervalForm[\'IntervalId\'].$error" ng-show="intervalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.TIMEZONE">Timezone</label>\n <ms-timezone name="timezone" ng-model="vm.chatWebsite.timezone" ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="CHAT.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="intervalForm[\'timezone\'].$error" ng-show="intervalForm[timezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.mandatoryDisposition" class="md-block">\n <label translate="CHAT.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.chatWebsite.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.SNIPPET">SNIPPET</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container appearance md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.APPEARANCE">APPEARANCE</div>\n </div>\n <form name="appearanceForm" novalidate>\n <div flex md-color-picker ng-model="vm.chatWebsite.color" label="{{\'CHAT.MAINCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.color_button" label="{{\'CHAT.BUTTONCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.textColor" label="{{\'CHAT.TEXTCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.chatWebsite.backgroundColor" label="{{\'CHAT.BACKGROUNDCOLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="CHAT.FONTSIZE">fontSize</label>\n <input type="number" name="fontSize" ng-model="vm.chatWebsite.fontSize" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'fontSize\'].$error" ng-show="appearanceForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FONTSIZE_REQUIRED">fontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">fontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADERSHAPE">headershape</label>\n <md-select name="header_shape" ng-model="vm.chatWebsite.header_shape" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'rounded\'"> {{ \'CHAT.ROUNDED\' | translate }} </md-option>\n\n <md-option ng-value="\'squared\'"> {{ \'CHAT.SQUARED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'header_shape\'].$error" ng-show="appearanceForm[\'header_shape\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADERSHAPE_REQUIRED">headershape field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showAgentAvatar" aria-label="ShowAgentAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWAGENTAVATAR">ShowAgentAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.showCustomerAvatar" aria-label="showCustomerAvatar" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.SHOWCUSTOMERAVATAR">showCustomerAvatar</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SNIPPETSWIPEOUT">snippetSwipeOut</label>\n <md-select name="alignment" ng-model="vm.chatWebsite.alignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'bottom_right\'"> {{ \'CHAT.BOTTOM_RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'right\'"> {{ \'CHAT.RIGHT\' | translate }} </md-option>\n\n <md-option ng-value="\'left\'"> {{ \'CHAT.LEFT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'alignment\'].$error" ng-show="appearanceForm[\'alignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SNIPPETSWIPEOUT_REQUIRED">snippetSwipeOut field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.alignment !== \'bottom_right\'" class="md-block">\n <label translate="CHAT.VERTICALPOSITION">verticalPosition</label>\n <input type="number" name="verticalAlignment" ng-model="vm.chatWebsite.verticalAlignment" min="0" max="100" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.VERTICALPOSITION"></span></div>\n <div ng-messages="appearanceForm[\'verticalAlignment\'].$error" ng-show="appearanceForm[\'verticalAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_REQUIRED">verticalPosition field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO">verticalPosition must be a valid greater or equal than</span> <span>100</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.chatWebsite.messagesAlignment" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'alternate\'"> {{ \'CHAT.ALTERNATE\' | translate }} </md-option>\n\n <md-option ng-value="\'centered\'"> {{ \'CHAT.CENTERED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="appearanceForm[\'messagesAlignment\'].$error" ng-show="appearanceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.DEFAULTTITLE">defaultTitle</label>\n <input type="text" name="defaultTitle" ng-model="vm.chatWebsite.defaultTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="appearanceForm[\'defaultTitle\'].$error" ng-show="appearanceForm[\'defaultTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_REQUIRED">defaultTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.DEFAULTTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>defaultTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container onlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.ONLINESTATUS">ONLINESTATUS</div>\n </div>\n <form name="onlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_ONLINE">header_online</label>\n <input type="text" name="header_online" ng-model="vm.chatWebsite.header_online" md-maxlength="255" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'header_online\'].$error" ng-show="onlinestatusForm[\'header_online\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_REQUIRED">header_online field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_ONLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_online must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.START_CHAT_BUTTON">start_chat_button</label>\n <input type="text" name="start_chat_button" ng-model="vm.chatWebsite.start_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="onlinestatusForm[\'start_chat_button\'].$error" ng-show="onlinestatusForm[\'start_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_REQUIRED">start_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.START_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>start_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container offlinestatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.OFFLINESTATUS">OFFLINESTATUS</div>\n </div>\n <form name="offlinestatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.hideWhenOffline" aria-label="hideWhenOffline" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.HIDEWHENOFFLINE">hideWhenOffline</span></md-switch>\n <div class="hint"><span translate="CHAT.HELP.HIDEWHENOFFLINE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.HEADER_OFFLINE">header_offline</label>\n <input type="text" name="header_offline" ng-model="vm.chatWebsite.header_offline" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'header_offline\'].$error" ng-show="offlinestatusForm[\'header_offline\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_REQUIRED">header_offline field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.HEADER_OFFLINE_MAX_LENGTH" translate-values=\'{max: 255}\'>header_offline must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINE_CHAT_BUTTON">offline_chat_button</label>\n <input type="text" name="offline_chat_button" ng-model="vm.chatWebsite.offline_chat_button" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offline_chat_button\'].$error" ng-show="offlinestatusForm[\'offline_chat_button\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_REQUIRED">offline_chat_button field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINE_CHAT_BUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>offline_chat_button must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGESUBJECT">offlineMessageSubject</label>\n <input type="text" name="offlineMessageSubject" ng-model="vm.chatWebsite.offlineMessageSubject" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageSubject\'].$error" ng-show="offlinestatusForm[\'offlineMessageSubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_REQUIRED">offlineMessageSubject field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGESUBJECT_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageSubject must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.OFFLINEMESSAGEBODY">offlineMessageBody</label>\n <input type="text" name="offlineMessageBody" ng-model="vm.chatWebsite.offlineMessageBody" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="offlinestatusForm[\'offlineMessageBody\'].$error" ng-show="offlinestatusForm[\'offlineMessageBody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_REQUIRED">offlineMessageBody field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.OFFLINEMESSAGEBODY_MAX_LENGTH" translate-values=\'{max: 255}\'>offlineMessageBody must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container closingform md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CLOSINGFORM">CLOSINGFORM</div>\n </div>\n <form name="closingformForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGE">closingMessage</label>\n <textarea name="closingMessage" ng-model="vm.chatWebsite.closingMessage" md-maxlength="255" required autofocus></textarea>\n\n <div ng-messages="closingformForm[\'closingMessage\'].$error" ng-show="closingformForm[\'closingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_REQUIRED">closingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPMESSAGEBUTTON">skipMessageButton</label>\n <input type="text" name="skipMessageButton" ng-model="vm.chatWebsite.skipMessageButton" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'skipMessageButton\'].$error" ng-show="closingformForm[\'skipMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_REQUIRED">skipMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>skipMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableRating" aria-label="enableRating" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLERATING">enableRating</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating" class="md-block">\n <label translate="CHAT.RATINGTYPE">ratingType</label>\n <md-select name="ratingType" ng-model="vm.chatWebsite.ratingType" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'star\'">Star</md-option>\n <md-option ng-value="\'thumb\'">Thumb</md-option>\n </md-select>\n <div ng-messages="closingformForm[\'ratingType\'].$error" ng-show="closingformForm[\'ratingType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGTYPE_REQUIRED">ratingType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableRating && vm.chatWebsite.ratingType === \'star\'" class="md-block">\n <label translate="CHAT.RATINGSTARSNUMBER">ratingStarsNumber</label>\n <input type="number" name="ratingStarsNumber" ng-model="vm.chatWebsite.ratingStarsNumber" min="2" max="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'ratingStarsNumber\'].$error" ng-show="closingformForm[\'ratingStarsNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_REQUIRED">ratingStarsNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>2</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">ratingStarsNumber must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableFeedback" aria-label="enableFeedback" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEFEEDBACK">enableFeedback</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.forwardTranscript" aria-label="forwardTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.FORWARDTRANSCRIPT">forwardTranscript</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.forwardTranscript" class="md-block">\n <label translate="CHAT.FORWARDTRANSCRIPTMESSAGE">forwardTranscriptMessage</label>\n <input type="text" name="forwardTranscriptMessage" ng-model="vm.chatWebsite.forwardTranscriptMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'forwardTranscriptMessage\'].$error" ng-show="closingformForm[\'forwardTranscriptMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_REQUIRED">forwardTranscriptMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORWARDTRANSCRIPTMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>forwardTranscriptMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGMESSAGEBUTTON">closingMessageButton</label>\n <input type="text" name="closingMessageButton" ng-model="vm.chatWebsite.closingMessageButton" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="closingformForm[\'closingMessageButton\'].$error" ng-show="closingformForm[\'closingMessageButton\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_REQUIRED">closingMessageButton field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGMESSAGEBUTTON_MAX_LENGTH" translate-values=\'{max: 255}\'>closingMessageButton must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container unmanagedstatus md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.UNMANAGEDSTATUS">UNMANAGEDSTATUS</div>\n </div>\n <form name="unmanagedstatusForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.autoclose" aria-label="autoclose" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.AUTOCLOSE">autoclose</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableUnmanagedNote" aria-label="enableUnmanagedNote" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLEUNMANAGEDNOTE">enableUnmanagedNote</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.UNMANAGEDMESSAGE">unmanagedMessage</label>\n <input type="text" name="unmanagedMessage" ng-model="vm.chatWebsite.unmanagedMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'unmanagedMessage\'].$error" ng-show="unmanagedstatusForm[\'unmanagedMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_REQUIRED">unmanagedMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.UNMANAGEDMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>unmanagedMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SKIPUNMANAGED">skipUnmanaged</label>\n <input type="text" name="skipUnmanaged" ng-model="vm.chatWebsite.skipUnmanaged" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'skipUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'skipUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_REQUIRED">skipUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SKIPUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>skipUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.enableUnmanagedNote" class="md-block">\n <label translate="CHAT.SENDUNMANAGED">sendUnmanaged</label>\n <input type="text" name="sendUnmanaged" ng-model="vm.chatWebsite.sendUnmanaged" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="unmanagedstatusForm[\'sendUnmanaged\'].$error" ng-show="unmanagedstatusForm[\'sendUnmanaged\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_REQUIRED">sendUnmanaged field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SENDUNMANAGED_MAX_LENGTH" translate-values=\'{max: 255}\'>sendUnmanaged must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="chatWebsite-detail-form-container interaction md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.INTERACTION">INTERACTION</div>\n </div>\n <form name="interactionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CHAT.AGENTIDENTIFIER">agentIdentifier</label>\n <md-select name="agentIdentifier" ng-model="vm.chatWebsite.agentIdentifier" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'website_alias\'"> {{ \'CHAT.WEBSITEALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_alias\'"> {{ \'CHAT.AGENTALIAS\' | translate }} </md-option>\n\n <md-option ng-value="\'agent_fullname\'"> {{ \'CHAT.AGENTFULLNAME\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="CHAT.HELP.AGENTIDENTIFIER"></span></div>\n <div ng-messages="interactionForm[\'agentIdentifier\'].$error" ng-show="interactionForm[\'agentIdentifier\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.AGENTIDENTIFIER_REQUIRED">agentIdentifier field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CUSTOMERALIAS">customerAlias</label>\n <input type="text" name="customerAlias" ng-model="vm.chatWebsite.customerAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'customerAlias\'].$error" ng-show="interactionForm[\'customerAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_REQUIRED">customerAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CUSTOMERALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>customerAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.MESSAGEFONTSIZE">messageFontSize</label>\n <input type="number" name="messageFontSize" ng-model="vm.chatWebsite.messageFontSize" min="0" max="20" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'messageFontSize\'].$error" ng-show="interactionForm[\'messageFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_REQUIRED">messageFontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="CHAT.ERRORS.MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">messageFontSize must be a valid greater or equal than</span> <span>20</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.chatWebsite.agentIdentifier === \'website_alias\'" class="md-block">\n <label translate="CHAT.WEBSITEALIAS">WebsiteAlias</label>\n <input type="text" name="agentAlias" ng-model="vm.chatWebsite.agentAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="CHAT.HELP.WEBSITEALIAS"></span></div>\n <div ng-messages="interactionForm[\'agentAlias\'].$error" ng-show="interactionForm[\'agentAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_REQUIRED">WebsiteAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WEBSITEALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>WebsiteAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.CLOSINGQUESTION">closingQuestion</label>\n <input type="text" name="closingQuestion" ng-model="vm.chatWebsite.closingQuestion" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'closingQuestion\'].$error" ng-show="interactionForm[\'closingQuestion\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_REQUIRED">closingQuestion field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.CLOSINGQUESTION_MAX_LENGTH" translate-values=\'{max: 255}\'>closingQuestion must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITSUCCESSMESSAGE">formSubmitSuccessMessage</label>\n <input type="text" name="formSubmitSuccessMessage" ng-model="vm.chatWebsite.formSubmitSuccessMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitSuccessMessage\'].$error" ng-show="interactionForm[\'formSubmitSuccessMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_REQUIRED">formSubmitSuccessMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitSuccessMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.FORMSUBMITFAILUREMESSAGE">formSubmitFailureMessage</label>\n <input type="text" name="formSubmitFailureMessage" ng-model="vm.chatWebsite.formSubmitFailureMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'formSubmitFailureMessage\'].$error" ng-show="interactionForm[\'formSubmitFailureMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_REQUIRED">formSubmitFailureMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.FORMSUBMITFAILUREMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>formSubmitFailureMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerWriting" aria-label="enableCustomerWriting" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERWRITING">enableCustomerWriting</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGTITLE">waitingTitle</label>\n <input type="text" name="waitingTitle" ng-model="vm.chatWebsite.waitingTitle" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'waitingTitle\'].$error" ng-show="interactionForm[\'waitingTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGTITLE_REQUIRED">waitingTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGTITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.enableCustomerWriting" class="md-block">\n <label translate="CHAT.WAITINGMESSAGE">waitingMessage</label>\n <textarea name="waitingMessage" ng-model="vm.chatWebsite.waitingMessage" md-maxlength="255" required></textarea>\n\n <div ng-messages="interactionForm[\'waitingMessage\'].$error" ng-show="interactionForm[\'waitingMessage\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_REQUIRED">waitingMessage field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WAITINGMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>waitingMessage must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.NOTETITLE">noteTitle</label>\n <input type="text" name="noteTitle" ng-model="vm.chatWebsite.noteTitle" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'noteTitle\'].$error" ng-show="interactionForm[\'noteTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.NOTETITLE_REQUIRED">noteTitle field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.NOTETITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>noteTitle must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.PLACEHOLDERMESSAGE">placeholderMessage</label>\n <input type="text" name="placeholderMessage" ng-model="vm.chatWebsite.placeholderMessage" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'placeholderMessage\'].$error" ng-show="interactionForm[\'placeholderMessage\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_REQUIRED">placeholderMessage field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.PLACEHOLDERMESSAGE_MAX_LENGTH" translate-values=\'{max: 255}\'>placeholderMessage must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.download_transcript" aria-label="downloadTranscript" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DOWNLOADTRANSCRIPT">downloadTranscript</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerAttachment" aria-label="enableCustomerAttachment" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERATTACHMENT">enableCustomerAttachment</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.enableCustomerCheckmarks" aria-label="enableCustomerCheckmarks" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.ENABLECUSTOMERCHECKMARKS">enableCustomerCheckmarks</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CHAT.SYSTEMALIAS">systemAlias</label>\n <input type="text" name="systemAlias" ng-model="vm.chatWebsite.systemAlias" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="interactionForm[\'systemAlias\'].$error" ng-show="interactionForm[\'systemAlias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_REQUIRED">systemAlias field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.SYSTEMALIAS_MAX_LENGTH" translate-values=\'{max: 255}\'>systemAlias must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container whitelabel md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.WHITELABEL">WHITELABEL</div>\n </div>\n <form name="whitelabelForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chatWebsite.defaultWhiteLabel" aria-label="default" ng-disabled="!vm.crudPermissions.canEdit"><span translate="CHAT.DEFAULT">default</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.chatWebsite.defaultWhiteLabel" class="md-block">\n <label translate="CHAT.WHITELABEL">whiteLabel</label>\n <textarea name="whiteLabel" ng-model="vm.chatWebsite.whiteLabel" md-maxlength="255" required></textarea>\n\n <div ng-messages="whitelabelForm[\'whiteLabel\'].$error" ng-show="whitelabelForm[\'whiteLabel\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="CHAT.ERRORS.WHITELABEL_REQUIRED">whiteLabel field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="CHAT.ERRORS.WHITELABEL_MAX_LENGTH" translate-values=\'{max: 255}\'>whiteLabel must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.license.custom" class="chatWebsite-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.LOGO">LOGO</div>\n </div>\n <div ng-controller="ChatWebsitelogoController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_ca.chatWebsite.images" ng-switch="logoimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container agentavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.AGENTAVATAR">AGENTAVATAR</div>\n </div>\n <div ng-controller="ChatWebsiteagentAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="agentAvatarimage in vm_ca.chatWebsite.images" ng-switch="agentAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{agentAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="agentAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{agentAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container customeravatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.CUSTOMERAVATAR">CUSTOMERAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitecustomerAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="customerAvatarimage in vm_ca.chatWebsite.images" ng-switch="customerAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{customerAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="customerAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{customerAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div class="chatWebsite-detail-form-container systemavatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.SYSTEMAVATAR">SYSTEMAVATAR</div>\n </div>\n <div ng-controller="ChatWebsitesystemAvatarController as vm_ca" ng-init="vm_ca.init(vm.chatWebsite, vm.crudPermissions)" class="chatWebsite-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="chatWebsite-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="systemAvatarimage in vm_ca.chatWebsite.images" ng-switch="systemAvatarimage.type">\n <div class="chatWebsite-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{systemAvatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="systemAvatarimage.file">\n </div>\n\n <div class="chatWebsite-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{systemAvatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ONLINE">ONLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformonline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteonlineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="onlineForm" novalidate>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKey">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.onlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.onlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.onlineForm.fromKey != null ? vm_fonc.chatWebsite.onlineForm.items[vm_fonc.chatWebsite.onlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.onlineForm.items track by $index" md-component-id="{{\'onlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n <md-input-container class="md-block">\n <label translate="CHAT.VARIABLE">Variable</label>\n <md-select ng-model="item.variable">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="variable in vm_fonc.variables" ng-value="variable.name">{{ variable.name }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.onlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINE">OFFLINE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatformoffline md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteofflineFormController as vm_fonc" ng-init="vm_fonc.init(vm.chatWebsite)" class="content" md-background-bg layout="column">\n <div flex>\n \x3c!-- START Buttons --\x3e\n <md-button aria-label="comment" class="md-fab md-mini" ng-click="vm_fonc.add(button.type)" ng-repeat="button in vm_fonc.buttons">\n <md-tooltip md-direction="top">{{button.name}}</md-tooltip>\n <md-icon md-font-icon="{{button.icon}}"></md-icon>\n </md-button>\n \x3c!-- END Buttons --\x3e\n </div>\n\n <div layout="row" flex>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.BUILDER">BUILDER</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content>\n\n <form name="offlineForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm_fonc.chatWebsite.forwardOffline" aria-label="forwardOffline"><span translate="CHAT.FORWARD_OFFLINE">forwardOffline</span></md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.forwardOffline">\n <label translate="CHAT.FORWARD_OFFLINE_ADDRESS">FORWARD OFFLINE ADDRESS</label>\n <input type="text" name="forwardOfflineAddress" ng-model="vm_fonc.chatWebsite.forwardOfflineAddress">\n <div class="hint"><span translate="CHAT.HELP.FORWARD_OFFLINE"></span></div>\n <div ng-messages="offlineForm[\'forwardOfflineAddress\'].$error" ng-show="offlineForm[\'forwardOfflineAddress\'].$touched" role="alert">\n <div ng-message="email">\n <span translate="CHAT.ERRORS.EMAIL_MUST_BE_VALID">forwardOffline must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- START MapKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.MAPKEY">MapKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.mapKeyOffline">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END MapKey --\x3e\n\n \x3c!-- START FromKey --\x3e\n <md-input-container class="md-block" ng-if="vm_fonc.chatWebsite.offlineForm.items.length">\n <label translate="CHAT.HELP.FROMKEY">FromKey</label>\n <md-select ng-model="vm_fonc.chatWebsite.offlineForm.fromKey" md-selected-text="vm_fonc.chatWebsite.offlineForm.fromKey != null ? vm_fonc.chatWebsite.offlineForm.items[vm_fonc.chatWebsite.offlineForm.fromKey].props.title : \'None\'">\n <md-option ng-value="null">None</md-option>\n <md-option ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items" ng-if="item.props.title" ng-value="$index">{{ item.props.title }}</md-option>\n </md-select>\n </md-input-container>\n \x3c!-- END FromKey --\x3e\n\n \x3c!-- START EXPANSION PANELS --\x3e\n <md-expansion-panel ng-repeat="item in vm_fonc.chatWebsite.offlineForm.items track by $index" md-component-id="{{\'offlinePanel\' + $index}}">\n <md-expansion-panel-collapsed md-no-sticky="true">\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index); $event.stopPropagation()">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-down"></md-icon>\n </md-button>\n </md-expansion-panel-collapsed>\n\n <md-expansion-panel-expanded>\n <md-expansion-panel-header>\n <md-button class="md-icon-button" aria-label="Down" ng-click="vm_fonc.down(item, $index)">\n <md-icon md-font-icon="icon-arrow-down-bold-circle-outline"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Up" ng-click="vm_fonc.up(item, $index)">\n <md-icon md-font-icon="icon-arrow-up-bold-circle-outline"></md-icon>\n </md-button>\n\n <div class="md-title">{{item.props.title || item.type}}</div>\n\n <div flex></div>\n\n <md-button class="md-icon-button md-warn" aria-label="Remove" ng-click="vm_fonc.remove($index)">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n <md-button class="md-icon-button" aria-label="Collapse" ng-click="$panel.collapse()">\n <md-icon md-font-icon="icon-chevron-up"></md-icon>\n </md-button>\n </md-expansion-panel-header>\n\n <md-expansion-panel-content>\n <form-item type="{{item.type}}" item="item" index="$index"></form-item>\n\n\n <md-input-container class="md-block">\n <label translate="CHAT.CM_FIELD">Contact Manager Field</label>\n <md-select ng-model="item.cmField">\n <md-option ng-value="null">None</md-option>\n\n <md-optgroup label="standard">\n <md-option ng-repeat="field in vm_fonc.fields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n\n <md-optgroup label="custom" ng-if="vm_fonc.customFields.length">\n <md-option ng-repeat="field in vm_fonc.customFields" ng-value="field.key">{{ field.value }}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-expansion-panel-content>\n\n </md-expansion-panel-expanded>\n </md-expansion-panel>\n \x3c!-- END EXPANSION PANELS --\x3e\n </form>\n\n </md-card-content>\n </md-card>\n </div>\n <div flex="50">\n <md-card>\n <md-card-title>\n <md-card-title-text>\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CHAT.PREVIEW">PREVIEW</div>\n </div>\n </md-card-title-text>\n </md-card-title>\n <md-card-content flex>\n <form-view form="vm_fonc.chatWebsite.offlineForm" flex="100"></form-view>\n </md-card-content>\n </md-card>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.PROACTIVEACTIONS">PROACTIVEACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container proactive md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteProactiveActionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.PROACTIVEACTIONS">ProactiveActions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event)" aria-label="add chatProactiveAction" translate translate-attr-label="CHAT.ADD_CHATPROACTIVEACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteProactiveActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteProactiveActions.length}} {{vm_dc.selectedChatWebsiteProactiveActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteProactiveActions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteProactiveActions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteProactiveActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteProactiveActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CHAT.TYPE\' | translate }}</th>\n <th md-column md-order-by="selector">{{ \'CHAT.SELECTOR\' | translate }}</th>\n <th md-column md-order-by="timeout">{{ \'CHAT.TIMEOUT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatProactiveAction" md-select-id="id" ng-repeat="chatProactiveAction in vm_dc.chatWebsiteProactiveActions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{ \'CHAT.\' + vm_dc.arraytype[chatProactiveAction.type].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.selector}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.timeout}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" md-cell>{{chatProactiveAction.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatProactiveAction($event, chatProactiveAction)" translate="CHAT.EDIT_CHATPROACTIVEACTION">\n Edit ChatProactiveAction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatProactiveAction, $event)" translate="CHAT.DELETE_CHATPROACTIVEACTION">\n Delete ChatProactiveAction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteProactiveActions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATPROACTIVEACTION_AVAILABLE">No chatproactiveaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteProactiveActions.count}}" md-on-paginate="vm_dc.getChatWebsiteProactiveActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatDispositionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATDISPOSITIONS">ChatDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event)" aria-label="add chatDisposition" translate translate-attr-label="CHAT.ADD_CHATDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatDispositions.length}} {{vm_dc.selectedChatWebsiteChatDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatDispositions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatDispositions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatDisposition" md-select-id="id" ng-repeat="chatDisposition in vm_dc.chatWebsiteChatDispositions.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" md-cell>{{chatDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatDisposition($event, chatDisposition)" translate="CHAT.EDIT_CHATDISPOSITION">\n Edit ChatDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatDisposition, $event)" translate="CHAT.DELETE_CHATDISPOSITION">\n Delete ChatDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATDISPOSITION_AVAILABLE">No chatdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatDispositions.count}}" md-on-paginate="vm_dc.getChatWebsiteChatDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container chatcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteChatCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.CHATCANNEDANSWERS">ChatCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event)" aria-label="add chatCannedAnswer" translate translate-attr-label="CHAT.ADD_CHATCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteChatCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteChatCannedAnswers.length}} {{vm_dc.selectedChatWebsiteChatCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteChatCannedAnswers" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteChatCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteChatCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteChatCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'CHAT.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'CHAT.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CHAT.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="chatCannedAnswer" md-select-id="id" ng-repeat="chatCannedAnswer in vm_dc.chatWebsiteChatCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" md-cell>{{chatCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditChatWebsiteChatCannedAnswer($event, chatCannedAnswer)" translate="CHAT.EDIT_CHATCANNEDANSWER">\n Edit ChatCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(chatCannedAnswer, $event)" translate="CHAT.DELETE_CHATCANNEDANSWER">\n Delete ChatCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteChatCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CHAT.NO_CHATCANNEDANSWER_AVAILABLE">No chatcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteChatCannedAnswers.count}}" md-on-paginate="vm_dc.getChatWebsiteChatCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteActionsController as vm_ac" ng-init="vm_ac.init(vm.chatWebsite, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="CHAT.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedChatWebsiteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedChatWebsiteApps.length}} {{vm_ac.selectedChatWebsiteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedChatWebsiteApps($event)" aria-label="delete selected" translate translate-attr-label="CHAT.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedChatWebsiteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.chatWebsiteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editChatWebsiteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editChatWebsiteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.chatWebsiteApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteInteractionsController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getChatWebsiteInteractions()" aria-label="refresh Interactions" translate translate-attr-label="CHAT.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteInteractions.length}} {{vm_dc.selectedChatWebsiteInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteInteractions" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteInteractions($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'CHAT.CLOSEDAT\' | translate }}</th>\n <th md-column>{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column>{{ \'CHAT.AGENT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CHAT.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="ratingValue">{{ \'CHAT.RATING\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'CHAT.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'CHAT.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.chatWebsiteInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="interaction.ratingValue != null && (!interaction.ratingType || interaction.ratingType == \'star\')" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:interaction.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="interaction.ratingValue != null && interaction.ratingType && interaction.ratingType == \'thumb\' && interaction.ratingValue == 0"></md-icon><span ng-show="interaction.ratingValue == null" translate="CHAT.NO_RATINGVALUE">No ratingValue</span>\n </td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spychatInteraction($event, interaction)" translate="CHAT.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.chatInteractionDownload(interaction, $event)" translate="CHAT.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="CHAT.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteInteractions.rows.length">\n <td md-cell colspan="15">\n <span class="text-boxed-ligth" translate="CHAT.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteInteractions.count}}" md-on-paginate="vm_dc.getChatWebsiteInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.OFFLINEMESSAGES">OFFLINEMESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="chatWebsite-detail-form-container offlinemessages md-background-bg md-whiteframe-1dp">\n <div ng-controller="ChatWebsiteOfflineMessagesController as vm_dc" ng-init="vm_dc.init(vm.chatWebsite, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.OFFLINEMESSAGES">OfflineMessages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedChatWebsiteOfflineMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedChatWebsiteOfflineMessages.length}} {{vm_dc.selectedChatWebsiteOfflineMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedChatWebsiteOfflineMessages" csv-label="true" filename="chatWebsites.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedChatWebsiteOfflineMessages($event)" aria-label="delete selected" translate translate-attr-label="CHATWEBSITES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedChatWebsiteOfflineMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getChatWebsiteOfflineMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CHAT.ID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'CHAT.CONTACT\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CHAT.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="offlineMessage" md-select-id="id" ng-repeat="offlineMessage in vm_dc.chatWebsiteOfflineMessages.rows">\n <td md-cell>{{offlineMessage.id}}</td>\n <td md-cell>{{ (vm_dc.contacts | filter : {\'id\':offlineMessage.ContactId})[0].firstName }}</td>\n <td md-cell>{{offlineMessage.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showOfflineMessageChatWebsiteOfflineMessage($event, offlineMessage)" translate="CHAT.SHOW_OFFLINEMESSAGE">\n SHOW OfflineMessage\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(offlineMessage, $event)" translate="CHAT.DELETE_OFFLINEMESSAGE">\n Delete OfflineMessage\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.chatWebsiteOfflineMessages.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CHAT.NO_OFFLINEMESSAGE_AVAILABLE">No offlinemessage available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.chatWebsiteOfflineMessages.count}}" md-on-paginate="vm_dc.getChatWebsiteOfflineMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/chat/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'CHAT.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'CHAT.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'CHAT.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'CHAT.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'CHAT.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'CHAT.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'CHAT.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'CHAT.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'CHAT.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'CHAT.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'CHAT.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"CHAT.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"CHAT.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"CHAT.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"CHAT.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"CHAT.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'CHAT.PAGE' | translate}}:', rowsPerPage: '{{'CHAT.ROWSPERPAGE' | translate}}:', of: '{{'CHAT.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/chat/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CHAT.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'CHAT.NAME\' | translate }}</th>\n <th md-column>{{ \'CHAT.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'CHAT.PAUSED\' | translate }}</th>\n <th md-column>{{ \'CHAT.READY\' | translate }}</th>\n <th md-column>{{ \'CHAT.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CHAT.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CHAT.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditChatQueue($event, vm.queues[value])" translate="CHAT.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="CHAT.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'CHAT.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CHAT.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CHAT.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/chat/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CHAT.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/companies.html",'<div id="companies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.COMPANIES">Companies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCompanies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCompanies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-companies-count">\n <span>{{vm.selectedCompanies.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="COMPANIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCompanies()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCompanies()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCompanies" csv-label="true" filename="companies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCompanies($event)" aria-label="delete selected" translate translate-attr-label="COMPANIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- COMPANY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCompanies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCompanies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.companies.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="company" md-select-id="id" ng-repeat="company in vm.companies.rows">\n <td md-cell ng-if="company.userpic"><img class="avatar" alt="{{company.name}}" ng-src="api/users/{{company.id}}/avatar" /></td>\n <td md-cell ng-if="!company.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{company.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="id ">{{company.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="name ">{{company.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(company, ev) : vm.createOrEditCompany($event, company)" md-cell class="description ">{{company.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(company, $event)" translate="CONTACTMANAGER.EDIT_COMPANY">\n Edit Company\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(company, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_COMPANY">\n goToContacts Company\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(company, $event)" translate="CONTACTMANAGER.DELETE_COMPANY">\n Delete Company\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.companies.count}}" md-on-paginate="vm.getCompanies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / COMPANY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD COMPANY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-company-button" ng-click="vm.createOrEditCompany($event)" aria-label="add company" translate translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD COMPANY BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/companies/create/dialog.html",'<md-dialog class="company-dialog" aria-label="New Company">\n <form name="companyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus>\n\n <div ng-messages="companyForm[\'name\'].$error" ng-show="companyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone">\n\n <div ng-messages="companyForm[\'phone\'].$error" ng-show="companyForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat">\n\n <div ng-messages="companyForm[\'vat\'].$error" ng-show="companyForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax">\n\n <div ng-messages="companyForm[\'fax\'].$error" ng-show="companyForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId">\n\n <div ng-messages="companyForm[\'companyId\'].$error" ng-show="companyForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type">\n\n <div ng-messages="companyForm[\'type\'].$error" ng-show="companyForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255">\n\n <div ng-messages="companyForm[\'website\'].$error" ng-show="companyForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain">\n\n <div ng-messages="companyForm[\'emailDomain\'].$error" ng-show="companyForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email">\n\n <div ng-messages="companyForm[\'email\'].$error" ng-show="companyForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description">\n\n <div ng-messages="companyForm[\'description\'].$error" ng-show="companyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCompany" ng-click="vm.saveCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid || companyForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCompany" ng-click="vm.addNewCompany()" class="send-button md-accent md-raised" ng-disabled="companyForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_COMPANY" translate-attr-aria-label="CONTACTMANAGER.ADD_COMPANY">\n ADD COMPANY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCompany" ng-click="vm.deleteCompany($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/companies/edit/view.html",'<div id="contactmanager-company" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-companies-button md-icon-button" aria-label="Go to companies" ng-click="vm.gotoCompanies()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_COMPANIES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="company-image" hide-xs>\n <img ng-src="assets/images/business/companies.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.company.id}}\n <span ng-if="vm.company.name">{{vm.company.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.company.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.company, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_COMPANY"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCompany()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (addressForm.$invalid) || (shipmentAddressForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.GENERAL">GENERAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.company.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.company.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.VAT">Vat</label>\n <input type="text" name="vat" ng-model="vm.company.vat" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'vat\'].$error" ng-show="generalForm[\'vat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.VAT_REQUIRED">Vat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.company.fax" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fax\'].$error" ng-show="generalForm[\'fax\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FAX_REQUIRED">Fax field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANYID">CompanyId</label>\n <input type="text" name="companyId" ng-model="vm.company.companyId" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'companyId\'].$error" ng-show="generalForm[\'companyId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COMPANYID_REQUIRED">CompanyId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.company.type" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.WEBSITE">Website</label>\n <input type="text" name="website" ng-model="vm.company.website" md-maxlength="255" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'website\'].$error" ng-show="generalForm[\'website\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_REQUIRED">Website field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="CONTACTMANAGER.ERRORS.WEBSITE_MAX_LENGTH" translate-values=\'{max: 255}\'>Website must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL_DOMAIN">Email_Domain</label>\n <input type="text" name="emailDomain" ng-model="vm.company.emailDomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'emailDomain\'].$error" ng-show="generalForm[\'emailDomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_DOMAIN_REQUIRED">Email_Domain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.company.email" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.company.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.ADDRESS">ADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container address md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.ADDRESS">ADDRESS</div>\n </div>\n <form name="addressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.company.street" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'street\'].$error" ng-show="addressForm[\'street\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="postalCode" ng-model="vm.company.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'postalCode\'].$error" ng-show="addressForm[\'postalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.company.city" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'city\'].$error" ng-show="addressForm[\'city\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.company.country" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="addressForm[\'country\'].$error" ng-show="addressForm[\'country\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="company-detail-form-container shipmentaddress md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.SHIPMENTADDRESS">SHIPMENTADDRESS</div>\n </div>\n <form name="shipmentAddressForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="sStreet" ng-model="vm.company.sStreet" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sStreet\'].$error" ng-show="shipmentAddressForm[\'sStreet\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.STREET_REQUIRED">Street field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal_Code</label>\n <input type="text" name="sPostalCode" ng-model="vm.company.sPostalCode" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sPostalCode\'].$error" ng-show="shipmentAddressForm[\'sPostalCode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.POSTAL_CODE_REQUIRED">Postal_Code field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="sCity" ng-model="vm.company.sCity" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCity\'].$error" ng-show="shipmentAddressForm[\'sCity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.CITY_REQUIRED">City field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="sCountry" ng-model="vm.company.sCountry" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="shipmentAddressForm[\'sCountry\'].$error" ng-show="shipmentAddressForm[\'sCountry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.COUNTRY_REQUIRED">Country field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/contacts.html",'<div id="contacts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.CONTACTS">Contacts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContacts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n <div class="close-button-wrapper" ng-click="vm.selectedContacts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n <div>\n <span class="selected-contacts-count">\n <span>{{vm.selectedContacts.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTACTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContacts()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContacts()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContacts" csv-label="true" filename="contacts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm.crudPermissions.canDelete" class="md-icon-button" ng-click="vm.deleteSelectedContacts($event)" aria-label="delete selected" translate translate-attr-label="CONTACTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n <div layout="row">\n <div class="column" flex="20">\n <md-card>\n <md-card-content>\n <button layout-align="center center" md-mini-fab ng-click="vm.selectedList = null; vm.selectedCompany = null; vm.selectedTags = []">\n <md-icon md-font-icon="icon-refresh"></md-icon>{{ \'CONTACTMANAGER.ALL_CONTACTS\' | translate }}\n </button>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_LIST">Select a list</label>\n <md-select placeholder="Select a list" ng-model="vm.selectedList">\n <md-optgroup label="Lists">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_COMPANY">Select a company</label>\n <md-select placeholder="Select a companie" flex="100" ng-model="vm.selectedCompany">\n <md-optgroup label="Companies">\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n </md-card-content>\n </md-card>\n <md-card>\n <md-card-content>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.SELECT_TAGS">Select one or more tags</label>\n <md-select placeholder="Select one or more tags" flex="100" ng-model="vm.query.tag" ng-change="vm.getContacts()" multiple>\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n </md-card-content>\n </md-card>\n </div>\n\n \x3c!-- USER TABLE --\x3e\n <md-card flex="80">\n <md-table-container ng-init="vm.getAssignedCompanies()">\n <table md-table md-row-select multiple ng-model="vm.selectedContacts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'CONTACTMANAGER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'CONTACTMANAGER.PHONE\' | translate}}</th>\n <th md-column md-order-by="email">{{\'CONTACTMANAGER.EMAIL\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'CONTACTMANAGER.CREATED_AT\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'CONTACTMANAGER.LIST\' | translate}}</th>\n <th md-column md-order-by="CompanyId">{{\'CONTACTMANAGER.COMPANY\' | translate}}</th>\n <th md-column md-order-by="tags">{{\'CONTACTMANAGER.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="contact" md-select-id="id" ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="phone">{{contact.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="createdAt">{{contact.createdAt | date:\'medium\'}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId]}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editdialog(contact, ev) : vm.createOrEditContact($event, contact)" md-cell class="company">{{vm.companiesMap[contact.CompanyId]}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(contact, ev)" translate="CONTACTMANAGER.EDIT_CONTACT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.mergeContact(ev, contact)" translate="CONTACTMANAGER.MERGE_CONTACT">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact(ev, contact)" translate="CONTACTMANAGER.DUPLICATE_CONTACT">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n <md-menu-divider ng-if="vm.crudPermissions.canEdit && vm.crudPermissions.canDelete"></md-menu-divider>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(contact, ev)" translate="CONTACTMANAGER.DELETE_CONTACT">\n Delete Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-fab-speed-dial id="add-contact-button" ng-if="vm.crudPermissions.canEdit" ng-hide="vm.options.hidden" md-direction="up" md-open="vm.options.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm.options.hover }" ng-mouseenter="vm.options.isOpen=true" ng-mouseleave="vm.options.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-accent">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button class="md-fab md-mini md-warn" flow-btn flow-init="vm.ngFlowOptions" flow-files-submitted="$flow.upload()" flow-file-success="vm.importContacts($file, $message, $flow)" flow-file-added="vm.fileAdded($file)" aria-label="Select File" translate translate-attr-aria-label="CONTACTMANAGER.IMPORT_CONTACTS">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.IMPORT_CONTACTS\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n <md-button class="md-fab md-mini md-accent" ng-click="vm.createOrEditContact($event)" aria-label="add contact" translate translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n <md-tooltip md-direction="left" md-visible="tooltipVisible" md-autohide="false">\n {{\'CONTACTMANAGER.ADD_CONTACT\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/create/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="New Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FIRSTNAME">First name</label>\n <input name="firstName" ng-model="vm.contact.firstName" required md-autofocus>\n\n <div ng-messages="contactForm.firstName.$error" ng-show="contactForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LASTNAME">Last name</label>\n <input name="lastName" ng-model="vm.contact.lastName">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <input name="phone" ng-model="vm.contact.phone">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <input name="email" type="email" ng-model="vm.contact.email">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <input name="mobile" ng-model="vm.contact.mobile">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <input name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-disabled="vm.contact.id && vm.contact.ListId" ng-init="vm.getCustomFields(vm.contact.ListId)" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div ng-repeat="customField in vm.customFields.rows" class="md-block" ng-switch="customField.type">\n <div ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </div>\n\n <div ng-switch-when="select">\n <label>{{customField.alias}}</label>\n\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </div>\n\n <div ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </div>\n\n <md-input-container ng-switch-default>\n <label>{{customField.alias}}</label>\n\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <md-input-container class="md-block" ng-if="vm.allFields" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <input type="text" name="country" ng-model="vm.contact.country">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.POSTAL_CODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.allFields">\n <label translate="CONTACTMANAGER.NOTES">Notes</label>\n <input type="text" name="description" ng-model="vm.contact.description">\n </md-input-container>\n\n <div ng-if="vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields</md-button>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newContact" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newContact" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid || contactForm.$pristine" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContact" ng-click="vm.deleteContact($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/duplicate/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="{{ \'CONTACTMANAGER.DUPLICATE_CONTACT\' | translate }}">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n\n <div ng-messages="contactForm.list.$error" ng-show="contactForm.list.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.addNewContact()" class="send-button md-accent md-raised" ng-disabled="contactForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CONTACT" translate-attr-aria-label="CONTACTMANAGER.ADD_CONTACT">\n ADD CONTACT\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="CONTACTMANAGER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-if="!vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_HOPPER" translate-attr-aria-label="CONTACTMANAGER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="!vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/edit/view.html",'<div id="cm-contact" class="page-layout simple tabbed" layout="column" ng-init="vm.onInit()">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-contacts-button md-icon-button" aria-label="Go to contacts" ng-click="vm.gotoContacts()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_CONTACTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="contact-image" hide-xs>\n <img ng-src="assets/images/business/contacts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.contact.id}} {{vm.contact.firstName}} {{vm.contact.lastName}}\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-if="vm.contact.role && vm.contact.role !== \'admin\'" ng-controller="ContactQueueAddButtonController as vm_contact_qa" ng-cloak>\n <md-fab-speed-dial ng-hide="vm_contact_qa.hidden" md-direction="left" md-open="vm_contact_qa.isOpen" class="md-scale md-fab" ng-class="{ \'md-hover-full\': vm_contact_qa.hover }" ng-mouseenter="vm_contact_qa.isOpen=true" ng-mouseleave="vm_contact_qa.isOpen=false">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="tooltipVisible">Channels</md-tooltip>\n <md-icon md-font-icon="icon-eye" aria-label="channels"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <div ng-repeat="channel in vm_contact_qa.channels">\n <md-button aria-label="{{channel.name}}" class="md-fab md-raised md-icon-button md-mini" ng-click="vm_contact_qa.openDialog($event, vm.contact, channel)">\n <md-tooltip md-direction="{{channel.direction}}" md-visible="tooltipVisible" md-autohide="false">\n {{channel.name}}\n </md-tooltip>\n <md-icon md-font-icon="{{channel.icon}}" aria-label="{{channel.name}}"></md-icon>\n </md-button>\n </div>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.duplicateContact($event)" class="md-fab md-warn md-icon-button" aria-label="DUPLICATE">\n <md-icon md-font-icon="icon-file-multiple"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact()" class="send-button md-accent md-raised" ng-disabled="detailForm.$pristine && customFieldsForm.$pristine && socialForm.$pristine" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DETAIL">DETAIL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div layout="column" flex="70">\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- fistName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- lastName --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- phone --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- mobile --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- email --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n <div ng-messages="detailForm.firstName.$error" ng-show="detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="CONTACTMANAGER.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- fax --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="CONTACTMANAGER.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth" mdp-disabled="!vm.crudPermissions.canEdit"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.companies.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Companies">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows" ng-disabled="company.canSelect === false"">{{company.name}}</md-option>\n <md-option ng-value=" null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n <md-icon class="pointer" ng-show="vm.contact.CompanyId" md-font-icon="icon-information-outline" ng-click="vm.editCompany($event, vm.contact.CompanyId)"></md-icon>\n </md-input-container>\n <section ng-if="!vm.companies.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-briefcase"></md-icon>\n <label translate="CONTACTMANAGER.NO_COMPANIES">No Companies</label>\n </section>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container ng-if="vm.tags.rows.length" class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.Tags" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-optgroup label="Tags">\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tags.rows" ng-disabled="tag.canSelect === false">{{tag.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <section ng-if="!vm.tags.rows.length" flex-gt-sm="">\n <md-icon md-font-icon="icon-tag"></md-icon>\n <label translate="CONTACTMANAGER.NO_TAG">No Tags</label>\n <md-button class="md-accent" translate="CONTACTMANAGER.ADD_TAG">Add Tag</md-button>\n </section>\n </div>\n\n <div ng-if="!vm.allFields" layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = true" translate="CONTACTMANAGER.SHOW_ALL_FIELDS">Show All Fields</md-button>\n </div>\n\n <div ng-if="vm.allFields">\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n \x3c!-- country --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- city --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div flex="5"></div>\n \x3c!-- street --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n \x3c!-- postalCode --\x3e\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="CONTACTMANAGER.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="CONTACTMANAGER.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4" ng-disabled="!vm.crudPermissions.canEdit"></textarea>\n </md-input-container>\n </div>\n\n <div layout="row" layout-align="center center">\n <md-button class="md-accent" ng-click="vm.allFields = false" translate="CONTACTMANAGER.FEWER_FIELDS">Fewer Fields\n </md-button>\n </div>\n\n </div>\n </form>\n </md-card>\n <md-card class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.SOCIAL">Social</div>\n </div>\n <form name="socialForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n\n <div flex></div>\n\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex="25">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text text-truncate" translate="CONTACTMANAGER.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n </div>\n <form name="customFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate translate-attr-placeholder="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" md-on-close="vm.onSelectList($event)" ng-disabled="vm.contact.ListId">\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <div ng-repeat="customField in vm.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}</label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}</label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required" ng-disabled="!vm.crudPermissions.canEdit">\n </md-input-container>\n </div>\n </form>\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.dialer">\n <md-tab-label>\n <span translate="CONTACTMANAGER.MOTION_BULL">MOTION BULL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HOPPER">Hopper</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHopper.filter = query;" on-collapse="vm.queryHopper.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHoppers()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHopper.sort" md-on-reorder="vm.getHoppers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="VoiceQueueId">{{ \'CONTACTMANAGER.VOICEQUEUEID\' | translate }}</th>\n <th md-column md-order-by="CampaignId">{{ \'CONTACTMANAGER.CAMPAIGNID\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.hoppers.count">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, hopper) in vm.hoppers.rows">\n <td md-cell>{{hopper.id}}</td>\n <td md-cell>{{hopper.phone}}</td>\n <td md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{ vm.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell>{{hopper.VoiceQueueId}}</td>\n <td md-cell>{{hopper.CampaignId}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.VoiceQueueId" ng-click="vm.editHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit && hopper.CampaignId" ng-click="vm.createOrEditIvrCampaignHopper($event, hopper)" translate="CONTACTMANAGER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.crudPermissions.canDelete && vm.deleteconfirm(hopper, $event)" translate="CONTACTMANAGER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.FINAL">Final</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryFinal.filter = query;" on-collapse="vm.queryFinal.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getFinals()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryFinal.sort" md-on-reorder="vm.getFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'CONTACTMANAGER.DISPOSITION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.finals.count">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, final) in vm.finals.rows">\n <td md-cell>{{final.uniqueid}}</td>\n <td md-cell>{{final.calleridnum}}</td>\n <td md-cell>{{final.statedesc}}</td>\n <td md-cell>{{final.starttime | date:\'medium\'}}</td>\n <td md-cell>{{final.disposition}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryFinal.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryFinal.page" md-total="{{vm.finals.count}}" md-on-paginate="vm.getFinals" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.HISTORY">History</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryHistory.filter = query;" on-collapse="vm.queryHistory.filter = undefined;" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm.getHistories()" aria-label="reload" translate translate-attr-label="CONTACTMANAGER.RELOAD">\n <md-tooltip>{{\'CONTACTMANAGER.RELOAD\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- HOPPER TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryHistory.sort" md-on-reorder="vm.getHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'CONTACTMANAGER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'CONTACTMANAGER.PHONE\' | translate }}</th>\n <th md-column md-order-by="state">{{ \'CONTACTMANAGER.STATE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'CONTACTMANAGER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.histories.count">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, history) in vm.histories.rows">\n <td md-cell>{{history.uniqueid}}</td>\n <td md-cell>{{history.calleridnum}}</td>\n <td md-cell>{{history.statedesc}}</td>\n <td md-cell>{{history.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{history.starttime | date:\'medium\'}}</td>\n <td md-cell>{{history.endtime | date:\'medium\'}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHistory.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHistory.page" md-total="{{vm.histories.count}}" md-on-paginate="vm.getHistories" md-page-select></md-table-pagination>\n \x3c!-- / HOPPER TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab ng-if="vm.license.jscripty">\n <md-tab-label>\n <span translate="CONTACTMANAGER.JSCRIPTY">JSCRIPTY</span>\n </md-tab-label>\n\n <md-tab-body>\n <div layout="row">\n <div class="contact-detail-form-container personal_info md-background-bg md-whiteframe-1dp" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm.queryJscriptySession.filter = query;" on-collapse="vm.queryJscriptySession.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n\n \x3c!-- SESSION TABLE --\x3e\n <md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.queryJscriptySession.sort" md-on-reorder="vm.getJscriptySessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'CONTACTMANAGER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'CONTACTMANAGER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="agent">{{ \'CONTACTMANAGER.AGENT\' | translate }}</th>\n <th md-column md-order-by="project">{{ \'CONTACTMANAGER.PROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.jscriptySessions.count">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, session) in vm.jscriptySessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.projectname}}</td>\n <td md-cell class="actions"></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.queryHopper.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.queryHopper.page" md-total="{{vm.hoppers.count}}" md-on-paginate="vm.getHoppers" md-page-select></md-table-pagination>\n \x3c!-- / SESSION TABLE --\x3e\n </div>\n </div>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMER_JOURNEY">CUSTOMER JOURNEY</span>\n </md-tab-label>\n\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/contacts/import/import.html",'<md-dialog class="import-dialog" aria-label="Import contact">\n <form name="importForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS">Import Contacts</span>\n <md-button ng-if="vm.result.finish || !vm.processing" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear ng-disabled="!vm.processing || vm.result.finish" md-mode="indeterminate" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div>\n <md-content ng-show="!vm.processing">\n <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">CONTACT MANAGER</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="contactField in vm.contactFields">\n <label>{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</label>\n <md-select name="{{contactField.key}}" ng-model="vm.binding[contactField.key]" placeholder="{{\'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}" ng-required="contactField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <md-select name="list" ng-model="vm.ListId" placeholder="Select a list" ng-change="vm.onChangeList()" required>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="customField in vm.customFields.rows">\n <label>{{customField.alias}}</label>\n <md-select ng-model="vm.binding[\'cf_\' + customField.id]" placeholder="{{customField.alias}}" ng-required="customField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="customField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <md-select name="company" ng-model="vm.CompanyId" placeholder="Select a company">\n <md-option ng-value="company.id" ng-repeat="company in vm.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null">\n <em translate="CONTACTMANAGER.NONE">None</em>\n </md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-icon-float md-block">\n <md-select ng-model="vm.duplicates" placeholder="{{ \'CONTACTMANAGER.CHECK_DUPLICATES\' | translate}}" multiple>\n <md-option ng-value="contactField.key" ng-repeat="contactField in vm.contactFields">{{ \'CONTACTMANAGER.\' + contactField.key | uppercase | translate}}</md-option>\n </md-select>\n </md-input-container>\n\n <div ng-if="vm.license.dialer">\n <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">MOTION BULL</div>\n\n <md-input-container class="md-icon-float md-block" ng-repeat="motionBullField in vm.motionBullFields">\n <label>{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}</label>\n <md-select name="{{motionBullField.key}}" ng-model="vm.binding[motionBullField.key]" placeholder="{{\'CONTACTMANAGER.\' + motionBullField.key | uppercase | translate}}" ng-required="motionBullField.required">\n <md-option ng-value="field" ng-repeat="field in vm.fields">{{ field }}</md-option>\n <md-option ng-value="null" ng-hide="contactField.required">\n <em>{{ \'CONTACTMANAGER.NONE\' | translate }}</em>\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n\n </md-content>\n\n <div class="error-list" ng-if="vm.result.finish">\n <div class="info" layout="row" layout-align="space-between center">\n <div>\n <div class="message">{{\'CONTACTMANAGER.UPLOAD_COMPLETED\' | translate | uppercase}} ({{vm.result.elapsed}}s)</div>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row" ng-if="vm.processing">\n \x3c!-- WIDGET PROCESSING --\x3e\n <ms-widget ng-if="!vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.rows"></span>\n </div>\n <div ng-if="vm.processing" class="font-weight-500 secondary-text">Please wait, we are processing your contacts...</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET PROCESSING --\x3e\n \x3c!-- WIDGET SUCCESS --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 green-fg">\n <span ng-bind="vm.result.affectedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.SUCCESS">Success</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET SUCCESS --\x3e\n\n \x3c!-- WIDGET FAILURE --\x3e\n <ms-widget ng-if="vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 red-fg">\n <span ng-bind="vm.result.failedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.FAILURE">Failure</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET FAILURE --\x3e\n\n \x3c!-- WIDGET DUPLICATES --\x3e\n <ms-widget ng-if="vm.result.duplicatedRows && vm.result.finish" class="h-140" flex>\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg">\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8 orange-fg">\n <span ng-bind="vm.result.duplicatedRows"></span>\n </div>\n <div class="font-weight-500 secondary-text" translate="CONTACTMANAGER.DUPLICATES">Duplicates</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n \x3c!-- / WIDGET DUPLICATES --\x3e\n </div>\n\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.processing" ng-disabled="importForm.$invalid || importForm.$pristine" ng-click="vm.uploadCsv()" class="md-accent md-raised" aria-label="UPLOAD" translate="CONTACTMANAGER.UPLOAD" translate-attr-aria-label="CONTACTMANAGER.IMPORT">\n IMPORT\n </md-button>\n <md-button ng-if="vm.processing && !vm.result.finish && !vm.stopping" ng-click="vm.stopUpload()" class="md-accent md-raised" aria-label="Stop Upload" translate="CONTACTMANAGER.STOP" translate-attr-aria-label="CONTACTMANAGER.STOP">\n STOP\n </md-button>\n <md-button ng-if="vm.result.finish && vm.result.errors.length" ng-csv="vm.getArrayErrors()" csv-header="vm.getHeaderErrors()" class="md-accent md-raised" aria-label="Export Errors" filename="contacts_import_errors.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon> {{\'CONTACTMANAGER.EXPORT_ERRORS\' | translate}}\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/contacts/merge/dialog.html",'<md-dialog class="cm-contact-dialog" aria-label="Merge Contact">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block" flex-gt-sm>\n <label>Filter</label>\n <input ng-model="vm.searchTerm" name="searchTerm" ng-model-options="{ debounce: 300 }" ng-change="vm.change()">\n </md-input-container>\n\n <md-list flex>\n <md-subheader class="md-no-sticky" ng-hide="vm.contacts.length"><em>Filter doesn\'t match any contact</em></md-subheader>\n <md-list-item class="md-3-line" ng-repeat="contact in vm.contacts | filter:{ id: \'!\' + vm.contact.id}" ng-click="vm.showConfirm($event, vm.contact, contact)">\n <img ng-src="assets/images/avatars/profile.png" class="md-avatar" alt="{{contact.who}}" />\n <div class="md-list-item-text" layout="column">\n <h3>#{{ contact.id }} - {{ contact.firstName }} {{ contact.lastName }}</h3>\n <h4>{{ contact.email }}</h4>\n <p>{{ contact.phone }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/create/dialog.html",'<md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">\n <form name="globalCustomFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.globalCustomField.alias" ng-required="true" autofocus>\n\n <div ng-messages="globalCustomFieldForm[\'alias\'].$error" ng-show="globalCustomFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.globalCustomField.type" required ng-disabled="!vm.newGlobalCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="globalCustomFieldForm[\'type\'].$error" ng-show="globalCustomFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.globalCustomField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.globalCustomField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.globalCustomField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.globalCustomField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.globalCustomField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.globalCustomField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.globalCustomField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField" ng-click="vm.saveGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField" ng-click="vm.addNewGlobalCustomField()" class="send-button md-accent md-raised" ng-disabled="globalCustomFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n ADD GLOBALCUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField" ng-click="vm.deleteGlobalCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/globalCustomFields/globalCustomFields.html",'<div id="globalCustomFields" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS">GlobalCustomFields</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedGlobalCustomFields.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedGlobalCustomFields =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-globalCustomFields-count">\n <span>{{vm.selectedGlobalCustomFields.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="GLOBALCUSTOMFIELDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectGlobalCustomFields()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedGlobalCustomFields" csv-label="true" filename="globalCustomFields.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedGlobalCustomFields($event)" aria-label="delete selected" translate translate-attr-label="GLOBALCUSTOMFIELDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- GLOBALCUSTOMFIELD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedGlobalCustomFields" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getGlobalCustomFields">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.globalCustomFields.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="globalCustomField" md-select-id="id" ng-repeat="globalCustomField in vm.globalCustomFields.rows">\n <td md-cell ng-if="globalCustomField.userpic"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="api/users/{{globalCustomField.id}}/avatar" /></td>\n <td md-cell ng-if="!globalCustomField.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{globalCustomField.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="id ">{{globalCustomField.id}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="alias ">{{globalCustomField.alias}}</td>\n <td ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="type ">{{ vm.arraytype[globalCustomField.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)" md-cell class="required ">\n <md-icon md-colors="{color: {{globalCustomField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{globalCustomField.required ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(globalCustomField, $event)" translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD">\n Edit GlobalCustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(globalCustomField, $event)" translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD">\n Delete GlobalCustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.globalCustomFields.count}}" md-on-paginate="vm.getGlobalCustomFields" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / GLOBALCUSTOMFIELD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-globalCustomField-button" ng-click="vm.createOrEditGlobalCustomField($event)" aria-label="add globalCustomField" translate translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD GLOBALCUSTOMFIELD BUTTON --\x3e\n</div>'),e.put("app/main/apps/contactmanager/views/lists/create/dialog.html",'<md-dialog class="list-dialog" aria-label="New List">\n <form name="listForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus>\n\n <div ng-messages="listForm[\'name\'].$error" ng-show="listForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description">\n\n <div ng-messages="listForm[\'description\'].$error" ng-show="listForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newList" ng-click="vm.saveList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid || listForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newList" ng-click="vm.addNewList()" class="send-button md-accent md-raised" ng-disabled="listForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_LIST" translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n ADD LIST\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newList" ng-click="vm.deleteList($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/agentadd/agentadd.html",'<md-dialog class="list-dialog" aria-label="list" ng-init="vm.onInit()">\n <form name="listForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="CONTACTMANAGER.AGENTADD_LIST">Add Agent to list</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/customFields/dialog.html",'<md-dialog class="customField-dialog" aria-label="New CustomField">\n <form name="customFieldForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.ALIAS">Alias</label>\n <input type="" name="alias" ng-model="vm.customField.alias" ng-required="true" autofocus>\n\n <div ng-messages="customFieldForm[\'alias\'].$error" ng-show="customFieldForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.TYPE">Type</label>\n <md-select name="type" ng-model="vm.customField.type" required ng-disabled="!vm.newCustomField">\n <md-option ng-value="\'text\'">Text</md-option>\n <md-option ng-value="\'select\'">Select</md-option>\n <md-option ng-value="\'number\'">Number</md-option>\n <md-option ng-value="\'switch\'">Switch</md-option>\n <md-option ng-value="\'datetime\'">Datetime</md-option>\n </md-select>\n <div ng-messages="customFieldForm[\'type\'].$error" ng-show="customFieldForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.customField.type == \'select\'" class="md-block">\n <md-list>\n <md-list-item layout-margin>\n <md-button class="md-fab md-mini md-secondary" ng-click="vm.addItem(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip>\n <md-icon md-font-icon="icon-plus" aria-label="alert error"></md-icon>\n </md-button>\n <md-button ng-if="vm.customField.values.length" class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItems(vm.customField.values);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE_ALL">Delete All</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list ng-sortable="vm.sortable">\n <md-list-item ng-repeat="item in vm.customField.values" style="border: 1px solid #ccc!important; border-radius: 7px;" layout-margin>\n <div>\n <md-icon class="s24" style="cursor:move" md-font-icon="icon-drag" aria-label="drag"></md-icon>\n <input type="text" ng-model="item.value" flex>\n </div>\n <md-button class="md-fab md-mini md-warn md-secondary" ng-click="vm.removeItem(vm.customField.values, $index);">\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n <md-icon md-font-icon="icon-delete" aria-label="alert error"></md-icon>\n </md-button>\n </md-list-item>\n </md-list>\n <md-list>\n <md-list-item ng-if="!vm.customField.values.length" layout="row" layout-align="center center">\n <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS">No Available Items</em>\n </md-list-item>\n </md-list>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customField.required" aria-label="Required"><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomField" ng-click="vm.saveCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid || customFieldForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomField" ng-click="vm.addNewCustomField()" class="send-button md-accent md-raised" ng-disabled="customFieldForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_CUSTOMFIELD" translate-attr-aria-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n ADD CUSTOMFIELD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomField" ng-click="vm.deleteCustomField($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/edit/view.html",'<div id="contactmanager-list" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-lists-button md-icon-button" aria-label="Go to lists" ng-click="vm.gotoLists()" translate translate-attr-aria-label="CONTACTMANAGER.GO_TO_LISTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="list-image" hide-xs>\n <img ng-src="assets/images/business/lists.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.list.id}}\n <span ng-if="vm.list.name">{{vm.list.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.list.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="CONTACTMANAGER.GOTO_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.list, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="CONTACTMANAGER.AGENTADD_LIST"></span></md-tooltip>\n <md-icon md-font-icon="icon-eye"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveList()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (customFieldsForm.$invalid) || (voiceDispositionsForm.$invalid)" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="CONTACTMANAGER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.list.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.list.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.list.dialPrefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialPrefix\'].$error" ng-show="generalForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.CUSTOMFIELDS">CUSTOMFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container customfields md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListCustomFieldsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.CUSTOMFIELDS">CustomFields</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListCustomField($event)" aria-label="add customField" translate translate-attr-label="CONTACTMANAGER.ADD_CUSTOMFIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListCustomFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListCustomFields.length}} {{vm_dc.selectedListCustomFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListCustomFields" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListCustomFields($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListCustomFields" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListCustomFields">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="alias">{{ \'CONTACTMANAGER.ALIAS\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'CONTACTMANAGER.TYPE\' | translate }}</th>\n <th md-column md-order-by="required">{{ \'CONTACTMANAGER.REQUIRED\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="customField" md-select-id="id" ng-repeat="customField in vm_dc.listCustomFields.rows">\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.id}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{customField.alias}}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell>{{ vm_dc.arraytype[customField.type].option }}</td>\n <td ng-click="vm_dc.createOrEditListCustomField($event, customField)" md-cell class="required ">\n <md-icon md-colors="{color: {{customField.required ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{customField.required? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListCustomField($event, customField)" translate="CONTACTMANAGER.EDIT_CUSTOMFIELD">\n Edit CustomField\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(customField, $event)" translate="CONTACTMANAGER.DELETE_CUSTOMFIELD">\n Delete CustomField\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listCustomFields.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_CUSTOMFIELD_AVAILABLE">No customfield available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listCustomFields.count}}" md-on-paginate="vm_dc.getListCustomFields" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="CONTACTMANAGER.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="list-detail-form-container voicedispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ListVoiceDispositionsController as vm_dc" ng-init="vm_dc.init(vm.list, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="CONTACTMANAGER.VOICEDISPOSITIONS">VoiceDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditListVoiceDisposition($event)" aria-label="add voiceDisposition" translate translate-attr-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedListVoiceDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedListVoiceDispositions.length}} {{vm_dc.selectedListVoiceDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedListVoiceDispositions" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedListVoiceDispositions($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedListVoiceDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getListVoiceDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'CONTACTMANAGER.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="voiceDisposition" md-select-id="id" ng-repeat="voiceDisposition in vm_dc.listVoiceDispositions.rows">\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" md-cell>{{voiceDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditListVoiceDisposition($event, voiceDisposition)" translate="CONTACTMANAGER.EDIT_VOICEDISPOSITION">\n Edit VoiceDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(voiceDisposition, $event)" translate="CONTACTMANAGER.DELETE_VOICEDISPOSITION">\n Delete VoiceDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.listVoiceDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="CONTACTMANAGER.NO_VOICEDISPOSITION_AVAILABLE">No voicedisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.listVoiceDispositions.count}}" md-on-paginate="vm_dc.getListVoiceDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/contactmanager/views/lists/edit/voiceDispositions/dialog.html",'<md-dialog class="voiceDisposition-dialog" aria-label="New VoiceDisposition">\n <form name="voiceDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="CONTACTMANAGER.NAME">Name</label>\n <input type="" name="name" ng-model="vm.voiceDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="voiceDispositionForm[\'name\'].$error" ng-show="voiceDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="CONTACTMANAGER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceDisposition" ng-click="vm.saveVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid || voiceDispositionForm.$pristine" aria-label="SAVE" translate="CONTACTMANAGER.SAVE" translate-attr-aria-label="CONTACTMANAGER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceDisposition" ng-click="vm.addNewVoiceDisposition()" class="send-button md-accent md-raised" ng-disabled="voiceDispositionForm.$invalid" aria-label="ADD" translate="CONTACTMANAGER.ADD_VOICEDISPOSITION" translate-attr-aria-label="CONTACTMANAGER.ADD_VOICEDISPOSITION">\n ADD VOICEDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceDisposition" ng-click="vm.deleteVoiceDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="CONTACTMANAGER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/contactmanager/views/lists/lists.html",'<div id="lists" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-circle" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="CONTACTMANAGER.LISTS">Lists</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="CONTACTMANAGER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedLists.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedLists =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="CONTACTMANAGER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-lists-count">\n <span>{{vm.selectedLists.length}}</span>\n <span translate="CONTACTMANAGER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="LISTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllLists()" translate="CONTACTMANAGER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectLists()" translate="CONTACTMANAGER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedLists" csv-label="true" filename="lists.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedLists($event)" aria-label="delete selected" translate translate-attr-label="LISTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- LIST TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedLists" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getLists">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'CONTACTMANAGER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'CONTACTMANAGER.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'CONTACTMANAGER.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.lists.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="list" md-select-id="id" ng-repeat="list in vm.lists.rows">\n <td md-cell ng-if="list.userpic"><img class="avatar" alt="{{list.name}}" ng-src="api/users/{{list.id}}/avatar" /></td>\n <td md-cell ng-if="!list.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{list.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="id ">{{list.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="name ">{{list.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(list, ev) : vm.createOrEditList($event, list)" md-cell class="description ">{{list.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="CONTACTMANAGER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(list, $event)" translate="CONTACTMANAGER.EDIT_LIST">\n Edit List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotocontactsgoto(list, $event)" translate="CONTACTMANAGER.GOTOCONTACTS_LIST">\n goToContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.exportcsvcontactsexport(list, $event)" translate="CONTACTMANAGER.EXPORTCSVCONTACTS_LIST">\n exportCsvContacts List\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(list, $event)" translate="CONTACTMANAGER.AGENTADD_LIST">\n AgentAdd List\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(list, $event)" translate="CONTACTMANAGER.DELETE_LIST">\n Delete List\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'CONTACTMANAGER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'CONTACTMANAGER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'CONTACTMANAGER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.lists.count}}" md-on-paginate="vm.getLists" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / LIST TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD LIST BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-list-button" ng-click="vm.createOrEditList($event)" aria-label="add list" translate translate-attr-aria-label="CONTACTMANAGER.ADD_LIST">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD LIST BUTTON --\x3e\n</div>'),e.put("app/main/apps/dashboards/views/custom/custom.html",'<div ng-if="!vm.customDashboard">\n <p>Custom Dashboard not available...</p>\n</div>\n<div id="dashboard-custom" ng-if="vm.customDashboard" ng-cloak layout-fill>\n <md-content>\n <md-toolbar class="md-default md-accent filter-header">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm.customDashboard.name}}</span>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="DASHBOARDS.FILTER_VOICE_QUEUES">Filter Voice Queues</span>\n <md-select placeholder="Select one or more queues" class="font-size-12 no-margin w-200" md-on-close="vm.onChangeVoiceQueues()" ng-model="vm.voiceQueuesSelected" multiple aria-label="voiceQueues">\n <md-option ng-value="voiceQueue.id" ng-repeat="voiceQueue in vm.voiceQueues.rows">{{ voiceQueue.name }}</md-option>\n </md-select>\n </div>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button" ng-click="vm.goToEdit()" aria-label="goToEdit">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.EDIT"></span></md-tooltip>\n <md-icon md-font-icon="icon-table-edit"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <ms-widget-engine config="vm.customDashboard"></ms-widget-engine>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.home.permissions.html",'<md-content layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/agent.general.html",'<div id="agent-general" layout="column">\n <div layout="row" layout-align="start center" class="md-primary-bg">\n <md-button class="md-raised no-margin width-50" style="border-radius: 0px" ng-class="{\'md-primary\': !vm.isActiveTab(0)}" ng-click="vm.onClickTab(0)" aria-label="home">\n <md-tooltip md-direction="bottom" md-delay="500">Home</md-tooltip>\n <md-icon md-font-icon="icon-home" class="icon"></md-icon>\n </md-button>\n\n <ms-tab-scroll style="overflow: hidden;">\n <div layout="column" ng-repeat="(key, tab) in vm.tabs" ng-click="vm.onClickTab(tab.id)" ng-class="{\'grey-50-bg\': vm.isActiveTab(tab.id)}">\n <div style="height: 34px" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{tab.icon}}" class="icon s16 margin-horizontal-5" ng-class="tab.color + \'-fg\'"></md-icon>\n <span class="text-truncate font-size-12" ng-class="vm.isActiveTab(tab.id) ? \'black-fg\' : \'grey-300-fg\'">\n {{tab.title}} <span ng-if="tab.badges" class="badge md-white-fg md-red-bg">{{tab.badges}}</span></span>\n <md-button class="md-icon-button md-mini no-margin" ng-class="vm.isActiveTab(tab.id) ? \'md-primary\' : \'grey-300-fg\'" aria-label="close" ng-click="vm.closeTab(tab)">\n <md-icon md-font-icon="icon-close-circle-outline" class="icon s16"></md-icon>\n </md-button>\n </div>\n <div style="height: 2px" ng-class="vm.isActiveTab(tab.id) ? tab.color + \'-bg\' : \'\'"></div>\n </div>\n </ms-tab-scroll>\n </div>\n <div layout="row" class="agent-content" ng-if="vm.isActiveTab(0)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.html\'" ng-controller="AgentGeneralHomeController as vm_home" ng-init="vm_home.init(vm.license, vm.setting)"></div>\n <div ng-if="!vm.isActiveTab(0)" ng-repeat="(key, tab) in vm.tabs" ng-switch="tab.type">\n <div ng-switch-when="contact">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html\'" ng-controller="AgentGeneralContactController as vm" ng-init="vm.init(tab,$parent.vm.license)"></div>\n </div>\n <div ng-switch-when="popup">\n <div ng-if="vm.isActiveTab(tab.id)" ms-scroll ng-include="\'app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html\'" ng-controller="AgentGeneralPopupController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="jscripty">\n <div class="agent-content" ms-scroll ng-if="vm.isActiveTab(tab.id)" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html\'" ng-controller="AgentGeneralJscriptyController as vm" ng-init="vm.init(tab)"></div>\n </div>\n <div ng-switch-when="bot">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html\'" ng-controller="AgentGeneralBotController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n <div ng-switch-when="interaction">\n <div id="interaction-app" ng-if="vm.isActiveTab(tab.id)" class="agent-content" ng-style="{\'top\': vm.detectBrowser.browser == \'safari\' ? \'100px\' : \'36px\'}" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'" ng-controller="AgentGeneralInteractionController as vm" ng-init="vm.init(tab, $parent.vm.setting)"></div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/bot/agent.general.bot.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center">\n <div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent pink-fg" md-font-icon="fas fa-robot"></md-icon>\n </div>\n <span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n <span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the\n interaction...</span>\n </div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n <md-card flex="100" class="interaction">\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="fas fa-robot" class="s20 pink-fg"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.tab.data.uniqueid}} - {{vm.tab.title}}</span>\n \x3c!-- <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40"\n ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{ days > 0 ? days + \'d\' :\n \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div> --\x3e\n </div>\n </div>\n <div layout="row" layout-align="end center">\n\n </div>\n </div>\n </md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages">\n \x3c!-- MESSAGES --\x3e\n <div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\'" class="avatar" src="assets/images/avatars/robot.png">\n\n <div class="bubble" ng-switch="message.direction">\n <div>\n <div ng-switch-when="in" class="time secondary-text">\n {{vm.tab.title}} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n System - {{message.createdAt | date: \'medium\'}}\n </div>\n <div>\n <md-icon class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n </div>\n \x3c!-- / MESSAGES --\x3e\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n </md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/contact/agent.general.contact.html",'<md-tabs md-selected="vm.currentTab" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.DETAIL">Detail</span>\n </md-tab-label>\n <md-tab-body>\n <md-content>\n <div layout="row">\n \x3c!-- MS-CARD --\x3e\n <md-card class="template-7" layout="row" layout-align="space-between" ng-repeat="call in vm.tab.calls track by call.uniqueid">\n <div class="info" layout="column" layout-align="space-between" layout-fill flex>\n <div layout="row">\n <span ng-if="call.answeredAt" class="text-boxed indigo-100-bg">\n <timer start-time="call.answeredAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <div flex></div>\n <span ng-if="call.disposedAt" class="text-boxed amber-200-bg">\n <timer start-time="call.disposedAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n <div class="p-16">\n <div class="title h1">\n <md-icon ng-if="!call.routeId" md-font-icon="icon-phone-incoming"></md-icon>\n <md-icon ng-if="call.routeId" md-font-icon="icon-phone-outgoing"></md-icon>\n {{ call.routeId ? call.destcalleridnum : call.calleridnum }}\n </div>\n\n <div class="subtitle h4 secondary-text" ng-if="call.calleridname && call.calleridname != \'<unknown>\' && !call.routeId">\n <md-icon md-font-icon="icon-account"></md-icon>\n Name: {{ call.calleridname }}\n </div>\n\n <div class="text h4 pt-8" ng-if="call.queue">\n <md-icon md-font-icon="icon-stackoverflow"></md-icon>\n Queue: {{call.queue}}\n </div>\n <div class="text h4 pt-8" ng-if="call.variables.extravar">\n <md-icon md-font-icon="icon-minus"></md-icon>\n Extra: {{call.variables.extravar}}\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <md-button ng-if="call.disposedAt" type="submit" ng-click="vm.disposeCall($event, call)" class="send-button md-accent md-raised">\n {{ \'DASHBOARDS.DISPOSE\' | translate}}\n </md-button>\n </div>\n </div>\n </md-card>\n \x3c!-- / MS-CARD --\x3e\n <div flex layout="row" layout-align="end center">\n <md-button type="submit" ng-click="vm.mergeContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="merge">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.MERGE"></span></md-tooltip>\n <md-icon md-font-icon="icon-source-fork"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.duplicateContact($event)" class="send-button md-raised md-accent ng-scope" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="duplicate">\n <md-tooltip md-direction="top"><span translate="DASHBOARDS.DUPLICATE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n <md-button type="submit" ng-click="vm.addNewContact($event)" class="send-button md-accent md-raised" ng-if="vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="add">\n {{ \'DASHBOARDS.ADD\'| translate }}\n </md-button>\n <md-button type="submit" ng-click="vm.saveContact($event)" class="send-button md-accent md-raised" ng-if="!vm.newContact" ng-disabled="vm.detailForm.$invalid || vm.customFieldsForm.$invalid || vm.socialForm.$invalid" aria-label="save">\n {{ \'DASHBOARDS.SAVE\' | translate }}\n </md-button>\n </div>\n </div>\n <div layout="row">\n <div layout="column" flex="75">\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.PERSONAL_INFO">PERSONAL_INFO</div>\n <div class="subtitle secondary-text">\n <span translate="CONTACTMANAGER.CREATED_AT"></span> <span>{{vm.contact.createdAt | date:\'medium\'}}</span>\n </div>\n\n <form name="vm.detailForm" novalidate>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FIRSTNAME">First Name</label>\n <md-icon md-font-icon="icon-account" class="firstname"></md-icon>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" class="text-truncate" required>\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.FIRSTNAME_REQUIRED">First name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.jscripty" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="JSCRIPTY PROJECTS" ng-click="$mdOpenMenu($event)" aria-label="jscripty">\n <md-icon md-font-icon="icon-script"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.jscriptyProjects && vm.jscriptyProjects.rows.length" ng-repeat="project in vm.jscriptyProjects.rows">\n <md-button ng-click="vm.addJscriptyTab(project, $event)">\n <md-icon md-font-icon="icon-script"></md-icon> {{project.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.jscriptyProjects || !vm.jscriptyProjects.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_JSCRIPTY_PROJECTS_AVAILABLE">\n <md-icon md-font-icon="icon-script"></md-icon> No jscripty projects available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.LASTNAME">Last Name</label>\n <input type="text" name="lastName" ng-model="vm.contact.lastName" class="text-truncate">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <md-icon md-font-icon="icon-phone"></md-icon>\n <input type="text" name="phone" ng-model="vm.contact.phone" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.phone" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.phone" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.MOBILE">Mobile</label>\n <md-icon md-font-icon="icon-cellphone-iphone"></md-icon>\n <input type="text" name="mobile" ng-model="vm.contact.mobile" class="text-truncate">\n <div class="hint"><span ng-show="!vm.user.phoneBarRemoteControl || !vm.contact.mobile" translate="CONTACTMANAGER.HELP.PHONEBAR_API"></span></div>\n </md-input-container>\n <div>\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="vm.contact.mobile" prefix="vm.list ? vm.list.dialPrefix : null" license="vm.license" type="\'button\'"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </div>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.messaging || !vm.hasPermission(107) || !vm.contact.mobile" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW SMS" ng-click="$mdOpenMenu($event)" aria-label="sms">\n <md-icon md-font-icon="icon-message-text"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.smsAccounts && vm.smsAccounts.rows.length" ng-repeat="account in vm.smsAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Sms\', account, vm.contact.mobile)">\n <md-icon md-font-icon="icon-message-text"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.smsAccounts || !vm.smsAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_SMS_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-message-text"></md-icon> No sms accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <md-icon md-font-icon="icon-email" class="email"></md-icon>\n <input type="email" name="email" ng-model="vm.contact.email" class="text-truncate">\n <div ng-messages="vm.detailForm.firstName.$error" ng-show="vm.detailForm.firstName.$touched" role="alert">\n <div ng-message="email">\n <span translate="DASHBOARDS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.mail || !vm.hasPermission(106) || !vm.contact.email" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW EMAIL" ng-click="$mdOpenMenu($event)" aria-label="email">\n <md-icon md-font-icon="icon-email"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.mailAccounts && vm.mailAccounts.rows.length" ng-repeat="account in vm.mailAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Mail\', account, vm.contact.email)">\n <md-icon md-font-icon="icon-email"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.mailAccounts || !vm.mailAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_MAIL_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-email"></md-icon> No email accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n <div flex="5"></div>\n <div layout="row" flex>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.FAX">Fax</label>\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <input type="text" name="fax" ng-model="vm.contact.fax">\n </md-input-container>\n <div>\n <md-menu ng-if="!vm.newContact">\n <md-button ng-disabled="!vm.license.fax || !vm.hasPermission(109) || !vm.contact.fax" class="md-icon-button md-raised md-accent ng-scope md-ink-ripple" title="NEW FAX" ng-click="$mdOpenMenu($event)" aria-label="fax">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n </md-button>\n\n <md-menu-content>\n <md-menu-item ng-if="vm.faxAccounts && vm.faxAccounts.rows.length" ng-repeat="account in vm.faxAccounts.rows">\n <md-button ng-click="vm.composeInteraction($event, \'Fax\', account, vm.contact.fax)">\n <md-icon md-font-icon="icon-deskphone"></md-icon> {{account.name}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.faxAccounts || !vm.faxAccounts.rows.length">\n <md-button disabled="disabled" translate="DASHBOARDS.NO_FAX_ACCOUNTS_AVAILABLE">\n <md-icon md-font-icon="icon-deskphone"></md-icon> No fax accounts available\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="" ng-init="vm.contact.dateOfBirth = vm.getDateFromString(vm.contact.dateOfBirth)">\n <label translate="DASHBOARDS.DATE_OF_BIRTH">Date of Birth</label>\n <mdp-date-picker mdp-open-on-click mdp-format="YYYY-MM-DD" name="dateOfBirth" ng-model="vm.contact.dateOfBirth"></mdp-date-picker>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COMPANY">Company</label>\n <md-icon md-font-icon="icon-domain" class="email"></md-icon>\n <md-select name="company" ng-model="vm.contact.CompanyId">\n <md-option ng-value="company.id" ng-repeat="company in vm.tab.companies.rows">{{company.name}}</md-option>\n <md-option ng-value="null"><em translate="DASHBOARDS.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.TAG">TAG</label>\n <md-icon md-font-icon="icon-tag"></md-icon>\n <md-select ng-model="vm.tab.Tags" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm.tab.tags.rows">{{tag.name}}</md-option>\n </md-select>\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.COUNTRY">Country</label>\n <md-icon md-font-icon="icon-home" class="country"></md-icon>\n <input type="text" name="country" ng-model="vm.contact.country" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.CITY">City</label>\n <input type="text" name="city" ng-model="vm.contact.city">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.STREET">Street</label>\n <input type="text" name="street" ng-model="vm.contact.street">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate="DASHBOARDS.POSTALCODE">Postal Code</label>\n <input type="text" name="postalCode" ng-model="vm.contact.postalCode">\n </md-input-container>\n </div>\n\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label translate translate-attr-placeholder="DASHBOARDS.NOTES">Notes</label>\n <md-icon md-font-icon="icon-note"></md-icon>\n <textarea ng-model="vm.contact.description" type="text" max-rows="4"></textarea>\n </md-input-container>\n </div>\n </form>\n </md-card>\n <md-card layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.SOCIAL">Social</div>\n <form name="vm.socialForm" novalidate></form>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Facebook</label>\n <md-icon md-font-icon="icon-facebook" class="facebook"></md-icon>\n <input type="text" name="facebook" ng-model="vm.contact.facebook" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Twitter</label>\n <md-icon md-font-icon="icon-twitter" class="twitter"></md-icon>\n <input type="text" name="twitter" ng-model="vm.contact.twitter" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Line</label>\n <md-icon md-font-icon="fab fa-line"></md-icon>\n <input type="text" name="line" ng-model="vm.contact.line" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Viber</label>\n <md-icon md-font-icon="fab fa-viber"></md-icon>\n <input type="text" name="viber" ng-model="vm.contact.viber" class="text-truncate">\n </md-input-container>\n </div>\n <div layout-gt-sm="row" class="layout-gt-sm-row">\n <md-input-container class="md-block" flex-gt-sm="">\n <label>WeChat</label>\n <md-icon md-font-icon="fab fa-weixin"></md-icon>\n <input type="text" name="wechat" ng-model="vm.contact.wechat" class="text-truncate">\n </md-input-container>\n <div flex="5"></div>\n <md-input-container class="md-block" flex-gt-sm="">\n <label>Telegram</label>\n <md-icon md-font-icon="icon-telegram"></md-icon>\n <input type="text" name="telegram" ng-model="vm.contact.telegram" class="text-truncate">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n <div flex="25" layout="column" layout-padding>\n <md-card flex="100" layout-padding>\n <div class="h2 secondary-text text-truncate" translate="DASHBOARDS.CUSTOM_FIELDS">CUSTOM FIELDS</div>\n <form name="vm.customFieldsForm" novalidate>\n\n \x3c!-- START INPUT LIST --\x3e\n <md-input-container class="md-block" ng-if="!vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select name="list" ng-model="vm.contact.ListId" ng-change="vm.getCustomFields(vm.contact.ListId)" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.userLists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.contact.ListId">\n <label translate translate-attr-placeholder="DASHBOARDS.LIST">List</label>\n <md-select ng-disabled="!vm.newContact" name="list" ng-model="vm.contact.ListId" required>\n <md-optgroup label="Lists">\n <md-option ng-value="list.id" ng-repeat="list in vm.tab.lists.rows">#{{list.id}} - {{list.name}}</md-option>\n </md-optgroup>\n </md-select>\n </md-input-container>\n \x3c!-- END INPUT LIST --\x3e\n\n <div ng-repeat="customField in vm.tab.customFields.rows" ng-switch="customField.type">\n <md-input-container class="md-block" ng-switch-when="datetime">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <div ng-init="vm.contact[\'cf_\' + customField.id] = vm.getDateFromString(vm.contact[\'cf_\' + customField.id])">\n <mdp-date-picker mdp-open-on-click ng-required="customField.required" mdp-format="YYYY-MM-DD" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-date-picker>\n <mdp-time-picker mdp-open-on-click mdp-placeholder="Time" ng-required="customField.required" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.contact[\'cf_\' + customField.id]"></mdp-time-picker>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="select">\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <md-select ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n <md-option ng-repeat="value in customField.values" ng-value="value.value">{{value.value}}</md-option>\n <md-option ng-value="null"><em translate="CONTACTMANAGER.NONE">None</em></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-when="switch">\n <md-switch aria-label="{{customField.alias}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-true-value="1" ng-false-value="0">\n {{customField.alias}}<span ng-if="customField.required">*</span>\n </md-switch>\n </md-input-container>\n\n <md-input-container class="md-block" ng-switch-default>\n <label>{{customField.alias}}<span ng-if="customField.required">*</span></label>\n <input type="{{customField.type}}" ng-model="vm.contact[\'cf_\' + customField.id]" ng-required="customField.required">\n </md-input-container>\n </div>\n </form>\n </md-card>\n </div>\n </div>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Customer Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding" id="interaction-content">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/contact/dispose/dialog.html",'<md-dialog class="agent-dialog" aria-label="agent dispose">\n <form name="disposition" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.DISPOSE"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div ng-if="!vm.isReschedule">\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.choice" required>\n <md-option ng-value="g.name" ng-repeat="g in vm.dispositions.rows">{{ g.name }}</md-option>\n <md-option ng-value="gd.name" ng-repeat="gd in vm.globalDispositions.rows">{{ gd.name }}</md-option>\n </md-select>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n <textarea ng-model="vm.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n </div>\n\n <div ng-if="vm.isReschedule">\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.date.$error" ng-show="disposition.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="disposition.time.$error" ng-show="disposition.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n <md-input-container ng-if="!vm.dialerCall" class="md-block">\n <label translate="DASHBOARDS.CAMPAIGN">Campaign</label>\n <md-select name="queueCampaign" ng-model="vm.queueCampaign" required>\n <md-option ng-value="queueCampaign" ng-repeat="queueCampaign in vm.queueCampaigns.rows">{{ queueCampaign.name }} ({{ queueCampaign.dialActive ? \'Active\' : \'Not Active\' }})</md-option>\n </md-select>\n <div ng-messages="disposition.queueCampaign.$error" ng-show="disposition.queueCampaign.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.CAMPAIGN_REQUIRED">Campaign field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-if="!vm.isReschedule" layout="row">\n <md-button ng-disabled="disposition.$invalid || disposition.$pristine" class="send-button md-raised md-accent" ng-click="vm.saveDisposition()">\n {{(vm.choice ? \'DASHBOARDS.DISPOSE\' : \'DASHBOARDS.SAVE\') | translate}}\n </md-button>\n <md-button class="send-button md-raised md-primary" translate="DASHBOARDS.RESCHEDULE" ng-click="vm.saveDisposition(\'reschedule\')">\n Reschedule\n </md-button>\n <md-button class="send-button md-accent md-raised" translate="DASHBOARDS.RECALLME" ng-click="vm.saveDisposition(\'recallme\')">\n Recall Me\n </md-button>\n <span flex></span>\n <md-button ng-if="vm.hasBlackLists" class="md-raised md-warn" translate="DASHBOARDS.BLACKLIST" ng-click="vm.saveDisposition(\'blacklist\')">\n Blacklist\n </md-button>\n </md-dialog-actions>\n <md-dialog-actions ng-if="vm.isReschedule" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveReschedule()" class="send-button md-accent md-raised" ng-disabled="disposition.$invalid || disposition.$pristine || vm.disable" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/contact/reschedule/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="dateTime" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div layout="row">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="date" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" mdp-min-date="vm.hopper.minDate" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.date.$error" ng-show="dateTime.date.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="time" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.dateTime">\n <div ng-messages="dateTime.time.$error" ng-show="dateTime.time.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="DASHBOARDS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-disabled="vm.disable" ng-click="vm.saveDialog()" class="send-button md-accent md-raised" ng-disabled="dateTime.$invalid || dateTime.$pristine" aria-label="SAVE" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-selected="vm.selectedTab" md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110)" label="Voice">\n <div ng-controller="AgentHomeAbandonedVoiceController as vm_voice">\n <md-content ng-if="vm.selectedTab==0" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <div ng-controller="AgentHomeAbandonedBullController as vm_bull">\n <md-content ng-if="vm.selectedTab==1" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html\'" class="md-padding">\n </md-content>\n </div>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/bull/agent.general.abandoned.bull.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_bull.query.filter = query" on-collapse="vm_bull.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_bull.pickerModel.dateStart" ng-click="vm_bull.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_bull.localizationMap" ng-model="vm_bull.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_bull.getAbandonedCalls()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.lastAssignedTo" ng-change="vm_bull.getAbandonedCalls()">\n <md-option ng-value="vm_bull.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_bull.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_bull.query.queue" ng-change="vm_bull.getAbandonedCalls()">\n <md-option ng-value="vm_bull.defaultQueues" ng-if="vm_bull.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_bull.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm_bull.refresh && vm_bull.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_bull.showTooltip" md-visible="vm_bull.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.abandonedCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_bull.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName">{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_bull.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_bull.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitAt ? (abandonedCall.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerexitreason}}</td>\n <td md-cell class="list">{{abandonedCall.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_bull.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_bull.reserved(abandonedCall, abandonedCall.disposition)"></md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_bull.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm_bull.disposition.length" ng-repeat="disposition in vm_bull.disposition">\n <md-button ng-click="vm_bull.reserved(abandonedCall, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.abandonedCalls.count}}" md-on-paginate="vm_bull.getAbandonedCalls" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/abandoned/voice/agent.general.abandoned.voice.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header blue-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm_voice.query.filter = query" on-collapse="vm_voice.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm_voice.pickerModel.dateStart" ng-click="vm_voice.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm_voice.localizationMap" ng-model="vm_voice.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_voice.getAbandonedCalls()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.lastAssignedTo" ng-change="vm_voice.getAbandonedCalls()">\n <md-option ng-value="vm_voice.currentUser.name" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div ng-if="vm_voice.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm_voice.query.queue" ng-change="vm_voice.getAbandonedCalls()">\n <md-option ng-value="vm_voice.defaultQueues" ng-if="vm_voice.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm_voice.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm_voice.refresh && vm_voice.refreshAbandonedCalls($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm_voice.showTooltip" md-visible="vm_voice.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getAbandonedCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.RESERVED\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.abandonedCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="abandonedCall in vm_voice.abandonedCalls.rows">\n <td md-cell class="id">{{abandonedCall.id}}</td>\n <td md-cell class="firstName">{{abandonedCall.calleridname}}</td>\n <td md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="abandonedCall.calleridnum" license="vm_home.license" disabled="abandonedCall.lastAssignedTo !== vm_voice.currentUser.name"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="list">{{vm_voice.queuesMap[abandonedCall.queue]}}</td>\n <td md-cell class="list">{{abandonedCall.queuecallerabandonAt ? (abandonedCall.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{abandonedCall.disposition}}</td>\n <td md-cell class="actions">\n <md-switch no-margin ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name || !abandonedCall.lastAssignedTo" ng-disabled="vm_voice.disable[abandonedCall.id]" ng-model="abandonedCall.assigned" aria-label="reserved" ng-change="vm_voice.reserved(abandonedCall, abandonedCall.disposition)"></md-switch>\n </td>\n <td md-cell class="list">{{abandonedCall.lastAssignedTo}}</td>\n <td md-cell class="actions">\n <md-menu ng-if="abandonedCall.lastAssignedTo === vm_voice.currentUser.name">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="1">\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm_voice.disposition.length" ng-repeat="disposition in vm_voice.disposition">\n <md-button ng-click="vm_voice.reserved(abandonedCall, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.abandonedCalls.count}}" md-on-paginate="vm_voice.getAbandonedCalls" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/agent.general.home.html",'<div layout="column" layout-align="start center" class="md-primary-bg width-50" ms-scroll>\n <div ng-repeat="node in vm_home.navigation">\n <div ng-repeat="home in node.children">\n <md-button ng-repeat="button in home.children" ng-if="!button.hidden()" class="md-raised width-50 height-50 no-margin" style="border-radius: 0px" aria-label="{{button.state}}" ng-click="vm_home.changeSidebarTab(button)" ng-class="{\'md-primary\': vm_home.sidebar != button.state}">\n <md-tooltip md-direction="right" md-delay="500"><span translate="{{button.translate}}"></span></md-tooltip>\n <md-icon md-font-icon="{{button.icon}}" ng-class="button.iconClass"></md-icon>\n </md-button>\n </div>\n </div>\n</div>\n<div ng-switch="vm_home.sidebar" style="overflow-y: auto" flex>\n <div ng-switch-when="contacts">\n <div ng-if="vm_home.hasPermission(102) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html\'" ng-controller="AgentHomeContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(102) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mycontacts">\n <div ng-if="vm_home.hasPermission(103) && vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html\'" ng-controller="AgentHomeMyContactsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(103) || !vm_home.license.cm" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="scheduled">\n <div ng-if="vm_home.hasPermission(113) && vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html\'" ng-controller="AgentHomeScheduledCallsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(113) || !vm_home.license.dialer" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="voice">\n <div ng-if="vm_home.hasPermission(110) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html\'" ng-controller="AgentHomeVoiceController as vm"></div>\n <div ng-if="!vm_home.hasPermission(110) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="abandoned">\n <div ng-if="vm_home.hasPermission(111) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/abandoned/agent.general.abandoned.html\'" ng-controller="AgentHomeAbandonedController as vm"></div>\n <div ng-if="!vm_home.hasPermission(111) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="recordings">\n <div ng-if="vm_home.hasPermission(104) && vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html\'" ng-controller="AgentHomeRecordingsController as vm"></div>\n <div ng-if="!vm_home.hasPermission(104) || !vm_home.license.voice" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="chat">\n <div ng-if="vm_home.hasPermission(105) && vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html\'" ng-controller="AgentHomeChatController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(105) || !vm_home.license.chat" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-if="vm_home.hasPermission(106) && vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html\'" ng-controller="AgentHomeMailController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(106) || !vm_home.license.mail" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html\'" ng-controller="AgentHomeSmsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(107) || !vm_home.license.messaging" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html\'" ng-controller="AgentHomeOpenchannelController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(108) || !vm_home.license.openchannel" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-if="vm_home.hasPermission(109) && vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html\'" ng-controller="AgentHomeFaxController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting)"></div>\n <div ng-if="!vm_home.hasPermission(109) || !vm_home.license.fax" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-when="plugin" layout-fill>\n <div ng-if="vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html\'" ng-controller="AgentHomePluginsController as vm" ng-init="vm.onInit(vm_home.license, vm_home.setting, vm_home.plugin)" layout-fill></div>\n <div ng-if="!vm_home.hasPermission(vm_home.pluginId)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-if="vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html\'" ng-controller=" AgentHomeDashboardController as vm"></div>\n <div ng-if="!vm_home.hasPermission(101)" ng-include="\'app/main/apps/dashboards/views/general/agent/home/agent.general.home.permissions.html\'"></div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/chat/agent.general.chat.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getChatInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getChatInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_WEBSITE">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getChatInteractions()">\n <md-option ng-value="chatAccount.id" ng-repeat="chatAccount in vm.chatAccounts.rows">{{chatAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getChatInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getChatInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getChatInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChatInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.WEBSITE\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chatInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="chatInteraction in vm.chatInteractions.rows" ng-class="{\'text-bold text-italic\': chatInteraction.unread}">\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{chatInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!chatInteraction.closed && chatInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in chatInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!chatInteraction.closed && chatInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'chat\')" layout-margin>{{chatInteraction.unread}}</span>\n <md-icon ng-if="chatInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(chatInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{chatInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <div layout="row" ng-if="chatInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{chatInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{chatInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!chatInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell>\n <span ng-if="chatInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="chatInteraction.disposition">- {{chatInteraction.disposition}}</span></span>\n <md-tooltip ng-if="chatInteraction.closed">{{chatInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!chatInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="chatInteraction.substatus"> - {{chatInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(chatInteraction)}}</span>\n </td>\n <td ng-click="vm.showChatInteraction($event, chatInteraction)" md-cell class="chatAccount">\n {{ vm.getChatWebsiteLabel(chatInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="chatInteraction.Tags.length">\n <div ng-if="chatInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': chatInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{chatInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="chatInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in chatInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showChatInteraction($event, chatInteraction)" translate="DASHBOARDS.SHOW">\n Show Chat\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadChatInteraction($event, chatInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Chat\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chatInteractions.count}}" md-on-paginate="vm.getChatInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/contacts/agent.general.contacts.html",'<md-card>\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.CONTACTS">Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getContacts()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-icon-button interaction-new" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact(contact.id)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact.id)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact(contact.id)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact(contact.id)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/agent.general.dashboard.html",'<div ng-cloak>\n <md-content>\n <md-tabs md-dynamic-height md-border-bottom>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.voice" label="Voice">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html\'" ng-controller="AgentHomeDashboardVoiceController as vm_voice" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(110) && vm_home.license.dialer" label="Bull">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html\'" ng-controller="AgentHomeDashboardBullController as vm_bull" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(105) && vm_home.license.chat" label="Chat">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html\'" ng-controller="AgentHomeDashboardMultiChannelChatController as vm_chat" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(106) && vm_home.license.mail" label="Email">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html\'" ng-controller="AgentHomeDashboardMultiChannelMailController as vm_mail" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(107) && vm_home.license.messaging" label="Sms">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html\'" ng-controller="AgentHomeDashboardMultiChannelSmsController as vm_sms" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(108) && vm_home.license.openchannel" label="Open Channel">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html\'" ng-controller="AgentHomeDashboardMultiChannelOpenchannelController as vm_openchannel" class="md-padding">\n </md-content>\n </md-tab>\n <md-tab ng-if="vm_home.hasPermission(109) && vm_home.license.fax" label="Fax">\n <md-content ng-include="\'app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html\'" ng-controller="AgentHomeDashboardMultiChannelFaxController as vm_fax" class="md-padding">\n </md-content>\n </md-tab>\n </md-tabs>\n </md-content>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/bull/agent.general.dashboard.bull.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_bull.promise">\n <thead md-head md-order="vm_bull.query.sort" md-on-reorder="vm_bull.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.voiceQueues)">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_bull.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_bull.query.page" md-total="{{vm_bull.voiceQueuesTotal}}" md-on-paginate="vm_bull.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header red-900-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_bull.rpcVoiceQueuesChannels | limitObjectFromTo: vm_bull.queryChannels.limit:(vm_bull.queryChannels.page - 1) * vm_bull.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_bull.queryChannels.limit" md-page="vm_bull.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_bull.getSize(vm_bull.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/chat/agent.general.dashboard.chat.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_chat.promise">\n <thead md-head md-order="vm_chat.query.sort" md-on-reorder="vm_chat.getChatQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.getSize(vm_chat.chatQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_chat.chatQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_chat.query.page" md-total="{{vm_chat.chatQueuesTotal}}" md-on-paginate="vm_chat.getChatQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_chat.getColorByChannel(\'chat\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_chat.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_chat.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_chat.queryChannels.limit" md-page="vm_chat.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_chat.paginatedInteractions.length}}" md-on-paginate="vm_chat.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/fax/agent.general.dashboard.fax.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_fax.promise">\n <thead md-head md-order="vm_fax.query.sort" md-on-reorder="vm_fax.getFaxQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.getSize(vm_fax.faxQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_fax.faxQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_fax.query.page" md-total="{{vm_fax.faxQueuesTotal}}" md-on-paginate="vm_fax.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_fax.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_fax.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_fax.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_fax.queryChannels.limit" md-page="vm_fax.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_fax.paginatedInteractions.length}}" md-on-paginate="vm_fax.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/mail/agent.general.dashboard.mail.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_mail.promise">\n <thead md-head md-order="vm_mail.query.sort" md-on-reorder="vm_mail.getMailQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.getSize(vm_mail.mailQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_mail.mailQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_mail.query.page" md-total="{{vm_mail.mailQueuesTotal}}" md-on-paginate="vm_mail.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_mail.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_mail.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_mail.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_mail.queryChannels.limit" md-page="vm_mail.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_mail.paginatedInteractions.length}}" md-on-paginate="vm_mail.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/openchannel/agent.general.dashboard.openchannel.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_openchannel.promise">\n <thead md-head md-order="vm_openchannel.query.sort" md-on-reorder="vm_openchannel.getOpenchannelQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.getSize(vm_openchannel.openchannelQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_openchannel.openchannelQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_openchannel.query.page" md-total="{{vm_openchannel.openchannelQueuesTotal}}" md-on-paginate="vm_openchannel.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_openchannel.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_openchannel.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_openchannel.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_openchannel.queryChannels.limit" md-page="vm_openchannel.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_openchannel.paginatedInteractions.length}}" md-on-paginate="vm_openchannel.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/sms/agent.general.dashboard.sms.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_sms.promise">\n <thead md-head md-order="vm_sms.query.sort" md-on-reorder="vm_sms.getSmsQueues">\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.NAME\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.WAITING\' | translate }}</th>\n \x3c!-- <th md-column>{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.getSize(vm_sms.smsQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, queue) in vm_sms.smsQueues">\n <td md-cell class="name">{{queue.name}}</td>\n <td md-cell class="waiting">{{queue.waiting || 0}}</td>\n \x3c!-- <td md-cell class="dialActive ">\n <md-icon ng-if="queue.type === \'outbound\'" md-colors="{color: {{queue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n <md-icon ng-if="queue.type === \'inbound\'" md-colors="{color: \'green\'}" md-font-icon="icon-check"></md-icon>\n </td> --\x3e\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_sms.query.page" md-total="{{vm_sms.smsQueuesTotal}}" md-on-paginate="vm_sms.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm_sms.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.CHANNEL_WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'DASHBOARDS.ACCOUNT\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_QUEUE\' | translate }}</th>\n <th md-column>{{ \'DASHBOARDS.CHANNEL_FROM\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_sms.paginatedInteractions.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, interaction) in vm_sms.interactions">\n <td md-cell>{{interaction.account}}</td>\n <td md-cell>{{interaction.queue}}</td>\n <td md-cell>{{interaction.from}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_sms.queryChannels.limit" md-page="vm_sms.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_sms.paginatedInteractions.length}}" md-on-paginate="vm_sms.paginate" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/dashboard/voice/agent.general.dashboard.voice.html",'<div layout="row" ngCloak>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm_voice.promise">\n <thead md-head md-order="vm_voice.query.sort" md-on-reorder="vm_voice.getVoiceQueues">\n <tr md-row>\n <th md-column>{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th ng-if="voiceQueue.type === \'outbound\'" md-column>{{ \'VOICE.ACTIVE\' | translate }}</th>\n \x3c!-- <th md-column md-order-by="active">{{ \'VOICE.ACTIVE\' | translate }}</th> --\x3e\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.voiceQueues)">\n <td md-cell colspan="2">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, voiceQueue) in vm_voice.voiceQueues">\n <td md-cell class="name">{{voiceQueue.name}}</td>\n <td ng-if="voiceQueue.type === \'outbound\'" md-cell class="waiting">{{voiceQueue.dialMethod}}</td>\n <td md-cell class="waiting">{{voiceQueue.waiting || 0}}</td>\n <td md-cell ng-if="voiceQueue.type === \'outbound\'" class="dialActive ">\n <md-icon md-colors="{color: {{voiceQueue.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{voiceQueue.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_voice.query.page" md-total="{{vm_voice.voiceQueuesTotal}}" md-on-paginate="vm_voice.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n <md-card flex="50">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg ">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.WAITING_TEXT"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm_voice.rpcVoiceQueuesChannels | limitObjectFromTo: vm_voice.queryChannels.limit:(vm_voice.queryChannels.page - 1) * vm_voice.queryChannels.limit">\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm_voice.queryChannels.limit" md-page="vm_voice.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm_voice.getSize(vm_voice.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n </md-card>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/fax/agent.general.fax.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'fax\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getFaxInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getFaxInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="faxAccount.id" ng-repeat="faxAccount in vm.faxAccounts.rows">{{faxAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getFaxInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getFaxInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getFaxInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.faxAccounts.rows && vm.faxAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="faxAccount in vm.faxAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeFaxInteraction($event, faxAccount)">{{ faxAccount.name }} ({{ faxAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="faxInteraction in vm.faxInteractions.rows" ng-class="{\'text-bold text-italic\': faxInteraction.unread}">\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{faxInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!faxInteraction.closed && faxInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in faxInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!faxInteraction.closed && faxInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'fax\')" layout-margin>{{faxInteraction.unread}}</span>\n <md-icon ng-if="faxInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(faxInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{faxInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <div layout="row" ng-if="faxInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{faxInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{faxInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!faxInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell>\n <span ng-if="faxInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="faxInteraction.disposition">- {{faxInteraction.disposition}}</span></span>\n <md-tooltip ng-if="faxInteraction.closed">{{faxInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!faxInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="faxInteraction.substatus"> - {{faxInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(faxInteraction)}}</span>\n </td>\n <td ng-click="vm.showFaxInteraction($event, faxInteraction)" md-cell class="faxAccount">\n {{ vm.getFaxAccountLabel(faxInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="faxInteraction.Tags.length">\n <div ng-if="faxInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': faxInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{faxInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="faxInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in faxInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.SHOW">\n Show Fax\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadFaxInteraction($event, faxInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Fax\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxInteractions.count}}" md-on-paginate="vm.getFaxInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mail/agent.general.mail.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'mail\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getMailInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getMailInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column" ng-if="vm.query.closed == 0">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_SUBSTATUS">Select a sub status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.substatus" ng-change="vm.getMailInteractions()">\n <md-option ng-repeat="subStatus in vm.subStatuses.rows" ng-value="subStatus.name">{{subStatus.name}}</md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NONE"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getMailInteractions()">\n <md-option ng-value="mailAccount.id" ng-repeat="mailAccount in vm.mailAccounts.rows">{{mailAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getMailInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getMailInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getMailInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.mailAccounts.rows && vm.mailAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="mailAccount in vm.mailAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeMailInteraction($event, mailAccount)">{{ mailAccount.name }} ({{ mailAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="subject" style="width:200px">{{\'DASHBOARDS.SUBJECT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="mailInteraction in vm.mailInteractions.rows" ng-class="{\'text-bold text-italic\': mailInteraction.unread}">\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{mailInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!mailInteraction.closed && mailInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in mailInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!mailInteraction.closed && mailInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'mail\')" layout-margin>{{mailInteraction.unread}}</span>\n <md-icon ng-if="mailInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(mailInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div ng-if="vm.setting.enableEmailPreview && mailInteraction.lastMsgBody" class="tooltip-preview">\n <span class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n <md-card class="tooltip-preview-text" ng-style="{top: \'-\' + ((($index % 10) + 1) * 18) + \'px\'}">\n <md-card-content>{{mailInteraction.lastMsgBody}}<br>...</md-card-content>\n </md-card>\n </div>\n <span ng-if="!mailInteraction.lastMsgBody || !vm.setting.enableEmailPreview" class="text-truncate font-size-12" style="width:200px">{{mailInteraction.subject}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{mailInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <div layout="row" ng-if="mailInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{mailInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{mailInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!mailInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell>\n <span ng-if="mailInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="mailInteraction.disposition">- {{mailInteraction.disposition}}</span></span>\n <md-tooltip ng-if="mailInteraction.closed">{{mailInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!mailInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="mailInteraction.substatus"> - {{mailInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(mailInteraction)}}</span>\n </td>\n <td ng-click="vm.showMailInteraction($event, mailInteraction)" md-cell class="mailAccount">\n {{ vm.getMailAccountLabel(mailInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="mailInteraction.Tags.length">\n <div ng-if="mailInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': mailInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{mailInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="mailInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in mailInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showMailInteraction($event, mailInteraction)" translate="DASHBOARDS.SHOW">\n Show Mail\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMailInteraction($event, mailInteraction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMailInteraction($event, mailInteraction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailInteractions.count}}" md-on-paginate="vm.getMailInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/mycontacts/agent.general.mycontacts.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header red-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.MYCONTACTS">My Contacts</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_LIST">Select a list</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.ListId" ng-change="vm.getContacts()">\n <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows">{{list.name}}</md-option>\n <md-option ng-value="vm.defaultLists" ng-if="vm.lists.count > 1"><em translate="CONTACTMANAGER.ALL_CONTACTS">All</em></md-option>\n </md-select>\n </div>\n <div layout="column">\n <span class="font-size-10" translate="CONTACTMANAGER.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getContacts()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button interaction-reload" ng-click="vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n <md-button class="md-icon-button interaction-new" ng-click="vm.openContact($event)" aria-label="add contact" translate translate-attr-label="DASHBOARDS.ADD_CONTACT">\n <md-icon md-font-icon="icon-plus "></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="firstName">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="mobile">{{\'DASHBOARDS.MOBILE\' | translate}}</th>\n <th md-column md-order-by="fax">{{\'DASHBOARDS.FAX\' | translate}}</th>\n <th md-column md-order-by="email">{{\'DASHBOARDS.EMAIL\' | translate}}</th>\n <th md-column md-order-by="ListId">{{\'DASHBOARDS.LIST\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td ng-click="vm.openContact($event, contact)" md-cell class="id">{{contact.id}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="firstName">{{contact.firstName}} {{contact.lastName}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="phone">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.phone" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="mobile">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="contact.mobile" prefix="vm.listsMap[contact.ListId].dialPrefix" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="fax">{{contact.fax}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="email">{{contact.email}}</td>\n <td ng-click="vm.openContact($event, contact)" md-cell class="list">{{vm.listsMap[contact.ListId].name}}</td>\n <td md-cell class="tag">\n <div ng-if="contact.Tags.length">\n <div ng-if="contact.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': contact.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{contact.Tags[0].name}}</span>\n </div>\n <div ng-if="contact.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in contact.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.openContact($event, contact)" translate="DASHBOARDS.EDIT">\n Edit Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.mergeContact($event, contact)" translate="DASHBOARDS.MERGE">\n Merge Contact\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.duplicateContact($event, contact)" translate="DASHBOARDS.DUPLICATE">\n Duplicate Contact\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/openchannel/agent.general.openchannel.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'openchannel\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getOpenchannelInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getOpenchannelInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="openchannelAccount.id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">{{openchannelAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getOpenchannelInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getOpenchannelInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getOpenchannelInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.openchannelAccounts.rows && vm.openchannelAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeOpenchannelInteraction($event, openchannelAccount)">{{ openchannelAccount.name }} ({{ openchannelAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="openchannelInteraction in vm.openchannelInteractions.rows" ng-class="{\'text-bold text-italic\': openchannelInteraction.unread}">\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{openchannelInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!openchannelInteraction.closed && openchannelInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in openchannelInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!openchannelInteraction.closed && openchannelInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'openchannel\')" layout-margin>{{openchannelInteraction.unread}}</span>\n <md-icon ng-if="openchannelInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(openchannelInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{openchannelInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <div layout="row" ng-if="openchannelInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{openchannelInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{openchannelInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!openchannelInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell>\n <span ng-if="openchannelInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="openchannelInteraction.disposition">- {{openchannelInteraction.disposition}}</span></span>\n <md-tooltip ng-if="openchannelInteraction.closed">{{openchannelInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!openchannelInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="openchannelInteraction.substatus"> - {{openchannelInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(openchannelInteraction)}}</span>\n </td>\n <td ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" md-cell class="openchannelAccount">\n {{ vm.getOpenchannelAccountLabel(openchannelInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="openchannelInteraction.Tags.length">\n <div ng-if="openchannelInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': openchannelInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{openchannelInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="openchannelInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in openchannelInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.SHOW">\n Show Openchannel\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadOpenchannelInteraction($event, openchannelInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Openchannel\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelInteractions.count}}" md-on-paginate="vm.getOpenchannelInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/plugins/agent.general.plugins.html",'<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/home/recordings/agent.general.recordings.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header indigo-A100-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.RECORDINGS">Recordings</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceRecordings()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound" translate="VOICE.INBOUND">Inbound</md-option>\n <md-option value="outbound" translate="VOICE.OUTBOUND">Outbound</md-option>\n <md-option value="dialer" translate="VOICE.DIALER">Dialer</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column>{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell class="type">{{voiceRecording.type}}</td>\n <td md-cell class="uniqueid">{{voiceRecording.uniqueid}}</td>\n <td md-cell class="calleridnum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.calleridnum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="exten">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.exten" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="connectedlinenum">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceRecording.connectedlinenum" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="queue">{{voiceRecording.queue}}</td>\n <td md-cell class="rating">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio" ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/scheduled/agent.general.scheduled.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-grey-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.SCHEDULED_CALLS">Scheduled Calls</span>\n \x3c!-- <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar> --\x3e\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getScheduledCalls()" placeholder="{{ \'MOTIONDIALER.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div ng-if="vm.queueCampaigns.count" layout="column">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.VoiceQueueId" ng-change="vm.getScheduledCalls()">\n <md-option ng-value="undefined"><em translate="MOTIONDIALER.ALL">All</em></md-option>\n <md-option ng-value="queueCampaign.id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">{{queueCampaign.name}}</md-option>\n </md-select>\n </div>\n \x3c!-- <div layout="column">\n <span class="font-size-10" translate="MOTIONDIALER.SELECT_TYPE">Select type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.recallme" ng-change="vm.getScheduledCalls()">\n <md-option ng-value="undefined"><em translate="MOTIONDIALER.ALL">All</em></md-option>\n <md-option ng-value="1" translate="MOTIONDIALER.RECALLME">Recall me</md-option>\n <md-option ng-value="0" translate="MOTIONDIALER.INQUEUE">Recall in queue</md-option>\n </md-select>\n </div> --\x3e\n <md-button class="md-icon-button" ng-click="vm.getScheduledCalls()" aria-label="refresh scheuled calls" translate translate-attr-label="MOTIONDIALER.REFRESH_SCHEDULED_CALLS">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip>{{\'MOTIONDIALER.REFRESH_SCHEDULED_CALLS\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduledCalls">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CAMPAIGN\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.scheduledCalls.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="scheduledCall in vm.scheduledCalls.rows">\n <td md-cell>{{scheduledCall.Contact.firstName}} {{scheduledCall.Contact.lastName}}</td>\n <td md-cell>\n <ms-click-to-call target="scheduledCall.phone" license="vm_home.license"></ms-click-to-call>\n </td>\n <td md-colors="{color: {{ vm.isDateBeforeToday(scheduledCall.scheduledat) ? \'\\\'red\\\'\' : \'\\\'green\\\'\' }}}" md-cell>{{ scheduledCall.scheduledat | date:\'medium\' }}</td>\n <td md-cell>{{ vm.priorities[scheduledCall.priority] }}</td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'\\\'green\\\'\' : \'\\\'grey\\\'\' }}}" md-font-icon="{{ scheduledCall.recallme && scheduledCall.UserId == vm.currentUser.id ? \'icon-check\' : \'icon-close\' }}"></md-icon>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{ scheduledCall.Queue.dialActive? \'\\\'green\\\'\' : \'\\\'red\\\'\' }}}" md-font-icon="icon-checkbox-blank-circle"></md-icon> {{scheduledCall.Queue.name}}\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditQueueCampaignHopper($event, scheduledCall)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteConfirm(scheduledCall, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.scheduledCalls.count}}" md-on-paginate="vm.getScheduledCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/sms/agent.general.sms.html",'<md-card ngCloak>\n <md-toolbar class="md-table-toolbar md-default table-header" ng-class="vm.getColorByChannel(\'sms\')">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="DASHBOARDS.INTERACTIONS">Interactions</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getSmsInteractions()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_READ_UNREAD">Select Read/Unread</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.read" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.UNREAD">READ</md-option>\n <md-option value="1" translate="DASHBOARDS.READ">UNREAD</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_STATUS">Select a status</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.closed" ng-change="vm.getSmsInteractions()">\n <md-option value="0" translate="DASHBOARDS.OPENED">OPENED</md-option>\n <md-option value="1" translate="DASHBOARDS.CLOSED">CLOSED</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_ACCOUNT">Select an account</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.account" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="smsAccount.id" ng-repeat="smsAccount in vm.smsAccounts.rows">{{smsAccount.name}}</md-option>\n <md-option ng-value="null" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.UserId" ng-change="vm.getSmsInteractions()">\n <md-option ng-value="vm.user.id" translate="DASHBOARDS.ME"></md-option>\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n </md-select>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_TAG">Select a tag</span>\n <md-select id="tags" placeholder="Tags" multiple="true" class="font-size-12 no-margin" ng-model="vm.query.tag" ng-change="vm.getSmsInteractions()" style="color:white;">\n <md-option ng-repeat="tag in vm.tags.rows" ng-value="tag.id">{{tag.name}}</md-option>\n </md-select>\n </div>\n <div layout="column">\n <md-button class="md-icon-button interaction-reload" aria-label="Reload" translate translate-attr-aria-label="DASHBOARDS.RELOAD" ng-click="vm.getSmsInteractions()">\n <md-icon md-font-icon="icon-reload"></md-icon>\n </md-button>\n </div>\n <md-menu ng-if="vm.smsAccounts.rows && vm.smsAccounts.rows.length">\n <md-button class="md-icon-button interaction-new" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-repeat="smsAccount in vm.smsAccounts.rows">\n <md-button aria-label="compose" ng-click="vm.composeSmsInteraction($event, smsAccount)">{{ smsAccount.name }} ({{ smsAccount.key }})</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsInteractions">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column style="width:15px">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n </th>\n <th md-column style="width:180px">{{\'DASHBOARDS.CONTACT\' | translate}}</th>\n <th md-column md-order-by="createdAt">{{\'DASHBOARDS.STARTEDAT\' | translate}}</th>\n <th md-column md-order-by="lastMsgAt">{{\'DASHBOARDS.LAST_MESSAGE\' | translate}}</th>\n <th md-column md-order-by="closed">{{\'DASHBOARDS.STATUS\' | translate}}</th>\n <th md-column style="width:80px">{{\'DASHBOARDS.AGENT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.ACCOUNT\' | translate}}</th>\n <th md-column>{{\'DASHBOARDS.TAGS\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsInteractions.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="DASHBOARDS.NO_AVAILABLE_INTERACTION">No Available Interaction</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="smsInteraction in vm.smsInteractions.rows" ng-class="{\'text-bold text-italic\': smsInteraction.unread}">\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="id">\n <div layout="row" layout-align="start center">\n <span class="font-size-10">{{smsInteraction.id}}</span>\n </div>\n </td>\n <td md-cell>\n <div ng-if="!smsInteraction.closed && smsInteraction.Users.length">\n <md-icon md-font-icon="icon-eye" class="s16"></md-icon>\n <md-tooltip>\n <span ng-repeat="u in smsInteraction.Users">{{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersByKey[u.id].fullname | translate }}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column">\n <span ng-if="!smsInteraction.closed && smsInteraction.unread" class="badge white-fg" ng-class="vm.getColorByChannel(\'sms\')" layout-margin>{{smsInteraction.unread}}</span>\n <md-icon ng-if="smsInteraction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="font-size-12 text-truncate" style="width:180px" layout-margin>{{vm.getContactLabel(smsInteraction)}}</span>\n </div>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span class="font-size-10 text-truncate">{{smsInteraction.createdAt | formatdate }}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <div layout="row" ng-if="smsInteraction.lastMsgAt">\n <span>\n <md-icon md-font-icon="{{smsInteraction.lastMsgDirection == \'in\' ? \'icon-arrow-down-bold blue-grey-800-fg\' : \'icon-arrow-up-bold blue-grey-300-fg\'}}"></md-icon>\n </span>\n <div layout="column" layout-align="center center">\n <span class="font-size-10 text-truncate">{{smsInteraction.lastMsgAt | formatdate }}</span>\n </div </div> <span ng-if="!smsInteraction.lastMsgAt">No messages</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell>\n <span ng-if="smsInteraction.closed" class="red-fg font-size-12">{{ \'DASHBOARDS.CLOSED\' | translate}} <span ng-if="smsInteraction.disposition">- {{smsInteraction.disposition}}</span></span>\n <md-tooltip ng-if="smsInteraction.closed">{{smsInteraction.closedAt | formatdate }}</md-tooltip>\n <span ng-if="!smsInteraction.closed" class="green-fg font-size-12"><span translate="DASHBOARDS.OPENED"></span><span ng-if="smsInteraction.substatus"> - {{smsInteraction.substatus}}</span></span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="user">\n <span class="font-size-12 text-truncate" style="width:120px">{{vm.getUserLabel(smsInteraction)}}</span>\n </td>\n <td ng-click="vm.showSmsInteraction($event, smsInteraction)" md-cell class="smsAccount">\n {{ vm.getSmsAccountLabel(smsInteraction) }}\n </td>\n <td md-cell>\n <div ng-if="smsInteraction.Tags.length">\n <div ng-if="smsInteraction.Tags.length == 1" layout="column" layout-align="center center">\n <md-icon md-font-icon="icon-tag" ng-style="{\'color\': smsInteraction.Tags[0].color }"></md-icon>\n <span class="text-truncate">{{smsInteraction.Tags[0].name}}</span>\n </div>\n <div ng-if="smsInteraction.Tags.length > 1" layout="column" layout-align="center center">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in smsInteraction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.showSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.SHOW">\n Show Sms\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadSmsInteraction($event, smsInteraction)" translate="DASHBOARDS.DOWNLOAD">\n Download Sms\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'DASHBOARDS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'DASHBOARDS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'DASHBOARDS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsInteractions.count}}" md-on-paginate="vm.getSmsInteractions" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/agent.general.voice.html",'<md-card ng-init="vm.onInit()">\n <md-toolbar class="md-table-toolbar md-default table-header blue-A700-bg">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.CALLS">Calls</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="VOICE.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'VOICE.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceCalls()" placeholder="{{ \'VOICE.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="VOICE.SELECT_TYPE">Select a type</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.type" ng-change="vm.getVoiceCalls()">\n <md-option value="internal" translate="VOICE.INTERNAL">Internal</md-option>\n <md-option value="inbound" translate="VOICE.INBOUND">Inbound</md-option>\n <md-option value="outbound" translate="VOICE.OUTBOUND">Outbound</md-option>\n <md-option value="dialer" translate="VOICE.DIALER">Dialer</md-option>\n <md-option ng-value="null" translate="VOICE.ALL">All</md-option>\n </md-select>\n </div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceCalls">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="source">{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column md-order-by="destination">{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'VOICE.STARTEDAT\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'VOICE.ENDEDAT\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column>{{ \'VOICE.NOTE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceCalls.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="voiceCall in vm.voiceCalls.rows" ng-click="vm.showDetails(voiceCall, $event)">\n <td md-cell class="type">{{voiceCall.id}}</td>\n <td md-cell class="type">{{voiceCall.type}}</td>\n <td md-cell class="source">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.source" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="destination">\n \x3c!-- click to call directive --\x3e\n <ms-click-to-call target="voiceCall.destination" license="vm_home.license"></ms-click-to-call>\n \x3c!-- / click to call directive --\x3e\n </td>\n <td md-cell class="starttime">{{voiceCall.starttime | date:\'medium\' }}</td>\n <td md-cell class="endtime">{{voiceCall.endtime | date:\'medium\' }}</td>\n <td md-cell class="disposition">{{voiceCall.userDisposition}}</td>\n <td md-cell class="note">\n <md-icon ng-if="voiceCall.note" md-font-icon="icon-clipboard-outline"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.showDetails(voiceCall, $event)" translate="VOICE.DETAILS">\n Show Details\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceCalls.count}}" md-on-paginate="vm.getVoiceCalls" md-page-select></md-table-pagination>\n</md-card>'),e.put("app/main/apps/dashboards/views/general/agent/home/voice/details/dialog.html",'<md-dialog class="details-dialog" aria-label="details">\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="VOICE.DETAILS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.UNIQUEID">Uniqueid</p>\n <h4>{{vm.call.uniqueid}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.TYPE">Type</p>\n <h4>{{vm.call.type ? vm.call.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.SOURCE">Source</p>\n <h4>{{vm.call.source ? vm.call.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DESTINATION">Destination</p>\n <h4>{{vm.call.destination ? vm.call.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.STARTEDAT">Started At</p>\n <h4>{{vm.call.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ANSWEREDAT">Answered At</p>\n <h4>{{vm.call.answertime ? (vm.call.answertime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.ENDEDAT">Ended At</p>\n <h4>{{vm.call.endtime ? (vm.call.endtime | date:\'medium\') : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DURATION">Duration</p>\n <h4>{{vm.call.duration ? vm.call.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.BILLABLESECONDS">Billable Seconds</p>\n <h4>{{vm.call.billableseconds ? vm.call.billableseconds : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.DISPOSITION">Disposition</p>\n <h4>{{vm.call.userDisposition ? vm.call.userDisposition : \'--\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="VOICE.NOTE">Note</p>\n <h4>{{vm.call.note ? vm.call.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="button" ng-click="vm.closeDialog()" class="send-button md-accent md-raised" aria-label="DISPOSE" translate="VOICE.CLOSE" translate-attr-aria-label="VOICE.DISPOSE">\n CLOSE\n </md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.dialog.html",'<md-dialog id="agent-general-dialog" aria-label="Spy Dialog">\n <div id="interaction-app" class="agent-content" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html\'"></div>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/agent.general.interaction.html",'\x3c!-- CONTENT CARD --\x3e\n<md-content class="content-card" layout="row" layout-fill>\n\n <div ng-if="!vm.showInteraction" class="start-point" flex layout="column" layout-align="center center" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html\'"></div>\n\n <div ng-if="vm.showInteraction" flex layout="row">\n\n <md-card flex="75" class="interaction">\n\n <md-content class="interaction-agents" layout="row" layout-align="start center" ng-if="!vm.interaction.closed && vm.interaction.Users.length">\n <strong layout-margin translate="DASHBOARDS.CURRENTLY_IN_USE_BY">Currently in use by </strong>\n\n <div ng-repeat="u in vm.interaction.Users">\n <img class="avatar-small" ng-src="api/users/{{u.id}}/avatar">\n <md-tooltip> {{ (u.id == vm.user.id) ? \'DASHBOARDS.ME\' : vm.usersMap[u.id] | translate }} </md-tooltip>\n </div>\n </md-content>\n\n \x3c!-- TOOLBAR --\x3e\n <md-toolbar class="interaction-toolbar" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html\'"></md-toolbar>\n \x3c!-- / TOOLBAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <md-content id="interaction-content" name="{{\'interaction-content-\' + vm.tab.id}}" flex ms-scroll layout-wrap>\n <div class="interaction-messages" ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html\'"></div>\n </div>\n <div ng-switch-default>\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html\'"></div>\n </div>\n </div>\n </md-content>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- FOOTER --\x3e\n <div ng-if="!vm.interaction.closed && vm.tab.channel != \'mail\' && vm.tab.channel !== \'fax\' && (vm.tab.channel != \'sms\' || !vm.tab.spy)" class="interaction-footer flex-noshrink" layout="row" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html\'"></div>\n \x3c!-- / FOOTER--\x3e\n </md-card>\n\n <md-card layout="column" flex class="info" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html\'"></md-card>\n </div>\n</md-content>\n\x3c!-- / CONTENT CARD --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeFax/dialog.html",'<md-dialog class="compose-dialog-fax" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="FAX.SEND">SEND</span>\n </md-button>\n <md-button ng-disabled="vm.message.attachments.length === 1" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="FAX.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-input-container class="md-block to">\n <label translate="FAX.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n \x3c!-- <input ng-model="vm.message.subject" type="text"> --\x3e\n <md-autocomplete ng-hide="vm.message.to.length === 1" md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.fax" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" ng-if="composeForm.$dirty">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n <div ng-message="md-max-chips">You reached the maximum amount of chips</div>\n </div>\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="FAX.DELETE_ATTACHMENT">\n \x3c!-- <md-icon md-font-icon="icon-close" class="s16"></md-icon> --\x3e\n </md-button>\n </div>\n </div>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeMail/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message" ng-style="{\n \'max-width\': {true: \'620px\', false: \'90%\'}[ vm.secret ],\n \'width\': {true: \'620px\', false: \'100%\'}[ vm.secret ],\n \'max-height\': {true: undefined, false: \'97%\'}[ vm.secret ]\n }">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar ng-class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <div ng-if="!vm.secret" class="md-button md-raised blue-bg no-padding">\n <button class="white-fg margin-horizontal-10" aria-label="Send message" ng-disabled="!vm.verifySmtp" ng-click="vm.send($event, false, null)">\n <span>{{ \'MAIL.SEND\' | translate | uppercase }}</span>\n </button>\n <span class="white-fg secondary-text vertical-divider"></span>\n <md-menu>\n <button ng-disabled="!vm.verifySmtp" class="white-fg margin-left-0" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-menu-down" class="icon s24"></md-icon>\n </button>\n\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.subStatuses.rows.length">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="MAIL.SEND_AS">\n Send as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.send($event, false, subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.send($event, true, null)" translate="MAIL.SEND_AND_CLOSE">\n Send and Close\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="MAIL.ADD_NOTE">Add note</span>\n </md-button>\n <md-button ng-disabled="!vm.verifySmtp" class="md-fab md-mini md-white-bg" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload($files)" flow-init="vm.ngFlowOptions" flow-file-success="vm.fileSuccess($file, $message)" flow-file-added="vm.fileAdded($file)">\n <md-icon md-font-icon="icon-paperclip" class="red-fg"></md-icon>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="MAIL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container ng-if="!vm.secret" class="md-block to" ng-class="{\'hidden-cc\': vm.hiddenCC, \'hidden-bcc\': vm.hiddenBCC}">\n <label translate="MAIL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip, vm.message.to)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n\n <div class="cc-bcc" layout="row" layout-align="start center">\n <div class="show-cc" ng-show="vm.hiddenCC" ng-click="vm.hiddenCC = false">CC</div>\n <div class="show-bcc" ng-show="vm.hiddenBCC" ng-click="vm.hiddenBCC = false">BCC</div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenCC">\n <label translate="MAIL.CC">Cc</label>\n <md-chips name="cc" ng-model="vm.message.cc" md-transform-chip="vm.transformContact($chip, vm.message.cc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchCc" md-items="contact in vm.contactSearch(vm.searchCc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block" ng-hide="vm.hiddenBCC">\n <label translate="MAIL.BCC">Bcc</label>\n <md-chips name="bcc" ng-model="vm.message.bcc" md-transform-chip="vm.transformContact($chip, vm.message.bcc)" md-separator-keys="vm.separatorKeys" md-require-match="false" required>\n <md-autocomplete md-search-text="vm.searchBcc" md-items="contact in vm.contactSearch(vm.searchBcc)" md-item-text="contact.email" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n </md-input-container>\n\n <md-input-container ng-if="!vm.secret" class="md-block no-margin">\n <label translate="MAIL.SUBJECT">Subject</label>\n <input ng-model="vm.message.subject" type="text">\n </md-input-container>\n\n <div class="attachment-list" ng-if="vm.message.attachments.length" layout="row" layout-wrap>\n <div class="attachment" layout="row" layout-align="space-between center" ng-repeat="attachment in vm.message.attachments">\n <div>\n <md-icon md-font-icon="icon-paperclip" class="s16"></md-icon>\n <span class="filename">{{attachment.name}}</span>\n <span class="size" ng-if="attachment.size">({{attachment.size | byteFmt: 0}})</span>\n </div>\n\n <md-button ng-click="vm.deleteAttachment(attachment)" class="md-icon-button" aria-label="Delete attachment" translate translate-attr-aria-label="MAIL.DELETE_ATTACHMENT">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div class="padding-top-5">\n <textarea ckeditor="vm.ckeditor" id="html-area" ng-model="vm.message.body" md-select-on-focus="" ready="vm.onReadyEditor()"></textarea>\n </div>\n\n <md-switch ng-if="!vm.message.showLastMessage && !vm.secret" ng-model="vm.message.showLastMessage" ng-change="vm.loadLastMessage()" aria-label="load last message"><span translate="MAIL.SHOW_ORIGINAL_MESSAGE">Show original message</span></md-switch>\n\n <md-autocomplete ng-if="!vm.secret" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'MAIL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.MailAccountId" md-font-icon="icon-earth" aria-label="alert email" class="s16"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email" aria-label="alert email" class="s16 teal-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{ item.key }} - {{ item.value | htmlToPlaintext }}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="MAIL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeOpenchannel/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="OPENCHANNEL.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="OPENCHANNEL.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="OPENCHANNEL.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="OPENCHANNEL.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mapkey" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'OPENCHANNEL.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'OPENCHANNEL.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.OpenchannelAccountId" md-font-icon="icon-earth" aria-label="alert openchannel" class="s16"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-message-text" aria-label="alert openchannel" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="OPENCHANNEL.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/composeSms/dialog.html",'<md-dialog class="compose-dialog" aria-label="New Message">\n <form class="md-inline-form" name="composeForm" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <div layout="row">\n <md-button ng-if="!vm.secret" ng-click="vm.send()" class="md-raised md-blue-bg white-fg" aria-label="Send message">\n <span translate="SMS.SEND">SEND</span>\n </md-button>\n <md-button ng-if="vm.secret" ng-click="vm.addNote()" class="md-raised md-blue-bg white-fg" aria-label="Add note">\n <span translate="SMS.ADD_NOTE">Add note</span>\n </md-button>\n </div>\n <span ng-if="!vm.secret" class="title">{{vm.message.from}}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()" aria-label="Close dialog" tranlate translate-aria-label="SMS.CLOSE_DIALOG">\n <md-icon md-font-icon="icon-close"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container ng-if="!vm.secret" class="md-block to">\n <label translate="SMS.TO">To</label>\n <md-chips name="to" ng-model="vm.message.to" md-transform-chip="vm.transformContact($chip)" md-separator-keys="vm.separatorKeys" md-require-match="false" md-max-chips="1" required>\n <md-autocomplete md-search-text="vm.searchTo" md-items="contact in vm.contactSearch(vm.searchTo)" md-item-text="contact.mobile" md-min-length="3">\n <md-item-template>\n <span>{{ vm.getContact(contact) }}</span>\n </md-item-template>\n </md-autocomplete>\n </md-chips>\n <div ng-messages="composeForm.to.$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TO_REQUIRED">To field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.message.body" placeholder="\'SMS.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <md-autocomplete ng-if="!vm.secret" class="padding-top-5" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" md-floating-label="{{ \'SMS.CANNED_ANSWER_SEARCH\' | translate}}" class="input-show-hide no-container-margin">\n <md-item-template>\n <md-icon ng-if="!item.SmsAccountId" md-font-icon="icon-earth" aria-label="alert sms" class="s16"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text" aria-label="alert sms" class="s16 orange-fg"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="SMS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/dispose/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition" ng-init="vm.onInit()">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="!vm.interaction.closed" class="title" translate="DASHBOARDS.DISPOSE"></span>\n <span ng-if="vm.interaction.closed" class="title" translate="DASHBOARDS.INFO"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.DISPOSITIONS">Dispositions</label>\n <md-select name="disposition" ng-model="vm.interaction.disposition" required>\n \x3c!-- <md-select ng-disabled="vm.interaction.closed && vm.interaction.disposition" name="disposition" ng-model="vm.interaction.disposition" required> --\x3e\n <md-option ng-value="null">NONE</md-option>\n <md-option ng-value="d.name" ng-repeat="d in vm.dispositions.rows">{{ d.name }}</md-option>\n <md-option ng-value="gd.name" ng-repeat="gd in vm.globalDispositions.rows">{{ gd.name }}</md-option>\n </md-select>\n <div ng-messages="dispositionForm.disposition.$error" ng-show="dispositionForm.disposition.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.NOTE">Note</label>\n \x3c!-- <textarea ng-disabled="vm.interaction.closed && vm.interaction.disposition" ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea> --\x3e\n <textarea ng-model="vm.interaction.note" md-maxlength="255" max-rows="5" autofocus></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && vm.interaction.disposition" aria-label="CLOSE_AND_DISPOSE" translate="DASHBOARDS.CLOSE_AND_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_AND_DISPOSE">\n CLOSE AND DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition(false)" class="send-button md-accent md-raised" ng-if="!vm.interaction.closed && !vm.interaction.disposition && !vm.mandatoryDisposition" aria-label="CLOSE_WITHOUT_DISPOSE" translate="DASHBOARDS.CLOSE_WITHOUT_DISPOSE" translate-attr-aria-label="DASHBOARDS.CLOSE_WITHOUT_DISPOSE">\n CLOSE WITHOUT DISPOSE\n </md-button>\n <md-button type="submit" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-if="vm.interaction.closed" aria-label="DISPOSE" translate="DASHBOARDS.DISPOSE" translate-attr-aria-label="DASHBOARDS.DISPOSE">\n DISPOSE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/tag/dialog.html",'<md-dialog class="tag-dialog" aria-label="tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TAGS"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-chips ng-model="vm.interaction.Tags" md-autocomplete-snap md-require-match="vm.autocompleteRequireMatch">\n <md-autocomplete ng-blur="vm.searchText = \'\'" md-min-length="0" md-selected-item-change="vm.selectedItemChange" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-items="item in vm.tags.rows | filter:{ name: vm.searchText }" md-item-text="item.name" placeholder="Search for a tag">\n <span md-highlight-text="vm.searchText">{{item.name}}</span>\n </md-autocomplete>\n <md-chip-template>\n <span>\n <strong>{{$chip.name}}</strong>\n </span>\n </md-chip-template>\n </md-chips>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.saveTag(false)" ng-disabled="tagForm.$pristine" class="send-button md-accent md-raised" aria-label="TAG" translate="DASHBOARDS.SAVE" translate-attr-aria-label="DASHBOARDS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/transfer/dialog.html",'<md-dialog class="disposition-dialog" aria-label="disposition">\n <form name="transferForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="DASHBOARDS.TRANSFER"></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(false)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="DASHBOARDS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.transfer.type" required>\n <md-option ng-value="\'queue\'" ng-if="vm.account.queueTransfer">Queue</md-option>\n <md-option ng-value="\'agent\'" ng-if="vm.account.agentTransfer">Agent</md-option>\n </md-select>\n <div ng-messages="transferForm.type.$error" ng-show="transferForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'queue\'">\n <label translate="DASHBOARDS.QUEUES">Queues</label>\n <md-select name="queue" ng-model="vm.transfer.id" required>\n <md-option ng-value="queue.id" ng-repeat="queue in vm.queues.rows">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.queue.$error" ng-show="transferForm.queue.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.transfer.type === \'agent\'">\n <label translate="DASHBOARDS.AGENTS">Agents</label>\n <md-select name="agent" ng-model="vm.transfer.id" required>\n <md-option ng-value="agent.id" ng-repeat="agent in vm.agents.rows" ng-if="vm.currentUser.id != agent.id">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="transferForm.agent.$error" ng-show="transferForm.agent.$touched" role="alert">\n <div ng-message="required">\n <span translate="DASHBOARDS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n \x3c!-- <md-dialog-actions ng-if="!vm.interaction.closed || !vm.interaction.disposition" layout="row" layout-align="space-between center"> --\x3e\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.onTransfer(true)" ng-disabled="transferForm.$pristine" class="send-button md-accent md-raised" aria-label="DASHBOARDS.TRANSFER" translate="DASHBOARDS.TRANSFER" translate-attr-aria-label="DASHBOARDS.TRANSFER">\n TRANSFER\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.footer.html",'\x3c!-- REPLY FORM --\x3e\n<div ng-show="vm.showFooter" layout="column" layout-align "center center" flex>\n <div layout="row" layout-align="center center" flex>\n \x3c!-- msEmojyArea directive --\x3e\n <ms-emoji-area ng-if="vm.tab.channel != \'fax\'" on-reply="vm.reply(event, body)" ctrl-methods="vm.ctrlMethods" ng-model="vm.tab.areaText" placeholder="vm.tab.channel.toUpperCase() + \'.INSERT_MESSAGE_HERE\'"></ms-emoji-area>\n \x3c!-- / msEmojyArea directive --\x3e\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm.tab.channel != \'fax\'" style="margin:1px;" class="md-icon-button md-mini" ng-click="vm.changeDisplayCannedAnswerInputValue()" aria-label="Search canned answer" translate translate-attr-aria-label="DASHBOARDS.SEND_MESSAGE">\n <md-icon md-font-icon="icon-auto-fix" class="green-fg"></md-icon>\n </md-button>\n\n <md-button ng-if="vm.tab.channel == \'openchannel\' || vm.tab.channel == \'chat\' || vm.tab.channel == \'fax\'" style="margin:1px;" class="md-icon-button md-warn md-mini" aria-label="attachment" translate-attr-aria-label="DASHBOARDS.ATTACHMENT" flow-btn flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-init="vm.ngFlowOptions" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)">\n <md-icon md-font-icon="icon-paperclip"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-autocomplete ng-hide="!vm.displayCannedAnswerInput" md-selected-item="vm.selectedItem" md-search-text="vm.searchText" md-selected-item-change="vm.selectedItemChange(item)" md-items="item in vm.searchTextChange(vm.searchText)" md-item-text="item.value" md-min-length="1" placeholder="{{ \'DASHBOARDS.CANNED_ANSWER_SEARCH\' | translate}}" class="cannedarea input-show-hide">\n <md-item-template>\n <md-icon ng-if="!item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="icon-earth" aria-label="alert channel" class="s16"></md-icon>\n <md-icon ng-if="item[vm.tab.channel === \'chat\' ? \'ChatWebsiteId\' : _.capitalize(vm.tab.channel) + \'AccountId\']" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" aria-label="alert channel" class="s16" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span md-highlight-text="vm.searchText" md-highlight-flags="^i">{{item.key}} - {{item.value}}</span>\n </md-item-template>\n\n <md-not-found>\n <span translate="DASHBOARDS.CANNED_ANSWER_NOT_FOUND">No canned answers were found</span>\n </md-not-found>\n </md-autocomplete>\n</div>\n\x3c!-- / REPLY FORM --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.browserName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.BROWSER_NAME">Browser Name</p>\n <h4>{{item.browserName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.osName">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.OS_NAME">OS Name</p>\n <h4>{{item.osName}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.deviceModel">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DEVICE_MODEL">Device Model</p>\n <h4>{{item.deviceModel}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.referer">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.REFERER">Referer</p>\n <h4>{{item.referer}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.customerIp">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CUSTOMER_IP">Customer IP</p>\n <h4>{{item.customerIp}}</h4>\n </div>\n </md-list-item>\n <md-divider></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed && item.ratingValue != null">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.RATING">Rating</p>\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="!item.ratingType || item.ratingType == \'star\'" ng-repeat="ratingValue in [1,2,3,4,5] | limitTo:item.ratingValue"></md-icon>\n <md-icon md-font-icon="icon-thumb-up" style="color:green" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 1"></md-icon>\n <md-icon md-font-icon="icon-thumb-down" style="color:red" ng-show="item.ratingType && item.ratingType == \'thumb\' && item.ratingValue == 0"></md-icon>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.ratingMessage">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.FEEDBACK">Feedback</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{item.ratingMessage}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.html",'<md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CONTACT">Contact</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <form name="contactForm" class="md-inline-form" novalidate>\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-account"></md-icon>\n <label translate="DASHBOARDS.NAME">Name</label>\n <input type="text" name="firstName" ng-model="vm.contact.firstName" disabled>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-icon md-font-icon="icon-email"></md-icon>\n <label translate="DASHBOARDS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.contact.email" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel != \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-phone"></md-icon>\n <label translate="DASHBOARDS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.contact.phone" disabled>\n </md-input-container>\n\n <md-input-container ng-if="vm.tab.channel == \'fax\'" class="md-block">\n <md-icon md-font-icon="icon-deskphone"></md-icon>\n <label translate="DASHBOARDS.FAX">Fax</label>\n <input type="text" name="fax" ng-model="vm.contact.fax" disabled>\n </md-input-container>\n\n <div ng-if="!vm.tab.spy" layout="row" layout-align="center center">\n <md-button class="md-raised md-accent" ng-click="vm.openContact(ev)" translate="DASHBOARDS.MORE">\n More\n </md-button>\n </div>\n </form>\n </md-content>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.INTERACTION">Interaction</span>\n </md-tab-label>\n <md-tab-body>\n <div layout="column" layout-align="space-between center" class="md-padding">\n <md-icon class="s42" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <span ng-if="vm.interaction.closed" class="md-background-bg red-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.CLOSED"></span></span>\n <span ng-if="!vm.interaction.closed" class="md-background-bg green-fg font-size-14">#{{vm.interaction.id}} - <span translate="DASHBOARDS.OPENED"></span></span>\n <span ng-if="!vm.interaction.closed && vm.interaction.substatus" class="md-background-bg green-fg font-size-14">{{vm.interaction.substatus}}</span>\n </div>\n <md-divider></md-divider>\n <md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.WEBSITE" ng-if="vm.tab.channel == \'chat\'">Website</p>\n <p translate="DASHBOARDS.ACCOUNT" ng-if="vm.tab.channel != \'chat\'">Account</p>\n <h4>{{vm.account.name}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[vm.interaction.UserId]}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{vm.interaction.externalUrl}}" target="_blank">\n <h4>{{vm.interaction.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{vm.interaction.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="chat">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n <div ng-switch-when="openchannel">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html\'"></div>\n </div>\n </div>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.Tags.length">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TAGS">Tags</p>\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n </md-list-item>\n\n <md-divider ng-if="vm.interaction.closed"></md-divider>\n\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{vm.interaction.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="vm.interaction.closed && vm.interaction.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ vm.interaction.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="vm.interaction.closed && vm.interaction.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ vm.interaction.note }}</h4>\n </div>\n </md-list-item>\n </md-list>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="DASHBOARDS.CUSTOMER_JOURNEY">Journey</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="md-padding">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html\'"></div>\n </md-content>\n </md-tab-body>\n </md-tab>\n</md-tabs>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.AGENT">Agent</p>\n <h4>{{vm.agent.fullname || vm.usersMap[item.UserId] || \'DASHBOARDS.NOT_ASSIGNED\' | translate}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line" ng-if="item.externalUrl">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.EXTERNAL_URL">External URL</p>\n <a href="{{item.externalUrl}}" target="_blank">\n <h4>{{item.externalUrl}}</h4>\n </a>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CREATED_AT">Created At</p>\n <h4>{{item.createdAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <div ng-if="item.ChatWebsiteId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.chat.html\'"></div>\n </div>\n <div ng-if="item.MailAccountId">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html\'"></div>\n </div>\n\n <md-divider ng-if="item.closed"></md-divider>\n <md-list-item class="md-2-line" ng-if="item.closed">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CLOSED_AT">Closed At</p>\n <h4>{{item.closedAt | date: \'medium\'}}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" ng-if="item.closed && item.disposition">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DISPOSITION">Disposition</p>\n <h4>{{ item.disposition }}</h4>\n </div>\n </md-list-item>\n <md-list-item class="md-3-line md-long-text" ng-if="item.closed && item.note">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">NOTE</p>\n <h4 style="overflow-wrap: break-word; white-space: normal">{{ item.note }}</h4>\n </div>\n </md-list-item>\n\n <p class="padding-horizontal-15 grey-fg">Tags</p>\n <md-list-item ng-if="item.Tags.length">\n <div class="tags padding-bottom-5" layout="row" layout-align="start center" layout-wrap>\n <div class="tag margin-right-5 margin-top-5 margin-bottom-5" layout="row" layout-align="center center" ng-repeat="tag in item.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.html",'<md-content layout="column" layout-align="end center">\n <div layout-margin>\n <md-input-container>\n <md-select ng-model="vm.channel" placeholder="Channel">\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL">All</md-option>\n <md-option ng-value="\'voice\'" translate="DASHBOARDS.VOICE">Voice</md-option>\n <md-option ng-value="\'chat\'">Chat</md-option>\n <md-option ng-value="\'mail\'">Mail</md-option>\n <md-option ng-value="\'sms\'">Sms</md-option>\n <md-option ng-value="\'fax\'">Fax</md-option>\n <md-option ng-value="\'openchannel\'">Openchannel</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div layout-margin layout="row" layout-align="space-between center">\n <div flex-gt-xs>\n <md-datepicker ng-model="vm.dateFrom" md-placeholder="Enter date"></md-datepicker>\n </div>\n\n <div flex-gt-xs>\n <md-datepicker ng-model="vm.dateTo" md-placeholder="Enter date"></md-datepicker>\n </div>\n </div>\n</md-content>\n\n<div id="timeline" ms-timeline="vm.timelineOptions" layout="column" ng-if="vm.journey && vm.journey.length">\n \x3c!-- TIMELINE ITEM --\x3e\n <div class="ms-timeline-item" layout-align="center center" ng-repeat="item in vm.journey | getChannelByItem:vm.channel:vm.dateFrom:vm.dateTo | orderBy:\'-createdAt\'">\n <div class="timeline-card">\n <md-card class="channel" ng-class="{\'md-grey-200-bg\': item.id == vm.interaction.id}">\n <div class="header p-6" layout="row" layout-align="space-between center">\n\n <md-button class="md-fab md-mini" aria-label="icon-channel" ng-class="vm.getColorByItem(item) + \'-bg\'">\n <md-icon ng-if="item.FaxAccountId" md-font-icon="icon-deskphone"></md-icon>\n <md-icon ng-if="item.OpenchannelAccountId" md-font-icon="icon-google-earth"></md-icon>\n <md-icon ng-if="item.SmsAccountId" md-font-icon="icon-message-text"></md-icon>\n <md-icon ng-if="item.MailAccountId" md-font-icon="icon-email"></md-icon>\n <md-icon ng-if="item.ChatWebsiteId" md-font-icon="icon-hangouts"></md-icon>\n <md-icon ng-if="item.amaflags" md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <div class="info" layout="column" ng-init="item.showMore = false">\n <span class="font-size-12 text-truncate">#{{item.id}} - {{ item.Account.key || item.destination }}</span>\n <span class="font-size-10">{{item.createdAt | date: \'medium\'}}</span>\n <span>\n <a class="toggle-details md-accent-color" ng-hide="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="item.showMore" ng-click="item.showMore = !item.showMore" translate="DASHBOARDS.HIDE_DETAILS">\n Hide Details\n </a>\n </span>\n </div>\n\n <span>\n <img ng-if="item.UserId" class="avatar" ng-src="api/users/{{item.UserId}}/avatar">\n <md-tooltip md-direction="left">{{item.Owner.fullname || item.User.fullname}}</md-tooltip>\n </span>\n\n </div>\n\n <div ng-if="item.showMore">\n <div ng-if="!item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.all.html\'"></div>\n <div ng-if="item.amaflags" ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html\'"></div>\n </div>\n\n <md-divider></md-divider>\n\n <div ng-if="item.id != vm.interaction.id" layout="row" layout-align="space-around center">\n <div ng-if="item.closed && !amaflags" class="text-truncate white-fg">\n <span class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} ({{ item.disposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate)}})">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.CLOSED\' | translate}} ({{ item.disposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate) }})</span>\n </div>\n <span class="text-boxed md-background-bg green-fg" ng-if="!item.closed && !item.amaflags" title="{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}">{{ \'DASHBOARDS.STATUS\' | translate}}: {{ \'DASHBOARDS.OPENED\' | translate}}<span ng-if="item.substatus"> - {{ item.substatus }}</span></span>\n <span ng-if="item.amaflags" class="text-boxed md-background-bg red-fg" title="{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || \'No Dispose\'}}">{{ \'DASHBOARDS.DISPOSITION\' | translate}}: {{ item.userDisposition || (\'DASHBOARDS.NO_DISPOSITION_SET\' | translate)}}</span>\n <div flex></div>\n <md-button ng-if="!vm.tab.spy && vm.user.role === \'agent\' && vm.isMyAccount(item)" ng-disabled="item.amaflags" class="md-icon-button" aria-label="go" ng-click="vm.openInteraction($event, item)">\n <md-icon md-font-icon="icon-open-in-new" class="s20"></md-icon>\n </md-button>\n\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / TIMELINE ITEM --\x3e\n</div>\n<div ng-if="!vm.journey || !vm.journey.length" layout="row" layout-align="center center">\n <em translate="DASHBOARDS.NO_DATA_AVAILABLE">No data available</em>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.journey.voice.html",'<md-divider></md-divider>\n\n<md-list flex>\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.TYPE">Type</p>\n <h4>{{item.type ? item.type : \'no type\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SOURCE">Source</p>\n <h4>{{item.source ? item.source : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DESTINATION">Destination</p>\n <h4>{{item.destination ? item.destination : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.CALLERID">Caller Id</p>\n <h4>{{item.callerid ? item.callerid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.STARTEDAT">Started At</p>\n <h4>{{item.starttime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.UNIQUEID">Uniqueid</p>\n <h4>{{item.uniqueid ? item.uniqueid : \'unknown\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.END_AT">End At</p>\n <h4>{{item.endtime | date:\'medium\'}}</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.DURATION">Duration</p>\n <h4>{{item.duration ? item.duration : \'--\'}}s</h4>\n </div>\n </md-list-item>\n\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.NOTE">Note</p>\n <h4>{{item.note ? item.note : \'--\'}}</h4>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.mail.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line" ng-if="item.subject">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.SUBJECT">Subject</p>\n <h4>{{item.subject}}</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.info.openchannel.html",'<div ng-init="item = item || vm.interaction">\n <md-list-item class="md-2-line">\n <div class="md-list-item-text">\n <p translate="DASHBOARDS.VISIBILITY">Visibility</p>\n <h4 ng-if="item.threadId" translate="DASHBOARDS.PUBLIC">Public</h4>\n <h4 ng-if="!item.threadId" translate="DASHBOARDS.PRIVATE">Private</h4>\n </div>\n </md-list-item>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.html",'\x3c!-- MESSAGES --\x3e\n<div layout="row" ng-repeat="message in vm.messages.rows" class="md-padding message-row" ng-class="vm.getMessagesAlignment(message)">\n <img ng-if="message.direction ===\'in\'" src="assets/images/avatars/customer.png" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && !message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && message.UserId && message.secret" ng-src="api/users/{{message.UserId}}/avatar" class="avatar" />\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n <md-button ng-if="vm.tab.channel === \'fax\'" class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n\n <div class="bubble" ng-class="{\'md-yellow-200-bg\': message.secret}" ng-switch="message.direction">\n <div ng-if="message.secret">\n <div class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id">\n <md-icon class="s18" md-font-icon="icon-lock"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="!message.secret">\n <div ng-switch-when="in" class="time secondary-text" ng-click="message.Contact && vm.openContact(ev, message.Contact)">\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-switch-when="out" class="time secondary-text" layout="row" layout-align="end center">\n <div layout-padding>\n {{ vm.getLabelByMessage(message) }} - {{message.createdAt | date: \'medium\'}}\n </div>\n <div ng-if="message.id && vm.tab.channel !== \'fax\'">\n <md-icon ng-if="!message.read" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n <div ng-if="message.id && vm.tab.channel === \'fax\'">\n <md-icon ng-if="!message.read && !(message.failMessage )" class="s18" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read" class="s18" md-font-icon="icon-check-all md-accent"></md-icon>\n <span ng-if="!message.read && message.failMessage" class="s18 red-900-fg"> {{ message.failMessage }}</span>\n <md-icon ng-if="!message.read && message.failMessage" class="s18 red-900-fg" md-font-icon="icon-close md-accent"></md-icon>\n </div>\n </div>\n </div>\n <div ng-if="message.AttachmentId" layout="row" layout-align="end center">\n <md-button class="md-raised md-accent" ng-click="vm.getAttachment({id: message.AttachmentId, name: vm.htmlToPlaintext(message.body)})">\n <span>{{vm.htmlToPlaintext(message.body)}}</span>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n </div>\n <div ng-if="!message.AttachmentId" ng-bind-html="message.body | embed:vm.emojiOptions" class="message" layout="row" layout-align="end center"></div>\n </div>\n</div>\n\x3c!-- / MESSAGES --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.interaction.mail.html",'<div ms-timeline="vm.timelineOptions" ms-timeline-load-more="vm.loadNextPage()">\n <div ng-repeat="message in vm.messages.rows track by message.id" ng-init="vm.selectedMailShowSystemMessage[message.id] = false">\n <md-card ng-if="message.secret" class="md-padding md-yellow-100-bg" layout="column">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <div layout="column">\n <span class="grey-fg">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n <div layout="row" layout-align="center center" layout-fill ng-if="message.attach">\n <div flex>\n <md-divider></md-divider>\n </div>\n <md-menu>\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n <div class="padding-top-5" ng-bind-html-unsafe="message.body"></div>\n </md-card>\n <div ng-if="!message.secret">\n <div layout="row" layout-align="center center" ng-if="message.direction == \'out\' && !message.UserId && !vm.selectedMailShowSystemMessage[message.id]">\n <md-button class="md-raised blue-grey-300-bg white-fg" ng-click="vm.selectedMailShowSystemMessage[message.id] = !vm.selectedMailShowSystemMessage[message.id]">[{{message.createdAt | date: \'medium\'}}] {{ \'MAIL.SHOW_AUTOREPLY\' | translate }}</md-button>\n </div>\n <md-card layout="column" class="md-padding message-row" ng-if="message.direction == \'in\' || (message.direction == \'out\' && (message.UserId || vm.selectedMailShowSystemMessage[message.id]))">\n <md-content class="mail-content">\n <div class="info" layout="row" layout-align="space-between start">\n <div layout="column" layout-align="start start">\n <div layout="row" layout-align="start start">\n <div layout="column" layout-align="start start">\n <div class="name" ng-click="message.Contact && vm.openContact(ev, message.Contact)"><strong>{{message.from}}</strong>\n <md-icon ng-if="message.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <div class="name">\n <div>{{message.subject}}</div>\n </div>\n <div class="name" layout="row" layout-align="start center"><span translate="MAIL.TO">To</span>: <span class="padding-left-5 subject text-truncate">{{ message.originTo || message.to }}</span></div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.originCc && message.originCc.indexOf(vm.account.email) >= 0"><em><span class="blue-grey" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are registered as a</span> <span class="blue-grey">CC</span></em></div>\n <div class="name padding-top-10" layout="row" layout-align="start center" ng-if="message.direction == \'in\' && message.bcc && message.bcc.indexOf(vm.account.email) >= 0"><em><span class="red-fg" translate="MAIL.YOU_ARE_REGISTERED_AS_A">You are registered as a</span> <span class="red-fg">BCC</span></em></div>\n </div>\n </div>\n\n <a class="toggle-details md-accent-color" ng-hide="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.SHOW_DETAILS">\n Show Details\n </a>\n <a class="toggle-details md-accent-color" ng-show="vm.selectedMailShowDetails[message.id]" ng-click="vm.selectedMailShowDetails[message.id] = !vm.selectedMailShowDetails[message.id]" translate="MAIL.HIDE_DETAILS">\n Hide Details\n </a>\n <div ng-show="vm.selectedMailShowDetails[message.id]" class="details" layout="row" layout-align="start start">\n <div layout="column">\n <span class="title" translate="MAIL.DATE">Date:</span>\n <span class="title" translate="MAIL.FROM">From:</span>\n <span class="title" translate="MAIL.TO">To:</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && message.originCc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">Cc:</span>\n <span class="title" translate="MAIL.CC" ng-if="message.direction === \'out\' && message.cc">Cc:</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="title" translate="MAIL.BCC" ng-if="message.bcc">Bcc:</span>\n <span class="title" translate="MAIL.ACCEPTED" ng-if="message.UserId && message.direction ===\'in\'">Accepted:</span>\n </div>\n\n <div layout="column">\n <span class="detail">{{message.createdAt | date:\'medium\'}}</span>\n <span class="detail">{{message.from}}</span>\n <span class="detail">{{message.originTo || message.to}}</span>\n \x3c!-- NOTE: Start retrocompatibility with replyCc 2.0.66 --\x3e\n <span class="detail" ng-if="message.direction === \'in\' && message.originCc">{{ message.originCc }}</span>\n <span class="detail" ng-if="message.direction === \'in\' && !message.originCc && !message.originTo && message.cc">{{ message.cc }}</span>\n <span class="detail" ng-if="message.direction === \'out\' && message.cc">{{ message.cc }}</span>\n \x3c!-- End retrocompatibility --\x3e\n <span class="detail" ng-if="message.bcc">{{message.bcc}}</span>\n <span class="detail" ng-if="message.UserId && message.direction ===\'in\'">{{vm.usersMap[message.UserId]}}</span>\n </div>\n </div>\n </div>\n\n <div layout="row" layout-align="center center">\n <div layout="column" layout-align="center end" class="md-padding">\n <span class="grey-fg" ng-if="message.direction ===\'in\'">{{message.from.indexOf(vm.contact.email) >= 0 ? vm.contact.firstName + \' \' + vm.contact.lastName : \'*\' + message.from}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && message.UserId">{{vm.agent.fullname || vm.usersMap[message.UserId]}}</span>\n <span class="grey-fg" ng-if="message.direction ===\'out\' && !message.UserId">System</span>\n <span class="grey-fg">{{message.createdAt | date:\'medium\'}}</span>\n </div>\n <img ng-if="message.direction ===\'in\'" ng-src="assets/images/avatars/customer.png" class="avatar" alt="customer" />\n <img ng-if="message.direction ===\'out\' && message.UserId" class="avatar" ng-src="api/users/{{message.UserId}}/avatar">\n <img ng-if="message.direction ===\'out\' && !message.UserId" class="avatar" src="assets/images/avatars/robot.png">\n \x3c!-- <md-button class="md-fab md-mini no-margin" aria-label="Download" ng-click="vm.downloadMessage(message)">\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button> --\x3e\n </div>\n </div>\n\n <div layout="row" layout-align="center center" layout-fill>\n <div flex>\n <md-divider></md-divider>\n </div>\n <div>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n </md-button>\n <md-button ng-if="!message.attach" class="md-icon-button" aria-label="forward" ng-click="vm.downloadMessage(message)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu ng-if="message.attach" class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadMessage(message)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n <md-menu ng-if="message.attach">\n <md-button aria-label="attachments" class="md-icon-button" ng-click="vm.getAttachments(message); $mdOpenMenu($event);">\n <md-tooltip md-direction="bottom"><span translate="MAIL.ATTACHMENTS">Attachments</span></md-tooltip>\n <div layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-paperclip" class="icon s24"></md-icon><span>{{message.attach}}</span>\n </div>\n </md-button>\n <md-menu-content width="4">\n <div layout="column" layout-align="center center" ng-if="!message.attachments">\n <md-progress-circular md-mode="indeterminate"></md-progress-circular>\n <span translate="MAIL.ATTACHMENTS">Attachments</span>\n </div>\n <md-menu-item ng-if="message.attachments" ng-repeat="attachment in message.attachments">\n <md-button ng-click="vm.getAttachment(attachment)">{{ attachment.name || (\'attachment-\' + $index) }}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n <div flex>\n <md-divider></md-divider>\n </div>\n </div>\n\n <md-content ng-bind-html-unsafe="message.body"></md-content>\n </md-content>\n </md-card>\n </div>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.loading.html",'<div class="big-circle md-whiteframe-4dp">\n <md-icon class="s128 md-accent" md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n</div>\n<span class="app-title" translate="DASHBOARDS.WAITING">Waiting</span>\n<span class="hide show-gt-md secondary-text" translate="DASHBOARDS.LOADING_INTERACTION">We are loading the interaction...</span>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeFaxInteraction(\'new\')">\n <md-tooltip md-direction="bottom"><span translate="FAX.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.html",'<div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="{{vm.getIconByChannel(vm.tab.channel)}}" class="s20" ng-class="vm.getColorByChannel(vm.tab.channel) + \'-fg\'"></md-icon>\n <div class="padding-left-10" layout="column" layout-align="center start" flex>\n <div class="font-size-14" layout="row" layout-align="start center" layout-fill>\n <span>#{{vm.interaction.id}} - {{vm.account.key}}</span>\n <div layout="row" layout-align="center center" class="p-8">\n <md-icon ng-if="vm.tab.channel === \'openchannel\' && vm.interaction.threadId" md-font-icon="fas fa-users" class="s16">\n <md-tooltip><span translate="DASHBOARDS.PUBLIC_INTERACTION">The interaction is public</span></md-tooltip>\n </md-icon>\n <md-icon ng-if="vm.interaction.attach" md-font-icon="icon-paperclip" class="s16"></md-icon>\n </div>\n <span class="red-fg padding-left-25" ng-if="vm.interaction.closed" translate="DASHBOARDS.CLOSED">CLOSED</span>\n <span class="green-fg padding-left-25" ng-if="!vm.interaction.closed"><span translate="DASHBOARDS.OPENED">OPENED</span><span ng-if="vm.interaction.substatus"> - {{vm.interaction.substatus}}</span></span>\n <div layout="row" layout-align="center center" class="blue-grey-300-fg padding-left-40" ng-if="!vm.interaction.closed">\n <timer start-time="vm.interaction.createdAt" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-icon md-font-icon="icon-timelapse" class="s16 padding-left-5"></md-icon>\n </div>\n </div>\n <div class="tags" layout="row" layout-align="start center" ng-if="vm.interaction.Tags.length" ng-class="{\'padding-top-5\': vm.interaction.Tags.length}">\n <div class="tag margin-right-5" layout="row" layout-align="center center" ng-repeat="tag in vm.interaction.Tags">\n <div class="tag-color" ng-style="{\'background\': tag.color}"></div>\n <div class="tag-label">{{tag.name}}</div>\n </div>\n </div>\n </div>\n <div layout="row" layout-align="end center">\n <div ng-switch="vm.tab.channel">\n <div ng-switch-when="mail">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html\'"></div>\n </div>\n <div ng-switch-when="fax">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.fax.html\'"></div>\n </div>\n <div ng-switch-when="sms">\n <div ng-include="\'app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html\'"></div>\n </div>\n </div>\n <md-button ng-if="vm.tab.channel !== \'mail\'" class="md-icon-button" aria-label="Download" ng-click="vm.downloadInteraction(vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="DASHBOARDS.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download" class="icon s24"></md-icon>\n </md-button>\n <md-menu class="no-margin" ng-if="!vm.interaction.disposition" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.tagInteraction()" translate="DASHBOARDS.TAG">\n Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.account.queueTransfer || vm.account.agentTransfer">\n <md-button ng-click="vm.transferLastMessage()" translate="DASHBOARDS.TRANSFER">\n Transfer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && (vm.subStatuses.rows.length || vm.interaction.substatus != null)">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.SET_AS">\n Set as\n </md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.interaction.substatus != null">\n <md-button ng-click="vm.setAs(null)" translate="DASHBOARDS.NONE">\n None\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="subStatus in vm.subStatuses.rows">\n <md-button ng-click="vm.setAs(subStatus.name)">\n {{subStatus.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if="!vm.interaction.closed && vm.tab.channel == \'mail\' && vm.account.markAsUnread">\n <md-button ng-click="vm.markAsUnread()" translate="DASHBOARDS.MARK_AS_UNREAD">\n Unread\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && !vm.interaction.closed">\n <md-button ng-click="vm.disposeInteraction()" translate="DASHBOARDS.CLOSE_AND_DISPOSE">\n Close and Dispose\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="!vm.tab.spy && vm.interaction.closed && !vm.interaction.disposition">\n <md-button ng-click="vm.disposeInteraction(ev)" translate="DASHBOARDS.DISPOSE">\n Dispose\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.mail.html",'<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="reply" ng-click="vm.composeMailInteraction(\'reply\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY">Reply</span></md-tooltip>\n <md-icon md-font-icon="icon-reply" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="replyAll" ng-click="vm.composeMailInteraction(\'replyAll\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.REPLY_ALL">Reply All</span></md-tooltip>\n <md-icon md-font-icon="icon-reply-all" class="icon s24"></md-icon>\n</md-button>\n<md-button ng-if="!vm.interaction.closed && !vm.tab.spy" class="md-icon-button" aria-label="forward" ng-click="vm.composeMailInteraction(\'forward\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.FORWARD">Forward</span></md-tooltip>\n <md-icon md-font-icon="icon-forward" class="icon s24"></md-icon>\n</md-button>\n<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeMailInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="MAIL.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>\n<md-menu class="no-margin" md-position-mode="target-right target">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu()" aria-label="download">\n <md-tooltip md-direction="bottom"><span translate="MAIL.DOWNLOAD">Download</span></md-tooltip>\n <md-icon md-font-icon="icon-download"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadInteraction(vm.interaction)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n </md-menu-content>\n</md-menu>'),e.put("app/main/apps/dashboards/views/general/agent/interaction/views/agent.general.toolbar.sms.html",'<md-button class="md-icon-button" aria-label="note" ng-click="vm.composeSmsInteraction(\'note\', vm.interaction)">\n <md-tooltip md-direction="bottom"><span translate="SMS.NOTE">Note</span></md-tooltip>\n <md-icon md-font-icon="icon-note-outline" class="icon s24"></md-icon>\n</md-button>'),e.put("app/main/apps/dashboards/views/general/agent/jscripty/agent.general.jscripty.html",'<md-content class="md-padding" layout="column" layout-align="center center">\n <div layout="row" layout-align="center center">\n <span ng-if="!vm.tab.saved" class="text-boxed md-green-bg">\n <timer start-time="vm.starttime" interval="1000">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span ng-if="vm.contact" class="text-boxed md-gray-bg font-weight-900">{{vm.contact.firstName}} {{vm.contact.lastName}} {{vm.contact.phone}}</span>\n <md-button ng-if="vm.showResetButton" ng-click="vm.resetViewer()" md-no-ink class="md-raised md-accent orange-bg">\n <md-icon md-font-icon="icon-rotate-left" class="icon s16"></md-icon> {{\'JSCRIPTY.RESET_SESSION\' | translate}}\n </md-button>\n <md-button ng-if="vm.contact" ng-click="vm.openContact($event, vm.contact)" md-no-ink class="md-raised md-accent" translate="JSCRIPTY.OPEN_CONTACT"></md-button>\n <md-button ng-if="vm.showIncompleteSubmitButton" ng-click="vm.onSubmit($event, true)" md-no-ink class="md-raised md-accent green-bg" translate="JSCRIPTY.SUBMIT"></md-button>\n </div>\n <h1 ng-if="!vm.project.formData"><span translate="JSCRIPTY.PROJECT_NOT_AVAILABLE">Project is not available. Please contact the administrator</span></h1>\n <mw-form-viewer ng-if="vm.project.formData" form-data="vm.project.formData" response-data="vm.project.responseData" on-submit="vm.onSubmit($event)" template-data="call" api="vm.formViewer"></mw-form-viewer>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/agent/notification/dialog.html",'\x3c!-- <md-toast> --\x3e\n<div class="md-padding" layout="column" layout-align="center center">\n <span class="md-title">#{{vm.notification.id}} {{vm.notification.title}}</span>\n <span class="md-subhead" ng-if="vm.notification.queue">{{vm.notification.queue}}</span>\n <div class="padding-top-5" layout="row">\n <md-button class="md-raised md-accent" ng-click="vm.accept($event)" translate="DASHBOARDS.ACCEPT">\n ACCEPT\n </md-button>\n <md-button class="md-raised md-warn" ng-click="vm.reject($event)" translate="DASHBOARDS.REJECT">\n REJECT\n </md-button>\n </div>\n</div>\n\x3c!-- </md-toast> --\x3e'),e.put("app/main/apps/dashboards/views/general/agent/popup/agent.general.popup.html",'<md-content class="md-padding" flex>\n <div ng-if="vm.html" ng-bind-html="vm.html"></div>\n <h1 ng-if="!vm.html">Template is empty. Please contact the administrator</h1>\n</md-content>'),e.put("app/main/apps/dashboards/views/general/user/chat/user.general.chat.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-hangouts" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_MANAGED_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_MANAGED_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_MANAGED_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ABANDONED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.ABANDONED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDONED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/dialer/user.general.dialer.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_MOTION_BULL_STATS">Today Motion Bull STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{(vm.inbound.talking || 0) + (vm.inbound.pTalking || 0)}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayCallersExit || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.outboundDropCallsDayTimeout || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROPPED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.DROPPED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROPPED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.originated || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.ORIGINATED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundanswerRate || 0 |number : 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundAbandonRate || 0}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.outboundDropRate }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.DROP_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.DROP_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.DROP_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e\n\n\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_IVR_CAMPAIGNS_STATS">Today IVR campaigns stats</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.ivr.originated || 0}}/{{vm.ivr.limitCalls || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.ORIGINATED\' | translate | uppercase}}/{{\'DASHBOARDS.LIMITED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.LIMITED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ORIGINATEDLIMITED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET IVR --\x3e'),e.put("app/main/apps/dashboards/views/general/user/fax/user.general.fax.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-deskphone" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/mail/user.general.mail.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-email" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/openchannel/user.general.openchannel.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-google-earth" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/sms/user.general.sms.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-message-text" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INTERACTIONS_STATS">Today Interactions STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OPENED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.OPENED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OPENED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="50">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.MANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.MANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.MANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.UNMANAGED_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.UNMANAGED_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.UNMANAGED_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e'),e.put("app/main/apps/dashboards/views/general/user/user.general.html",'<div id="dashboard-general" class="page-layout simple right-sidenav" layout="row">\n \x3c!-- CENTER --\x3e\n <div class="center" flex ms-scroll>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n \x3c!-- NOTE: aggoiungere nel controller ng-if="vm.hasPermission()" --\x3e\n <md-tabs ng-if="vm.hasPermission()" md-selected="vm.selectedTab" md-dynamic-height>\n <md-tab ng-if="vm.license.voice" label="{{\'DASHBOARDS.VOICE\' | translate}}" ui-sref="app.dashboards.general.voice">\n <div ui-view="voice"></div>\n </md-tab>\n <md-tab ng-if="vm.license.dialer" label="{{\'DASHBOARDS.MOTIONDIALER\' | translate}}" ui-sref="app.dashboards.general.dialer">\n <div ui-view="dialer"></div>\n </md-tab>\n <md-tab ng-if="vm.license.chat" label="{{\'DASHBOARDS.CHAT\' | translate}}" ui-sref="app.dashboards.general.chat">\n <div ui-view="chat"></div>\n </md-tab>\n <md-tab ng-if="vm.license.mail" label="{{\'DASHBOARDS.MAIL\' | translate}}" ui-sref="app.dashboards.general.mail">\n <div ui-view="mail"></div>\n </md-tab>\n <md-tab ng-if="vm.license.messaging" label="{{\'DASHBOARDS.SMS\' | translate}}" ui-sref="app.dashboards.general.sms">\n <div ui-view="sms"></div>\n </md-tab>\n <md-tab ng-if="vm.license.openchannel" label="{{\'DASHBOARDS.OPENCHANNEL\' | translate}}" ui-sref="app.dashboards.general.openchannel">\n <div ui-view="openchannel"></div>\n </md-tab>\n <md-tab ng-if="vm.license.fax" label="{{\'DASHBOARDS.FAX\' | translate}}" ui-sref="app.dashboards.general.fax">\n <div ui-view="fax"></div>\n </md-tab>\n </md-tabs>\n </div>\n \x3c!-- END CONTENT --\x3e\n\n <md-content ng-if="!vm.hasPermission()" layout="row" layout-align="space-around center" flex layout-padding layout-wrap>\n <div layout="column" layout-align="space-around center" flex="50">\n <span class="font-size-40 text-center">{{ \'DASHBOARDS.WELCOME_TO_MOTION\' | translate }}!</span>\n <span class="font-size-30 text-center" translate="DASHBOARDS.WELCOME_MESSAGE">Use the left sidebar to navigate through available sections.</span>\n </div>\n\n <div layout="column" flex="50">\n <img src="assets/images/avatars/permissions.png" alt="permissions">\n </div>\n </md-content>\n </div>\n</div>'),e.put("app/main/apps/dashboards/views/general/user/voice/user.general.voice.html",'\x3c!-- WIDGET INBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-incoming" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_INBOUND_STATS">Today Inbound STATS</div>\n </div>\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timelapse"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.inbound.waiting || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_WAITING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_WAITING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_WAITING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-52 line-height-72">\n {{vm.inbound.talking || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TALKING\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TALKING_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TALKING\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.inbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-missed"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-52 line-height-72">\n {{vm.inbound.abandoned || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDONED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDONED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ABANDONED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-incoming"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_TOTAL_OFFERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_TOTAL_OFFERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-timer-sand"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-42 line-height-72">\n {{ vm.inbound.avgHoldTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_HOLD_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_HOLD_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-in-talk"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{ vm.inbound.avgTalkTime || \'00:00:00\' }}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_AVG_TALK_TIME_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_AVG_TALK_TIME\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-42 line-height-72">\n {{ vm.inbound.answerRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{ vm.inbound.abandonRate || 0 }}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_ABANDON_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_ABANDON_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.ABANDON_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-dots"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-52 line-height-72">\n {{vm.inbound.unmanaged || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.VOICE_UNMANAGED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.VOICE_UNMANAGED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.VOICE_UNMANAGED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET INBOUND --\x3e\n\n\x3c!-- WIDGET OUTBOUND --\x3e\n<div class="dashboard-container md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-phone-outgoing" class="m-0 mr-16"></md-icon>\n <div class="h2 secondary-text" translate="DASHBOARDS.TODAY_OUTBOUND_STATS">Today Outbound STATS</div>\n </div>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone-outgoing"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="light-blue-fg font-size-52 line-height-72">\n {{vm.outbound.total || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOTAL\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 light-blue-fg secondary-text text-truncate">{{\'DASHBOARDS.TOTAL_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOTAL\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="ph-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="red-fg font-size-52 line-height-72">\n {{vm.outbound.answered || 0}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWERED\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 red-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWERED_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWERED\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-clock"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="orange-fg font-size-42 line-height-72">\n {{vm.outbound.sumDuration || 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.TOT_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 orange-fg secondary-text text-truncate">{{\'DASHBOARDS.TOT_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.TOT_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-division"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-grey-fg font-size-42 line-height-72">\n {{vm.outbound.total ? ((vm.outbound.sumDuration / vm.outbound.total) | number: 0) : 0 | secToTime | date:\'HH:mm:ss\'}}\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.AVG_DURATION\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-grey-fg secondary-text text-truncate">{{\'DASHBOARDS.AVG_DURATION_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.AVG_DURATION\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n \x3c!-- WIDGET 4 --\x3e\n <ms-widget flippable="true" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="20">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="grey-50-bg">\n <div class="pl-16 pr-8 pv-16 h-55" layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="more">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-button style="cursor:auto" class="md-icon-button" aria-label="more">\n <md-icon md-font-icon="icon-percent"></md-icon>\n </md-button>\n </div>\n\n <div class="pt-8 pb-32" layout="column" layout-align="center center">\n <div class="blue-green-fg font-size-42 line-height-72">\n {{vm.outbound.total ? (vm.outbound.answered / vm.outbound.total * 100) : 0 | number: 1}}%\n </div>\n <div class="h3 secondary-text font-weight-500">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE\' | translate | uppercase}}</div>\n </div>\n\n <div class="p-16 grey-200-bg text-center border-top" layout-align="start center">\n <span class="h6 blue-green-fg secondary-text text-truncate">{{\'DASHBOARDS.OUTBOUND_ANSWER_RATE_TEXT\' | translate | uppercase}}</span>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n \x3c!-- Back --\x3e\n <ms-widget-back class="p-16 grey-50-bg">\n <div class="flip-to-front">\n <md-button class="md-icon-button" ng-click="flipWidget()" aria-label="Flip widget">\n <md-icon md-font-icon="icon-close" class="s16"></md-icon>\n </md-button>\n </div>\n\n <div>\n {{\'DASHBOARDS.HELP.OUTBOUND_ANSWER_RATE\' | translate}}\n </div>\n </ms-widget-back>\n \x3c!-- / Back --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 4 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n</div>\n\x3c!-- / WIDGET OUTBOUND --\x3e'),e.put("app/main/apps/fax/views/faxAccounts/create/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="faxAccountForm[\'name\'].$error" ng-show="faxAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="faxAccountForm[\'key\'].$error" ng-show="faxAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'TrunkId\'].$error" ng-show="faxAccountForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="faxAccountForm[\'localstationid\'].$error" ng-show="faxAccountForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountForm[\'ListId\'].$error" ng-show="faxAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description">\n\n <div ng-messages="faxAccountForm[\'description\'].$error" ng-show="faxAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxAccount" ng-click="vm.saveFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid || faxAccountForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxAccount" ng-click="vm.addNewFaxAccount()" class="send-button md-accent md-raised" ng-disabled="faxAccountForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXACCOUNT" translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n ADD FAXACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxAccount" ng-click="vm.deleteFaxAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/agentadd/agentadd.html",'<md-dialog class="faxAccount-dialog" aria-label="faxAccount" ng-init="vm.onInit()">\n <form name="faxAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXACCOUNT">Add Agent to faxAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/agent/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'agent\'].$error" ng-show="faxAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/close/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'disposition\'].$error" ng-show="faxAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'condition\'].$error" ng-show="faxAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'truepriority\'].$error" ng-show="faxAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'falsepriority\'].$error" ng-show="faxAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'priority\'].$error" ng-show="faxAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/noop/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'value\'].$error" ng-show="faxAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/queue/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'queue\'].$error" ng-show="faxAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'timeout\'].$error" ng-show="faxAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/system/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="faxAccountFormApp[\'command\'].$error" ng-show="faxAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'variable\'].$error" ng-show="faxAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/apps/tag/dialog.html",'<md-dialog class="faxAccount-dialog" aria-label="New FaxAccount">\n <form name="faxAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="faxAccountFormApp[\'tag\'].$error" ng-show="faxAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveFaxAccountApp()" class="send-button md-accent md-raised" ng-disabled="faxAccountFormApp.$invalid || faxAccountFormApp.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/faxDispositions/dialog.html",'<md-dialog class="faxDisposition-dialog" aria-label="New FaxDisposition">\n <form name="faxDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="" name="name" ng-model="vm.faxDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="faxDispositionForm[\'name\'].$error" ng-show="faxDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxDisposition" ng-click="vm.saveFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid || faxDispositionForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxDisposition" ng-click="vm.addNewFaxDisposition()" class="send-button md-accent md-raised" ng-disabled="faxDispositionForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXDISPOSITION" translate-attr-aria-label="FAX.ADD_FAXDISPOSITION">\n ADD FAXDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxDisposition" ng-click="vm.deleteFaxDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxAccounts/edit/view.html",'<div id="fax-faxAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxAccounts-button md-icon-button" aria-label="Go to faxAccounts" ng-click="vm.gotoFaxAccounts()" translate translate-attr-aria-label="FAX.GO_TO_FAXACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxAccount-image" hide-xs>\n <img ng-src="assets/images/business/faxAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxAccount.id}}\n <span ng-if="vm.faxAccount.name">{{vm.faxAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="FAX.GOTO_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (advancedForm.$invalid) || (dispositionForm.$invalid) || (faxDispositionsForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.KEY">key</label>\n <input type="text" name="key" ng-model="vm.faxAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="FAX.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.HEADERINFO">headerinfo</label>\n <input type="text" name="headerinfo" ng-model="vm.faxAccount.headerinfo" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.HEADERINFO"></span></div>\n <div ng-messages="generalForm[\'headerinfo\'].$error" ng-show="generalForm[\'headerinfo\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.HEADERINFO_REQUIRED">headerinfo field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.TRUNK">trunk</label>\n <md-select name="TrunkId" ng-model="vm.faxAccount.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.TRUNK_REQUIRED">trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LOCALSTATIONID">localstationid</label>\n <input type="text" name="localstationid" ng-model="vm.faxAccount.localstationid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.LOCALSTATIONID"></span></div>\n <div ng-messages="generalForm[\'localstationid\'].$error" ng-show="generalForm[\'localstationid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LOCALSTATIONID_REQUIRED">localstationid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.LIST">List</label>\n <md-select name="ListId" ng-model="vm.faxAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.faxAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="FAX.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.faxAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.queueTransfer == true" class="md-block">\n <label translate="FAX.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.faxAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.agentTransfer == true" class="md-block">\n <label translate="FAX.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.faxAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.ECM">ECM</label>\n <md-select name="ecm" ng-model="vm.faxAccount.ecm" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.ECM"></span></div>\n <div ng-messages="advancedForm[\'ecm\'].$error" ng-show="advancedForm[\'ecm\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.ECM_REQUIRED">ECM field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MINRATE">minrate</label>\n <md-select name="minrate" ng-model="vm.faxAccount.minrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MINRATE"></span></div>\n <div ng-messages="advancedForm[\'minrate\'].$error" ng-show="advancedForm[\'minrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MINRATE_REQUIRED">minrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MAXRATE">maxrate</label>\n <md-select name="maxrate" ng-model="vm.faxAccount.maxrate" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'2400\'">2400</md-option>\n <md-option ng-value="\'4800\'">4800</md-option>\n <md-option ng-value="\'7200\'">7200</md-option>\n <md-option ng-value="\'9600\'">9600</md-option>\n <md-option ng-value="\'12000\'">12000</md-option>\n <md-option ng-value="\'14400\'">14400</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MAXRATE"></span></div>\n <div ng-messages="advancedForm[\'maxrate\'].$error" ng-show="advancedForm[\'maxrate\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MAXRATE_REQUIRED">maxrate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.MODEM">modem</label>\n <input type="text" name="modem" ng-model="vm.faxAccount.modem" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.MODEM"></span></div>\n <div ng-messages="advancedForm[\'modem\'].$error" ng-show="advancedForm[\'modem\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MODEM_REQUIRED">modem field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.GATEWAY">gateway</label>\n <input type="text" name="gateway" ng-model="vm.faxAccount.gateway" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.GATEWAY"></span></div>\n <div ng-messages="advancedForm[\'gateway\'].$error" ng-show="advancedForm[\'gateway\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.GATEWAY_REQUIRED">gateway field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.FAXDETECT">faxdetect</label>\n <input type="text" name="faxdetect" ng-model="vm.faxAccount.faxdetect" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.FAXDETECT"></span></div>\n <div ng-messages="advancedForm[\'faxdetect\'].$error" ng-show="advancedForm[\'faxdetect\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.FAXDETECT_REQUIRED">faxdetect field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.T38TIMEOUT">t38timeout</label>\n <input type="number" name="t38timeout" ng-model="vm.faxAccount.t38timeout" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="FAX.HELP.T38TIMEOUT"></span></div>\n <div ng-messages="advancedForm[\'t38timeout\'].$error" ng-show="advancedForm[\'t38timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.T38TIMEOUT_REQUIRED">t38timeout field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.SIP">SIP</label>\n <md-select name="tech" ng-model="vm.faxAccount.tech" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP\'">SIP</md-option>\n <md-option ng-value="\'IAX\'">IAX</md-option>\n <md-option ng-value="\'DADHI\'">DADHI</md-option>\n <md-option ng-value="\'KHOMP\'">KHOMP</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'tech\'].$error" ng-show="advancedForm[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.SIP_REQUIRED">SIP field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="faxAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.faxAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="FAX.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.faxAccount.mandatoryDisposition" class="md-block">\n <label translate="FAX.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.faxAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="FAX.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container faxdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountFaxDispositionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.FAXDISPOSITIONS">FaxDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event)" aria-label="add faxDisposition" translate translate-attr-label="FAX.ADD_FAXDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountFaxDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountFaxDispositions.length}} {{vm_dc.selectedFaxAccountFaxDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountFaxDispositions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountFaxDispositions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountFaxDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountFaxDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="faxDisposition" md-select-id="id" ng-repeat="faxDisposition in vm_dc.faxAccountFaxDispositions.rows">\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" md-cell>{{faxDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditFaxAccountFaxDisposition($event, faxDisposition)" translate="FAX.EDIT_FAXDISPOSITION">\n Edit FaxDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(faxDisposition, $event)" translate="FAX.DELETE_FAXDISPOSITION">\n Delete FaxDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountFaxDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="FAX.NO_FAXDISPOSITION_AVAILABLE">No faxdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountFaxDispositions.count}}" md-on-paginate="vm_dc.getFaxAccountFaxDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.faxAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="FAX.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedFaxAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedFaxAccountApps.length}} {{vm_ac.selectedFaxAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedFaxAccountApps($event)" aria-label="delete selected" translate translate-attr-label="FAX.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedFaxAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.faxAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editFaxAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editFaxAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.faxAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="FaxAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.faxAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getFaxAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="FAX.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedFaxAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedFaxAccountInteractions.length}} {{vm_dc.selectedFaxAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedFaxAccountInteractions" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedFaxAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedFaxAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getFaxAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'FAX.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'FAX.CONTACT\' | translate }}</th>\n <th md-column>{{ \'FAX.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'FAX.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'FAX.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'FAX.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'FAX.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.faxAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyfaxInteraction($event, interaction)" translate="FAX.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.faxInteractionDownload(interaction, $event)" translate="FAX.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="FAX.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.faxAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="FAX.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.faxAccountInteractions.count}}" md-on-paginate="vm_dc.getFaxAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxAccounts/faxAccounts.html",'<div id="faxAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXACCOUNTS">FaxAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxAccounts-count">\n <span>{{vm.selectedFaxAccounts.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxAccounts()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxAccounts()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxAccounts" csv-label="true" filename="faxAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxAccounts($event)" aria-label="delete selected" translate translate-attr-label="FAXACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FAXACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'FAX.KEY\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'FAX.TRUNK\' | translate }}</th>\n <th md-column md-order-by="localstationid">{{ \'FAX.LOCALSTATIONID\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'FAX.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxAccount" md-select-id="id" ng-repeat="faxAccount in vm.faxAccounts.rows">\n <td md-cell ng-if="faxAccount.userpic"><img class="avatar" alt="{{faxAccount.name}}" ng-src="api/users/{{faxAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!faxAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="id ">{{faxAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="name ">{{faxAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="key ">{{faxAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':faxAccount.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="localstationid ">{{faxAccount.localstationid}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxAccount, ev) : vm.createOrEditFaxAccount($event, faxAccount)" md-cell class="description ">{{faxAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(faxAccount, $event)" translate="FAX.EDIT_FAXACCOUNT">\n Edit FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(faxAccount, $event)" translate="FAX.INTERACTIONS_FAXACCOUNT">\n Interactions FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxAccount, $event)" translate="FAX.GOTOREALTIME_FAXACCOUNT">\n goToRealtime FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxAccount, $event)" translate="FAX.AGENTADD_FAXACCOUNT">\n AgentAdd FaxAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(faxAccount, $event)" translate="FAX.DELETE_FAXACCOUNT">\n Delete FaxAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxAccounts.count}}" md-on-paginate="vm.getFaxAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxAccount-button" ng-click="vm.createOrEditFaxAccount($event)" aria-label="add faxAccount" translate translate-attr-aria-label="FAX.ADD_FAXACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/faxQueues/create/dialog.html",'<md-dialog class="faxQueue-dialog" aria-label="New FaxQueue">\n <form name="faxQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newFaxQueue">\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="faxQueueForm[\'name\'].$error" ng-show="faxQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="faxQueueForm[\'strategy\'].$error" ng-show="faxQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="faxQueueForm[\'timeout\'].$error" ng-show="faxQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description">\n\n <div ng-messages="faxQueueForm[\'description\'].$error" ng-show="faxQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFaxQueue" ng-click="vm.saveFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid || faxQueueForm.$pristine" aria-label="SAVE" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFaxQueue" ng-click="vm.addNewFaxQueue()" class="send-button md-accent md-raised" ng-disabled="faxQueueForm.$invalid" aria-label="ADD" translate="FAX.ADD_FAXQUEUE" translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n ADD FAXQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFaxQueue" ng-click="vm.deleteFaxQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="FAX.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="FAX.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/agentadd/agentadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.AGENTADD_FAXQUEUE">Add Agent to faxQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/teamadd/teamadd.html",'<md-dialog class="faxQueue-dialog" aria-label="faxQueue" ng-init="vm.onInit()">\n <form name="faxQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="FAX.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/fax/views/faxQueues/edit/view.html",'<div id="fax-faxQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-faxQueues-button md-icon-button" aria-label="Go to faxQueues" ng-click="vm.gotoFaxQueues()" translate translate-attr-aria-label="FAX.GO_TO_FAXQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="faxQueue-image" hide-xs>\n <img ng-src="assets/images/business/faxQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.faxQueue.id}}\n <span ng-if="vm.faxQueue.name">{{vm.faxQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="FAX.CREATED_AT"></span> <span>{{vm.faxQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.faxQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="FAX.TEAMADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.faxQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="FAX.AGENTADD_FAXQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFaxQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="FAX.SAVE" translate-attr-aria-label="FAX.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="faxQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="FAX.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="FAX.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.faxQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="FAX.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="FAX.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.faxQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.faxQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="FAX.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="FAX.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.faxQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="FAX.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/fax/views/faxQueues/faxQueues.html",'<div id="faxQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-deskphone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="FAX.FAXQUEUES">FaxQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="FAX.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFaxQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFaxQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="FAX.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-faxQueues-count">\n <span>{{vm.selectedFaxQueues.length}}</span>\n <span translate="FAX.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FAXQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFaxQueues()" translate="FAX.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFaxQueues()" translate="FAX.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFaxQueues" csv-label="true" filename="faxQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFaxQueues($event)" aria-label="delete selected" translate translate-attr-label="FAXQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FAXQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFaxQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'FAX.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'FAX.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="faxQueue" md-select-id="id" ng-repeat="faxQueue in vm.faxQueues.rows">\n <td md-cell ng-if="faxQueue.userpic"><img class="avatar" alt="{{faxQueue.name}}" ng-src="api/users/{{faxQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!faxQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{faxQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="id ">{{faxQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="name ">{{faxQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(faxQueue, ev) : vm.createOrEditFaxQueue($event, faxQueue)" md-cell class="strategy ">{{ vm.arraystrategy[faxQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(faxQueue, $event)" translate="FAX.EDIT_FAXQUEUE">\n Edit FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(faxQueue, $event)" translate="FAX.TEAMADD_FAXQUEUE">\n teamadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(faxQueue, $event)" translate="FAX.AGENTADD_FAXQUEUE">\n agentadd FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(faxQueue, $event)" translate="FAX.DELETE_FAXQUEUE">\n Delete FaxQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(faxQueue, $event)" translate="FAX.GOTOREALTIME_FAXQUEUE">\n goToRealtime FaxQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.faxQueues.count}}" md-on-paginate="vm.getFaxQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FAXQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FAXQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-faxQueue-button" ng-click="vm.createOrEditFaxQueue($event)" aria-label="add faxQueue" translate translate-attr-aria-label="FAX.ADD_FAXQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FAXQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFaxAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.KEY\' | translate }}</th>\n <th md-column>{{ \'FAX.TOTAL\' | translate }}</th>\n <th md-column>{{ \'FAX.IN\' | translate }}</th>\n <th md-column>{{ \'FAX.OUT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.faxAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.faxAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.faxAccounts[value].name}}</td>\n <td md-cell>{{vm.faxAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.faxAccounts[value].in || 0) + (vm.faxAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{vm.faxAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.faxAccounts[value].lastIn ? (vm.faxAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{vm.faxAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.faxAccounts[value].lastOut ? (vm.faxAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToFaxAccount($event, vm.faxAccounts[value])" translate="FAX.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getfaxAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'FAX.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'FAX.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'FAX.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'FAX.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'FAX.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'FAX.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'FAX.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'FAX.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'FAX.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'FAX.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'FAX.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"FAX.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"FAX.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"FAX.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"FAX.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"FAX.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'FAX.PAGE' | translate}}:', rowsPerPage: '{{'FAX.ROWSPERPAGE' | translate}}:', of: '{{'FAX.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/fax/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'FAX.PAUSED\' | translate }}</th>\n <th md-column>{{ \'FAX.READY\' | translate }}</th>\n <th md-column>{{ \'FAX.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="FAX.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditFaxQueue($event, vm.queues[value])" translate="FAX.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="FAX.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/fax/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="FAX.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/fax/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="FAX.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'FAX.NAME\' | translate }}</th>\n <th md-column>{{ \'FAX.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'FAX.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="FAX.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'FAX.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'FAX.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="FAX.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="FAX.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'FAX.PAGE\' | translate}}:\', rowsPerPage: \'{{\'FAX.ROWSPERPAGE\' | translate}}:\', of: \'{{\'FAX.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/help/views/about/about.html",'<div id="maintenance" class="flex-scrollable" layout="column" ms-scroll>\n <div id="maintenance-form-wrapper" layout="column" layout-align="center center">\n <div id="maintenance-form" class="md-whiteframe-8dp">\n <div>\n <img src="/api/settings/1/logo_login" alt="logo_login" />\n </div>\n\n <br>\n\n <div>\n <div class="info-line">\n <div class="title">Useful pages</div>\n </div>\n <section layout="row" flex layout-sm="column" layout-align="center center" layout-wrap>\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button grey-bg" href="https://wiki.xcallymotion.com/display/XMV" target="_blank">\n <md-icon md-font-icon="icon-wikipedia"></md-icon>\n </a>\n <div class="info"><a href="https://wiki.xcallymotion.com/display/XMV" target="_blank">Wiki</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button md-accent" href="/apidoc" target="_blank">\n <md-icon md-font-icon="icon-apple-mobileme"></md-icon>\n </a>\n <div class="info"><a href="/apidoc" target="_blank">Motion API</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button orange-bg" href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">\n <md-icon md-font-icon="icon-headphones"></md-icon>\n </a>\n <div class="info"><a href="http://www.xcally.com/bar/phonebar/Setup.msi" target="_blank">Phonebar Download</a></div>\n </div>\n\n <div layout="column" flex="25" layout-align="center center">\n <a class="md-fab md-mini md-button green-bg" href="/demo" target="_blank">\n <md-icon md-font-icon="icon-console"></md-icon>\n </a>\n <div class="info"><a href="/demo" target="_blank">Playground</a></div>\n </div>\n\n </section>\n\n <br>\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title">Follow us on</div>\n </div>\n <section ng-if="!vm.license.custom" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <a class="md-fab md-mini md-button blue-900-bg" href="https://www.facebook.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-facebook"></md-icon>\n </a>\n\n <a class="md-fab md-mini md-button" href="https://twitter.com/xcallymotion" target="_blank">\n <md-icon md-font-icon="icon-twitter"></md-icon>\n </a>\n <a class="md-fab md-mini md-button md-warn" href="https://plus.google.com/+Xcally" target="_blank">\n <md-icon md-font-icon="icon-google-plus"></md-icon>\n </a>\n <a class="md-fab md-mini md-button light-blue-800-bg" href="https://www.linkedin.com/company/xcally" target="_blank">\n <md-icon md-font-icon="icon-linkedin"></md-icon>\n </a>\n </section>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="title" translate="HELP.CONTACT_US">Contact Us</div>\n </div>\n <div class="info-line" ng-if="!vm.license.custom">\n <div class="info"><a href="mailto:support@xcally.com" target="_top">support@xcally.com</a></div>\n </div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info">xCALLY Motion <u>{{vm.info.current}}</u> | <a href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.info.current}}" target="_blank">Changelog</a></div>\n\n <br>\n\n <div class="info" ng-if="!vm.license.custom">xCALLY© 2016 - 2018 | Powered by Xenialab | <a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></div>\n\n <br ng-if="!vm.license.custom">\n\n <div class="info" ng-if="!vm.license.custom"><a href="https://www.xenialab.com/" target="_blank">www.xenialab.com</a> | <a href="https://www.xcallymotion.com/" target="_blank">www.xcallymotion.com</a></div>\n </div>\n </div>\n </div>\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/create/dialog.html",'<md-dialog class="deskAccount-dialog" aria-label="New DeskAccount">\n <form name="deskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="deskAccountForm[\'name\'].$error" ng-show="deskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'type\'].$error" ng-show="deskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'remoteUri\'].$error" ng-show="deskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required>\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="deskAccountForm[\'authType\'].$error" ng-show="deskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true">\n\n <div ng-messages="deskAccountForm[\'username\'].$error" ng-show="deskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="deskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="deskAccountForm[\'serverUrl\'].$error" ng-show="deskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description">\n\n <div ng-messages="deskAccountForm[\'description\'].$error" ng-show="deskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskAccount" ng-click="vm.saveDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid || deskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskAccount" ng-click="vm.addNewDeskAccount()" class="send-button md-accent md-raised" ng-disabled="deskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n ADD DESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskAccount" ng-click="vm.deleteDeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/deskAccounts.html",'<div id="deskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DESKACCOUNTS">DeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-deskAccounts-count">\n <span>{{vm.selectedDeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDeskAccounts" csv-label="true" filename="deskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="DESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.deskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="deskAccount" md-select-id="id" ng-repeat="deskAccount in vm.deskAccounts.rows">\n <td md-cell ng-if="deskAccount.userpic"><img class="avatar" alt="{{deskAccount.name}}" ng-src="api/users/{{deskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!deskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{deskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="id ">{{deskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="name ">{{deskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="remoteUri ">{{deskAccount.remoteUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(deskAccount, ev) : vm.createOrEditDeskAccount($event, deskAccount)" md-cell class="username ">{{deskAccount.username}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(deskAccount, $event)" translate="INTEGRATIONS.EDIT_DESKACCOUNT">\n Edit DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(deskAccount, $event)" translate="INTEGRATIONS.TEST_DESKACCOUNT">\n Test DeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(deskAccount, $event)" translate="INTEGRATIONS.DELETE_DESKACCOUNT">\n Delete DeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.deskAccounts.count}}" md-on-paginate="vm.getDeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-deskAccount-button" ng-click="vm.createOrEditDeskAccount($event)" aria-label="add deskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_DESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/configurations/dialog.html",'<md-dialog class="deskConfiguration-dialog" aria-label="New DeskConfiguration">\n <form name="deskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.deskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="deskConfigurationForm[\'name\'].$error" ng-show="deskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.deskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'channel\'].$error" ng-show="deskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="deskConfigurationForm[\'type\'].$error" ng-show="deskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDeskConfiguration" ng-click="vm.saveDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid || deskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDeskConfiguration" ng-click="vm.addNewDeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="deskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DESKCONFIGURATION">\n ADD DESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDeskConfiguration" ng-click="vm.deleteDeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/item/dialog.html",'<md-dialog class="deskAccount-item-dialog" aria-label="New Item">\n <form name="deskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error" ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="deskAccountItemForm.key.$error" ng-show="deskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.keyType.$error" ng-show="deskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="deskAccountItemForm.keyContent.$error" ng-show="deskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error" ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="deskAccountItemForm.customField.$error" ng-show="deskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="deskAccountItemForm.$invalid || deskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="deskAccountItemForm.option.$error"\n ng-show="deskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="deskAccountItemForm.content.$error"\n ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error"\n ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="deskAccountItemForm.type.$error" ng-show="deskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="deskAccountItemForm.content.$error"\n ng-show="deskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="deskAccountItemForm.variableName.$error"\n ng-show="deskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/deskAccounts/edit/view.html",'<div id="integrations-deskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-deskAccounts-button md-icon-button" aria-label="Go to deskAccounts" ng-click="vm.gotoDeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="deskAccount-image" hide-xs>\n <img ng-src="assets/images/business/deskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.deskAccount.id}}\n <span ng-if="vm.deskAccount.name">{{vm.deskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.deskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.deskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.deskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.deskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.deskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'basic\'">Basic</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.deskAccount.authType == \'basic\'" class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.deskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.deskAccount.authType == \'basic\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.deskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.deskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.deskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="deskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="DeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.deskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" class="md-icon-button" aria-label="create deskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="deskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ deskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDeskConfiguration($event, deskConfiguration)" translate="INTEGRATIONS.DELETE_DESKCONFIGURATION">\n Delete DeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/create/dialog.html",'<md-dialog class="dynamics365Account-dialog" aria-label="New Dynamics365Account">\n <form name="dynamics365AccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365AccountForm[\'name\'].$error" ng-show="dynamics365AccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'username\'].$error" ng-show="dynamics365AccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="dynamics365AccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'remoteUri\'].$error" ng-show="dynamics365AccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'tenantId\'].$error" ng-show="dynamics365AccountForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientId\'].$error" ng-show="dynamics365AccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true">\n\n <div ng-messages="dynamics365AccountForm[\'clientSecret\'].$error" ng-show="dynamics365AccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="dynamics365AccountForm[\'serverUrl\'].$error" ng-show="dynamics365AccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description">\n\n <div ng-messages="dynamics365AccountForm[\'description\'].$error" ng-show="dynamics365AccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Account" ng-click="vm.saveDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid || dynamics365AccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Account" ng-click="vm.addNewDynamics365Account()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n ADD DYNAMICS365ACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Account" ng-click="vm.deleteDynamics365Account($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/dynamics365Accounts.html",'<div id="dynamics365Accounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.DYNAMICS365ACCOUNTS">Dynamics365Accounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDynamics365Accounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDynamics365Accounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dynamics365Accounts-count">\n <span>{{vm.selectedDynamics365Accounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DYNAMICS365ACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDynamics365Accounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDynamics365Accounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDynamics365Accounts" csv-label="true" filename="dynamics365Accounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDynamics365Accounts($event)" aria-label="delete selected" translate translate-attr-label="DYNAMICS365ACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DYNAMICS365ACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDynamics365Accounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDynamics365Accounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dynamics365Accounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="dynamics365Account" md-select-id="id" ng-repeat="dynamics365Account in vm.dynamics365Accounts.rows">\n <td md-cell ng-if="dynamics365Account.userpic"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="api/users/{{dynamics365Account.id}}/avatar" /></td>\n <td md-cell ng-if="!dynamics365Account.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{dynamics365Account.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="id ">{{dynamics365Account.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="name ">{{dynamics365Account.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="username ">{{dynamics365Account.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(dynamics365Account, ev) : vm.createOrEditDynamics365Account($event, dynamics365Account)" md-cell class="remoteUri ">{{dynamics365Account.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(dynamics365Account, $event)" translate="INTEGRATIONS.EDIT_DYNAMICS365ACCOUNT">\n Edit Dynamics365Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(dynamics365Account, $event)" translate="INTEGRATIONS.TEST_DYNAMICS365ACCOUNT">\n Test Dynamics365Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(dynamics365Account, $event)" translate="INTEGRATIONS.DELETE_DYNAMICS365ACCOUNT">\n Delete Dynamics365Account\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dynamics365Accounts.count}}" md-on-paginate="vm.getDynamics365Accounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DYNAMICS365ACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-dynamics365Account-button" ng-click="vm.createOrEditDynamics365Account($event)" aria-label="add dynamics365Account" translate translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365ACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DYNAMICS365ACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/configurations/dialog.html",'<md-dialog class="dynamics365Configuration-dialog" aria-label="New Dynamics365Configuration">\n <form name="dynamics365ConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.dynamics365Configuration.name" ng-required="true" autofocus>\n\n <div ng-messages="dynamics365ConfigurationForm[\'name\'].$error" ng-show="dynamics365ConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.dynamics365Configuration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'channel\'].$error" ng-show="dynamics365ConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dynamics365Configuration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'type\'].$error" ng-show="dynamics365ConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TICKETTYPE">TicketType</label>\n <md-select name="ticketType" ng-model="vm.dynamics365Configuration.ticketType" required>\n\n <md-option ng-value="\'incident\'"> {{ \'INTEGRATIONS.CASE\' | translate }} </md-option>\n\n <md-option ng-value="\'phonecall\'"> {{ \'INTEGRATIONS.PHONECALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dynamics365ConfigurationForm[\'ticketType\'].$error" ng-show="dynamics365ConfigurationForm[\'ticketType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TICKETTYPE_REQUIRED">TicketType field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDynamics365Configuration" ng-click="vm.saveDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid || dynamics365ConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDynamics365Configuration" ng-click="vm.addNewDynamics365Configuration()" class="send-button md-accent md-raised" ng-disabled="dynamics365ConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_DYNAMICS365CONFIGURATION">\n ADD DYNAMICS365CONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDynamics365Configuration" ng-click="vm.deleteDynamics365Configuration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/item/dialog.html",'<md-dialog class="dynamics365Account-item-dialog" aria-label="New Item">\n <form name="dynamics365AccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error" ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.key.$error" ng-show="dynamics365AccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.keyType.$error" ng-show="dynamics365AccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.keyContent.$error" ng-show="dynamics365AccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error" ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.customField.$error" ng-show="dynamics365AccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="dynamics365AccountItemForm.$invalid || dynamics365AccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="dynamics365AccountItemForm.option.$error"\n ng-show="dynamics365AccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="dynamics365AccountItemForm.content.$error"\n ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.type.$error" ng-show="dynamics365AccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="dynamics365AccountItemForm.content.$error"\n ng-show="dynamics365AccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="dynamics365AccountItemForm.variableName.$error"\n ng-show="dynamics365AccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/dynamics365Accounts/edit/view.html",'<div id="integrations-dynamics365Account" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-dynamics365Accounts-button md-icon-button" aria-label="Go to dynamics365Accounts" ng-click="vm.gotoDynamics365Accounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_DYNAMICS365ACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="dynamics365Account-image" hide-xs>\n <img ng-src="assets/images/business/dynamics365Accounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.dynamics365Account.id}}\n <span ng-if="vm.dynamics365Account.name">{{vm.dynamics365Account.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.dynamics365Account.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveDynamics365Account()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.dynamics365Account.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.dynamics365Account.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.dynamics365Account.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.dynamics365Account.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TENANTID">TenantId</label>\n <input type="text" name="tenantId" ng-model="vm.dynamics365Account.tenantId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'tenantId\'].$error" ng-show="generalForm[\'tenantId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TENANTID_REQUIRED">TenantId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.dynamics365Account.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.dynamics365Account.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.dynamics365Account.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.dynamics365Account.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="dynamics365Account-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="Dynamics365AccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.dynamics365Account, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" class="md-icon-button" aria-label="create dynamics365Configuration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="dynamics365Configuration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedDynamics365Configuration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getDynamics365Configuration($index)">\n <span class="text-truncate" flex="80">{{ dynamics365Configuration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDynamics365Configuration($event, dynamics365Configuration)" translate="INTEGRATIONS.DELETE_DYNAMICS365CONFIGURATION">\n Delete Dynamics365Configuration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditDynamics365Configuration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/create/dialog.html",'<md-dialog class="freshdeskAccount-dialog" aria-label="New FreshdeskAccount">\n <form name="freshdeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskAccountForm[\'name\'].$error" ng-show="freshdeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'username\'].$error" ng-show="freshdeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'remoteUri\'].$error" ng-show="freshdeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true">\n\n <div ng-messages="freshdeskAccountForm[\'apiKey\'].$error" ng-show="freshdeskAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="freshdeskAccountForm[\'serverUrl\'].$error" ng-show="freshdeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description">\n\n <div ng-messages="freshdeskAccountForm[\'description\'].$error" ng-show="freshdeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskAccount" ng-click="vm.saveFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid || freshdeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskAccount" ng-click="vm.addNewFreshdeskAccount()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n ADD FRESHDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskAccount" ng-click="vm.deleteFreshdeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/configurations/dialog.html",'<md-dialog class="freshdeskConfiguration-dialog" aria-label="New FreshdeskConfiguration">\n <form name="freshdeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.freshdeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="freshdeskConfigurationForm[\'name\'].$error" ng-show="freshdeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.freshdeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'channel\'].$error" ng-show="freshdeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.freshdeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="freshdeskConfigurationForm[\'type\'].$error" ng-show="freshdeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newFreshdeskConfiguration" ng-click="vm.saveFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid || freshdeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newFreshdeskConfiguration" ng-click="vm.addNewFreshdeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="freshdeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKCONFIGURATION">\n ADD FRESHDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newFreshdeskConfiguration" ng-click="vm.deleteFreshdeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/item/dialog.html",'<md-dialog class="freshdeskAccount-item-dialog" aria-label="New Item">\n <form name="freshdeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error" ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.key.$error" ng-show="freshdeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.keyType.$error" ng-show="freshdeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.keyContent.$error" ng-show="freshdeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error" ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.customField.$error" ng-show="freshdeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="freshdeskAccountItemForm.$invalid || freshdeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="freshdeskAccountItemForm.option.$error"\n ng-show="freshdeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="freshdeskAccountItemForm.content.$error"\n ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.type.$error" ng-show="freshdeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="freshdeskAccountItemForm.content.$error"\n ng-show="freshdeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="freshdeskAccountItemForm.variableName.$error"\n ng-show="freshdeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/edit/view.html",'<div id="integrations-freshdeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-freshdeskAccounts-button md-icon-button" aria-label="Go to freshdeskAccounts" ng-click="vm.gotoFreshdeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="freshdeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/freshdeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.freshdeskAccount.id}}\n <span ng-if="vm.freshdeskAccount.name">{{vm.freshdeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.freshdeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveFreshdeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.freshdeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.freshdeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.freshdeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.freshdeskAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.freshdeskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.freshdeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="freshdeskAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="FreshdeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.freshdeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" class="md-icon-button" aria-label="create freshdeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="freshdeskConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedFreshdeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getFreshdeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ freshdeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFreshdeskConfiguration($event, freshdeskConfiguration)" translate="INTEGRATIONS.DELETE_FRESHDESKCONFIGURATION">\n Delete FreshdeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditFreshdeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/freshdeskAccounts/freshdeskAccounts.html",'<div id="freshdeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.FRESHDESKACCOUNTS">FreshdeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedFreshdeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedFreshdeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-freshdeskAccounts-count">\n <span>{{vm.selectedFreshdeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="FRESHDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectFreshdeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedFreshdeskAccounts" csv-label="true" filename="freshdeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedFreshdeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="FRESHDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- FRESHDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedFreshdeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getFreshdeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.freshdeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="freshdeskAccount" md-select-id="id" ng-repeat="freshdeskAccount in vm.freshdeskAccounts.rows">\n <td md-cell ng-if="freshdeskAccount.userpic"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="api/users/{{freshdeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!freshdeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{freshdeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="id ">{{freshdeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="name ">{{freshdeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="username ">{{freshdeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshdeskAccount, ev) : vm.createOrEditFreshdeskAccount($event, freshdeskAccount)" md-cell class="remoteUri ">{{freshdeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(freshdeskAccount, $event)" translate="INTEGRATIONS.EDIT_FRESHDESKACCOUNT">\n Edit FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(freshdeskAccount, $event)" translate="INTEGRATIONS.TEST_FRESHDESKACCOUNT">\n Test FreshdeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(freshdeskAccount, $event)" translate="INTEGRATIONS.DELETE_FRESHDESKACCOUNT">\n Delete FreshdeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.freshdeskAccounts.count}}" md-on-paginate="vm.getFreshdeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / FRESHDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD FRESHDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-freshdeskAccount-button" ng-click="vm.createOrEditFreshdeskAccount($event)" aria-label="add freshdeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_FRESHDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD FRESHDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/create/dialog.html",'<md-dialog class="salesforceAccount-dialog" aria-label="New SalesforceAccount">\n <form name="salesforceAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceAccountForm[\'name\'].$error" ng-show="salesforceAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceAccountForm[\'type\'].$error" ng-show="salesforceAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'username\'].$error" ng-show="salesforceAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'remoteUri\'].$error" ng-show="salesforceAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="salesforceAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientId\'].$error" ng-show="salesforceAccountForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'clientSecret\'].$error" ng-show="salesforceAccountForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true">\n\n <div ng-messages="salesforceAccountForm[\'securityToken\'].$error" ng-show="salesforceAccountForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="salesforceAccountForm[\'serverUrl\'].$error" ng-show="salesforceAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description">\n\n <div ng-messages="salesforceAccountForm[\'description\'].$error" ng-show="salesforceAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceAccount" ng-click="vm.saveSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid || salesforceAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceAccount" ng-click="vm.addNewSalesforceAccount()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCEACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n ADD SALESFORCEACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceAccount" ng-click="vm.deleteSalesforceAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/configurations/dialog.html",'<md-dialog class="salesforceConfiguration-dialog" aria-label="New SalesforceConfiguration">\n <form name="salesforceConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.salesforceConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="salesforceConfigurationForm[\'name\'].$error" ng-show="salesforceConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.salesforceConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'channel\'].$error" ng-show="salesforceConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="salesforceConfigurationForm[\'type\'].$error" ng-show="salesforceConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSalesforceConfiguration" ng-click="vm.saveSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid || salesforceConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSalesforceConfiguration" ng-click="vm.addNewSalesforceConfiguration()" class="send-button md-accent md-raised" ng-disabled="salesforceConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SALESFORCECONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCECONFIGURATION">\n ADD SALESFORCECONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSalesforceConfiguration" ng-click="vm.deleteSalesforceConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/item/dialog.html",'<md-dialog class="salesforceAccount-item-dialog" aria-label="New Item">\n <form name="salesforceAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error" ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.key.$error" ng-show="salesforceAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.keyType.$error" ng-show="salesforceAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.keyContent.$error" ng-show="salesforceAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error" ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="salesforceAccountItemForm.customField.$error" ng-show="salesforceAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="salesforceAccountItemForm.$invalid || salesforceAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="salesforceAccountItemForm.option.$error"\n ng-show="salesforceAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="salesforceAccountItemForm.content.$error"\n ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error"\n ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.type.$error" ng-show="salesforceAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="salesforceAccountItemForm.content.$error"\n ng-show="salesforceAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="salesforceAccountItemForm.variableName.$error"\n ng-show="salesforceAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/salesforceAccounts/edit/view.html",'<div id="integrations-salesforceAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-salesforceAccounts-button md-icon-button" aria-label="Go to salesforceAccounts" ng-click="vm.gotoSalesforceAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SALESFORCEACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="salesforceAccount-image" hide-xs>\n <img ng-src="assets/images/business/salesforceAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.salesforceAccount.id}}\n <span ng-if="vm.salesforceAccount.name">{{vm.salesforceAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.salesforceAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSalesforceAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.salesforceAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.salesforceAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.salesforceAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.salesforceAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.salesforceAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTID">ClientId</label>\n <input type="text" name="clientId" ng-model="vm.salesforceAccount.clientId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientId\'].$error" ng-show="generalForm[\'clientId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTID_REQUIRED">ClientId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CLIENTSECRET">ClientSecret</label>\n <input type="text" name="clientSecret" ng-model="vm.salesforceAccount.clientSecret" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'clientSecret\'].$error" ng-show="generalForm[\'clientSecret\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CLIENTSECRET_REQUIRED">ClientSecret field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.SECURITYTOKEN">SecurityToken</label>\n <input type="text" name="securityToken" ng-model="vm.salesforceAccount.securityToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'securityToken\'].$error" ng-show="generalForm[\'securityToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.SECURITYTOKEN_REQUIRED">SecurityToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.salesforceAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.salesforceAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="salesforceAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SalesforceAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.salesforceAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" class="md-icon-button" aria-label="create salesforceConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="salesforceConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSalesforceConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSalesforceConfiguration($index)">\n <span class="text-truncate" flex="80">{{ salesforceConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSalesforceConfiguration($event, salesforceConfiguration)" translate="INTEGRATIONS.DELETE_SALESFORCECONFIGURATION">\n Delete SalesforceConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_SEARCH"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleSearch" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'contact_lead\', value: \'Contact & Lead\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n <div layout-margin>\n <label translate="INTEGRATIONS.MODULE_CREATE"></label>\n <md-select ng-model="vm_cc.salesforceConfiguration.moduleCreate" ng-change="vm_cc.selectChangedAdvanced()" ng-disabled="!vm_cc.crudPermissions.canEdit">\n <md-option ng-value="option.key" ng-repeat="option in [{key: \'nothing\', value: \'Nothing\'}, {key: \'contact\', value: \'Contact\'}, {key: \'lead\', value: \'Lead\'}]">{{ option.value }}</md-option>\n </md-select>\n </div>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSalesforceConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/salesforceAccounts/salesforceAccounts.html",'<div id="salesforceAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SALESFORCEACCOUNTS">SalesforceAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSalesforceAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSalesforceAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-salesforceAccounts-count">\n <span>{{vm.selectedSalesforceAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SALESFORCEACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSalesforceAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSalesforceAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSalesforceAccounts" csv-label="true" filename="salesforceAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSalesforceAccounts($event)" aria-label="delete selected" translate translate-attr-label="SALESFORCEACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SALESFORCEACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSalesforceAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSalesforceAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.salesforceAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="salesforceAccount" md-select-id="id" ng-repeat="salesforceAccount in vm.salesforceAccounts.rows">\n <td md-cell ng-if="salesforceAccount.userpic"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="api/users/{{salesforceAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!salesforceAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{salesforceAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="id ">{{salesforceAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="name ">{{salesforceAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="username ">{{salesforceAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(salesforceAccount, ev) : vm.createOrEditSalesforceAccount($event, salesforceAccount)" md-cell class="remoteUri ">{{salesforceAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(salesforceAccount, $event)" translate="INTEGRATIONS.EDIT_SALESFORCEACCOUNT">\n Edit SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(salesforceAccount, $event)" translate="INTEGRATIONS.TEST_SALESFORCEACCOUNT">\n Test SalesforceAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(salesforceAccount, $event)" translate="INTEGRATIONS.DELETE_SALESFORCEACCOUNT">\n Delete SalesforceAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.salesforceAccounts.count}}" md-on-paginate="vm.getSalesforceAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SALESFORCEACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SALESFORCEACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-salesforceAccount-button" ng-click="vm.createOrEditSalesforceAccount($event)" aria-label="add salesforceAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SALESFORCEACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SALESFORCEACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/create/dialog.html",'<md-dialog class="servicenowAccount-dialog" aria-label="New ServicenowAccount">\n <form name="servicenowAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowAccountForm[\'name\'].$error" ng-show="servicenowAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'username\'].$error" ng-show="servicenowAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="servicenowAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'email\'].$error" ng-show="servicenowAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true">\n\n <div ng-messages="servicenowAccountForm[\'remoteUri\'].$error" ng-show="servicenowAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="servicenowAccountForm[\'serverUrl\'].$error" ng-show="servicenowAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description">\n\n <div ng-messages="servicenowAccountForm[\'description\'].$error" ng-show="servicenowAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowAccount" ng-click="vm.saveServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid || servicenowAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowAccount" ng-click="vm.addNewServicenowAccount()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n ADD SERVICENOWACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowAccount" ng-click="vm.deleteServicenowAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/configurations/dialog.html",'<md-dialog class="servicenowConfiguration-dialog" aria-label="New ServicenowConfiguration">\n <form name="servicenowConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.servicenowConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="servicenowConfigurationForm[\'name\'].$error" ng-show="servicenowConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.servicenowConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'channel\'].$error" ng-show="servicenowConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.servicenowConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="servicenowConfigurationForm[\'type\'].$error" ng-show="servicenowConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newServicenowConfiguration" ng-click="vm.saveServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid || servicenowConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newServicenowConfiguration" ng-click="vm.addNewServicenowConfiguration()" class="send-button md-accent md-raised" ng-disabled="servicenowConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWCONFIGURATION">\n ADD SERVICENOWCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newServicenowConfiguration" ng-click="vm.deleteServicenowConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/item/dialog.html",'<md-dialog class="servicenowAccount-item-dialog" aria-label="New Item">\n <form name="servicenowAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error" ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.key.$error" ng-show="servicenowAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.keyType.$error" ng-show="servicenowAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.keyContent.$error" ng-show="servicenowAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error" ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="servicenowAccountItemForm.customField.$error" ng-show="servicenowAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="servicenowAccountItemForm.$invalid || servicenowAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="servicenowAccountItemForm.option.$error"\n ng-show="servicenowAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="servicenowAccountItemForm.content.$error"\n ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error"\n ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.type.$error" ng-show="servicenowAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="servicenowAccountItemForm.content.$error"\n ng-show="servicenowAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="servicenowAccountItemForm.variableName.$error"\n ng-show="servicenowAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/servicenowAccounts/edit/view.html",'<div id="integrations-servicenowAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-servicenowAccounts-button md-icon-button" aria-label="Go to servicenowAccounts" ng-click="vm.gotoServicenowAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SERVICENOWACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="servicenowAccount-image" hide-xs>\n <img ng-src="assets/images/business/servicenowAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.servicenowAccount.id}}\n <span ng-if="vm.servicenowAccount.name">{{vm.servicenowAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.servicenowAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveServicenowAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.servicenowAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.servicenowAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.servicenowAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.servicenowAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="INTEGRATIONS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.servicenowAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.servicenowAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.servicenowAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="servicenowAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ServicenowAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.servicenowAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" class="md-icon-button" aria-label="create servicenowConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="servicenowConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedServicenowConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getServicenowConfiguration($index)">\n <span class="text-truncate" flex="80">{{ servicenowConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteServicenowConfiguration($event, servicenowConfiguration)" translate="INTEGRATIONS.DELETE_SERVICENOWCONFIGURATION">\n Delete ServicenowConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditServicenowConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/servicenowAccounts/servicenowAccounts.html",'<div id="servicenowAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS">ServicenowAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedServicenowAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedServicenowAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-servicenowAccounts-count">\n <span>{{vm.selectedServicenowAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SERVICENOWACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllServicenowAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectServicenowAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedServicenowAccounts" csv-label="true" filename="servicenowAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedServicenowAccounts($event)" aria-label="delete selected" translate translate-attr-label="SERVICENOWACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SERVICENOWACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedServicenowAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getServicenowAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'INTEGRATIONS.EMAIL\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.servicenowAccounts.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="servicenowAccount" md-select-id="id" ng-repeat="servicenowAccount in vm.servicenowAccounts.rows">\n <td md-cell ng-if="servicenowAccount.userpic"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="api/users/{{servicenowAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!servicenowAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{servicenowAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="id ">{{servicenowAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="name ">{{servicenowAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="username ">{{servicenowAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="email ">{{servicenowAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)" md-cell class="remoteUri ">{{servicenowAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(servicenowAccount, $event)" translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT">\n Edit ServicenowAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(servicenowAccount, $event)" translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT">\n Test ServicenowAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(servicenowAccount, $event)" translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT">\n Delete ServicenowAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.servicenowAccounts.count}}" md-on-paginate="vm.getServicenowAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SERVICENOWACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SERVICENOWACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-servicenowAccount-button" ng-click="vm.createOrEditServicenowAccount($event)" aria-label="add servicenowAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SERVICENOWACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/create/dialog.html",'<md-dialog class="sugarcrmAccount-dialog" aria-label="New SugarcrmAccount">\n <form name="sugarcrmAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmAccountForm[\'name\'].$error" ng-show="sugarcrmAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'username\'].$error" ng-show="sugarcrmAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true">\n\n <div ng-messages="sugarcrmAccountForm[\'remoteUri\'].$error" ng-show="sugarcrmAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="sugarcrmAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="sugarcrmAccountForm[\'serverUrl\'].$error" ng-show="sugarcrmAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description">\n\n <div ng-messages="sugarcrmAccountForm[\'description\'].$error" ng-show="sugarcrmAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmAccount" ng-click="vm.saveSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid || sugarcrmAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmAccount" ng-click="vm.addNewSugarcrmAccount()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n ADD SUGARCRMACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmAccount" ng-click="vm.deleteSugarcrmAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/configurations/dialog.html",'<md-dialog class="sugarcrmConfiguration-dialog" aria-label="New SugarcrmConfiguration">\n <form name="sugarcrmConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.sugarcrmConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="sugarcrmConfigurationForm[\'name\'].$error" ng-show="sugarcrmConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.sugarcrmConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'channel\'].$error" ng-show="sugarcrmConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.sugarcrmConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="sugarcrmConfigurationForm[\'type\'].$error" ng-show="sugarcrmConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSugarcrmConfiguration" ng-click="vm.saveSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid || sugarcrmConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSugarcrmConfiguration" ng-click="vm.addNewSugarcrmConfiguration()" class="send-button md-accent md-raised" ng-disabled="sugarcrmConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMCONFIGURATION">\n ADD SUGARCRMCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSugarcrmConfiguration" ng-click="vm.deleteSugarcrmConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/item/dialog.html",'<md-dialog class="sugarcrmAccount-item-dialog" aria-label="New Item">\n <form name="sugarcrmAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error" ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.key.$error" ng-show="sugarcrmAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.keyType.$error" ng-show="sugarcrmAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.keyContent.$error" ng-show="sugarcrmAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error" ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.customField.$error" ng-show="sugarcrmAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="sugarcrmAccountItemForm.$invalid || sugarcrmAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="sugarcrmAccountItemForm.option.$error"\n ng-show="sugarcrmAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="sugarcrmAccountItemForm.content.$error"\n ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.type.$error" ng-show="sugarcrmAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="sugarcrmAccountItemForm.content.$error"\n ng-show="sugarcrmAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="sugarcrmAccountItemForm.variableName.$error"\n ng-show="sugarcrmAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/edit/view.html",'<div id="integrations-sugarcrmAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-sugarcrmAccounts-button md-icon-button" aria-label="Go to sugarcrmAccounts" ng-click="vm.gotoSugarcrmAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_SUGARCRMACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="sugarcrmAccount-image" hide-xs>\n <img ng-src="assets/images/business/sugarcrmAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.sugarcrmAccount.id}}\n <span ng-if="vm.sugarcrmAccount.name">{{vm.sugarcrmAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.sugarcrmAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSugarcrmAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sugarcrmAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.sugarcrmAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.sugarcrmAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.sugarcrmAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.sugarcrmAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sugarcrmAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="sugarcrmAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="SugarcrmAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.sugarcrmAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" class="md-icon-button" aria-label="create sugarcrmConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="sugarcrmConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedSugarcrmConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getSugarcrmConfiguration($index)">\n <span class="text-truncate" flex="80">{{ sugarcrmConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSugarcrmConfiguration($event, sugarcrmConfiguration)" translate="INTEGRATIONS.DELETE_SUGARCRMCONFIGURATION">\n Delete SugarcrmConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditSugarcrmConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/sugarcrmAccounts/sugarcrmAccounts.html",'<div id="sugarcrmAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.SUGARCRMACCOUNTS">SugarcrmAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSugarcrmAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSugarcrmAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sugarcrmAccounts-count">\n <span>{{vm.selectedSugarcrmAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SUGARCRMACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSugarcrmAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSugarcrmAccounts" csv-label="true" filename="sugarcrmAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSugarcrmAccounts($event)" aria-label="delete selected" translate translate-attr-label="SUGARCRMACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SUGARCRMACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSugarcrmAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSugarcrmAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sugarcrmAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sugarcrmAccount" md-select-id="id" ng-repeat="sugarcrmAccount in vm.sugarcrmAccounts.rows">\n <td md-cell ng-if="sugarcrmAccount.userpic"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="api/users/{{sugarcrmAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!sugarcrmAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sugarcrmAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="id ">{{sugarcrmAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="name ">{{sugarcrmAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="username ">{{sugarcrmAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(sugarcrmAccount, ev) : vm.createOrEditSugarcrmAccount($event, sugarcrmAccount)" md-cell class="remoteUri ">{{sugarcrmAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(sugarcrmAccount, $event)" translate="INTEGRATIONS.EDIT_SUGARCRMACCOUNT">\n Edit SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(sugarcrmAccount, $event)" translate="INTEGRATIONS.TEST_SUGARCRMACCOUNT">\n Test SugarcrmAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(sugarcrmAccount, $event)" translate="INTEGRATIONS.DELETE_SUGARCRMACCOUNT">\n Delete SugarcrmAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sugarcrmAccounts.count}}" md-on-paginate="vm.getSugarcrmAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SUGARCRMACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SUGARCRMACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-sugarcrmAccount-button" ng-click="vm.createOrEditSugarcrmAccount($event)" aria-label="add sugarcrmAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_SUGARCRMACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SUGARCRMACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/create/dialog.html",'<md-dialog class="vtigerAccount-dialog" aria-label="New VtigerAccount">\n <form name="vtigerAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerAccountForm[\'name\'].$error" ng-show="vtigerAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description">\n\n <div ng-messages="vtigerAccountForm[\'description\'].$error" ng-show="vtigerAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'username\'].$error" ng-show="vtigerAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'accessKey\'].$error" ng-show="vtigerAccountForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true">\n\n <div ng-messages="vtigerAccountForm[\'remoteUri\'].$error" ng-show="vtigerAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="vtigerAccountForm[\'serverUrl\'].$error" ng-show="vtigerAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerAccount" ng-click="vm.saveVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid || vtigerAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerAccount" ng-click="vm.addNewVtigerAccount()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n ADD VTIGERACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerAccount" ng-click="vm.deleteVtigerAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/configurations/dialog.html",'<md-dialog class="vtigerConfiguration-dialog" aria-label="New VtigerConfiguration">\n <form name="vtigerConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.vtigerConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="vtigerConfigurationForm[\'name\'].$error" ng-show="vtigerConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.vtigerConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'channel\'].$error" ng-show="vtigerConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.vtigerConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="vtigerConfigurationForm[\'type\'].$error" ng-show="vtigerConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVtigerConfiguration" ng-click="vm.saveVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid || vtigerConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVtigerConfiguration" ng-click="vm.addNewVtigerConfiguration()" class="send-button md-accent md-raised" ng-disabled="vtigerConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_VTIGERCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERCONFIGURATION">\n ADD VTIGERCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVtigerConfiguration" ng-click="vm.deleteVtigerConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/item/dialog.html",'<md-dialog class="vtigerAccount-item-dialog" aria-label="New Item">\n <form name="vtigerAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error" ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.key.$error" ng-show="vtigerAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.keyType.$error" ng-show="vtigerAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.keyContent.$error" ng-show="vtigerAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error" ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="vtigerAccountItemForm.customField.$error" ng-show="vtigerAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="vtigerAccountItemForm.$invalid || vtigerAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="vtigerAccountItemForm.option.$error"\n ng-show="vtigerAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="vtigerAccountItemForm.content.$error"\n ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error"\n ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.type.$error" ng-show="vtigerAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="vtigerAccountItemForm.content.$error"\n ng-show="vtigerAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="vtigerAccountItemForm.variableName.$error"\n ng-show="vtigerAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/vtigerAccounts/edit/view.html",'<div id="integrations-vtigerAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-vtigerAccounts-button md-icon-button" aria-label="Go to vtigerAccounts" ng-click="vm.gotoVtigerAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_VTIGERACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="vtigerAccount-image" hide-xs>\n <img ng-src="assets/images/business/vtigerAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.vtigerAccount.id}}\n <span ng-if="vm.vtigerAccount.name">{{vm.vtigerAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.vtigerAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVtigerAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.vtigerAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.vtigerAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.VTIGER_USER_NAME">vTiger_User_Name</label>\n <input type="text" name="username" ng-model="vm.vtigerAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VTIGER_USER_NAME_REQUIRED">vTiger_User_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.ACCESS_KEY">Access_Key</label>\n <input type="text" name="accessKey" ng-model="vm.vtigerAccount.accessKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accessKey\'].$error" ng-show="generalForm[\'accessKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.ACCESS_KEY_REQUIRED">Access_Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <input type="url" name="remoteUri" ng-model="vm.vtigerAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.HOST_MUST_VALID_URL">Host must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.vtigerAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="vtigerAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="VtigerAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.vtigerAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" class="md-icon-button" aria-label="create vtigerConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="vtigerConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedVtigerConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getVtigerConfiguration($index)">\n <span class="text-truncate" flex="80">{{ vtigerConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteVtigerConfiguration($event, vtigerConfiguration)" translate="INTEGRATIONS.DELETE_VTIGERCONFIGURATION">\n Delete VtigerConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditVtigerConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/vtigerAccounts/vtigerAccounts.html",'<div id="vtigerAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.VTIGERACCOUNTS">VtigerAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVtigerAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVtigerAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-vtigerAccounts-count">\n <span>{{vm.selectedVtigerAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VTIGERACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVtigerAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVtigerAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVtigerAccounts" csv-label="true" filename="vtigerAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVtigerAccounts($event)" aria-label="delete selected" translate translate-attr-label="VTIGERACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VTIGERACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVtigerAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVtigerAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.VTIGER_USER_NAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.vtigerAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vtigerAccount" md-select-id="id" ng-repeat="vtigerAccount in vm.vtigerAccounts.rows">\n <td md-cell ng-if="vtigerAccount.userpic"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="api/users/{{vtigerAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!vtigerAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{vtigerAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="id ">{{vtigerAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="name ">{{vtigerAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="username ">{{vtigerAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(vtigerAccount, ev) : vm.createOrEditVtigerAccount($event, vtigerAccount)" md-cell class="remoteUri ">{{vtigerAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(vtigerAccount, $event)" translate="INTEGRATIONS.EDIT_VTIGERACCOUNT">\n Edit VtigerAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(vtigerAccount, $event)" translate="INTEGRATIONS.TEST_VTIGERACCOUNT">\n Test VtigerAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(vtigerAccount, $event)" translate="INTEGRATIONS.DELETE_VTIGERACCOUNT">\n Delete VtigerAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.vtigerAccounts.count}}" md-on-paginate="vm.getVtigerAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VTIGERACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VTIGERACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-vtigerAccount-button" ng-click="vm.createOrEditVtigerAccount($event)" aria-label="add vtigerAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_VTIGERACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VTIGERACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/create/dialog.html",'<md-dialog class="zendeskAccount-dialog" aria-label="New ZendeskAccount">\n <form name="zendeskAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskAccountForm[\'name\'].$error" ng-show="zendeskAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required>\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'type\'].$error" ng-show="zendeskAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'username\'].$error" ng-show="zendeskAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'remoteUri\'].$error" ng-show="zendeskAccountForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required>\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="zendeskAccountForm[\'authType\'].$error" ng-show="zendeskAccountForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="zendeskAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true">\n\n <div ng-messages="zendeskAccountForm[\'token\'].$error" ng-show="zendeskAccountForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zendeskAccountForm[\'serverUrl\'].$error" ng-show="zendeskAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description">\n\n <div ng-messages="zendeskAccountForm[\'description\'].$error" ng-show="zendeskAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskAccount" ng-click="vm.saveZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid || zendeskAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskAccount" ng-click="vm.addNewZendeskAccount()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n ADD ZENDESKACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskAccount" ng-click="vm.deleteZendeskAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/item/dialog.html",'<md-dialog class="zendeskAccount-item-dialog" aria-label="New Item">\n <form name="zendeskAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error" ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.key.$error" ng-show="zendeskAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.keyType.$error" ng-show="zendeskAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.keyContent.$error" ng-show="zendeskAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error" ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zendeskAccountItemForm.customField.$error" ng-show="zendeskAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zendeskAccountItemForm.$invalid || zendeskAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zendeskAccountItemForm.option.$error"\n ng-show="zendeskAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zendeskAccountItemForm.content.$error"\n ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error"\n ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.type.$error" ng-show="zendeskAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zendeskAccountItemForm.content.$error"\n ng-show="zendeskAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zendeskAccountItemForm.variableName.$error"\n ng-show="zendeskAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/view.html",'<div id="integrations-zendeskAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zendeskAccounts-button md-icon-button" aria-label="Go to zendeskAccounts" ng-click="vm.gotoZendeskAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZENDESKACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zendeskAccount-image" hide-xs>\n <img ng-src="assets/images/business/zendeskAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zendeskAccount.id}}\n <span ng-if="vm.zendeskAccount.name">{{vm.zendeskAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zendeskAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZendeskAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (zendeskConfigurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zendeskAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'integrationTab\'"> {{ \'INTEGRATIONS.INTEGRATION_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'newTab\'"> {{ \'INTEGRATIONS.NEW_TAB\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.zendeskAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.URI">Uri</label>\n <input type="url" name="remoteUri" ng-model="vm.zendeskAccount.remoteUri" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'remoteUri\'].$error" ng-show="generalForm[\'remoteUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED">Uri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL">Uri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTYPE">AuthType</label>\n <md-select name="authType" ng-model="vm.zendeskAccount.authType" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'password\'">Password</md-option>\n <md-option ng-value="\'token\'">Token</md-option>\n </md-select>\n <div ng-messages="generalForm[\'authType\'].$error" ng-show="generalForm[\'authType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTYPE_REQUIRED">AuthType field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.zendeskAccount.authType == \'password\'">\n <label translate="INTEGRATIONS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.zendeskAccount.password" placeholder="Password" translate translate-attr-placeholder="INTEGRATIONS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="INTEGRATIONS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.zendeskAccount.authType == \'token\'" class="md-block">\n <label translate="INTEGRATIONS.TOKEN">Token</label>\n <input type="text" name="token" ng-model="vm.zendeskAccount.token" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'token\'].$error" ng-show="generalForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TOKEN_REQUIRED">Token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zendeskAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zendeskAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zendeskAccount-detail-form-container zendeskconfigurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.ZENDESKCONFIGURATIONS">ZENDESKCONFIGURATIONS</div>\n </div>\n <div ng-controller="ZendeskAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zendeskAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" class="md-icon-button" aria-label="create zendeskConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zendeskConfiguration in vm_cc.zendeskConfigurations" class="border-top" md-colors="{background: (vm_cc.selectedZendeskConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZendeskConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zendeskConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZendeskConfiguration($event, zendeskConfiguration)" translate="INTEGRATIONS.DELETE_ZENDESKCONFIGURATION">\n Delete ZendeskConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.zendeskConfigurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.TAGS">TAGS</span>\n </md-tab-label>\n <md-tab-body>\n <md-table-container class="md-whiteframe-1dp padding-20">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TAGS">Tags</label>\n <md-select ng-model="vm_cc.selectedTags" ng-change="vm_cc.selectTagsChanged($event)" multiple>\n <md-option ng-value="tag.id" ng-repeat="tag in vm_cc.tags">{{ tag.name }}</md-option>\n </md-select>\n </md-input-container>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.zendeskConfigurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZendeskConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zendeskAccounts/edit/zendeskConfigurations/dialog.html",'<md-dialog class="zendeskConfiguration-dialog" aria-label="New ZendeskConfiguration">\n <form name="zendeskConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zendeskConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zendeskConfigurationForm[\'name\'].$error" ng-show="zendeskConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zendeskConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'channel\'].$error" ng-show="zendeskConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zendeskConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zendeskConfigurationForm[\'type\'].$error" ng-show="zendeskConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZendeskConfiguration" ng-click="vm.saveZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid || zendeskConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZendeskConfiguration" ng-click="vm.addNewZendeskConfiguration()" class="send-button md-accent md-raised" ng-disabled="zendeskConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZENDESKCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKCONFIGURATION">\n ADD ZENDESKCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZendeskConfiguration" ng-click="vm.deleteZendeskConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zendeskAccounts/zendeskAccounts.html",'<div id="zendeskAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZENDESKACCOUNTS">ZendeskAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZendeskAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zendeskAccounts-count">\n <span>{{vm.selectedZendeskAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZENDESKACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZendeskAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZendeskAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZendeskAccounts" csv-label="true" filename="zendeskAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZendeskAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZENDESKACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ZENDESKACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZendeskAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZendeskAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="username">{{ \'INTEGRATIONS.USERNAME\' | translate }}</th>\n <th md-column md-order-by="remoteUri">{{ \'INTEGRATIONS.URI\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zendeskAccounts.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zendeskAccount" md-select-id="id" ng-repeat="zendeskAccount in vm.zendeskAccounts.rows">\n <td md-cell ng-if="zendeskAccount.userpic"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="api/users/{{zendeskAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zendeskAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zendeskAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="id ">{{zendeskAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="name ">{{zendeskAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="username ">{{zendeskAccount.username}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)" md-cell class="remoteUri ">{{zendeskAccount.remoteUri}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(zendeskAccount, $event)" translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT">\n Edit ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zendeskAccount, $event)" translate="INTEGRATIONS.TEST_ZENDESKACCOUNT">\n Test ZendeskAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(zendeskAccount, $event)" translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT">\n Delete ZendeskAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zendeskAccounts.count}}" md-on-paginate="vm.getZendeskAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZENDESKACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZENDESKACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zendeskAccount-button" ng-click="vm.createOrEditZendeskAccount($event)" aria-label="add zendeskAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZENDESKACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/create/dialog.html",'<md-dialog class="zohoAccount-dialog" aria-label="New ZohoAccount">\n <form name="zohoAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoAccountForm[\'name\'].$error" ng-show="zohoAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required>\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="zohoAccountForm[\'host\'].$error" ng-show="zohoAccountForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true">\n\n <div ng-messages="zohoAccountForm[\'authToken\'].$error" ng-show="zohoAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="zohoAccountForm[\'serverUrl\'].$error" ng-show="zohoAccountForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description">\n\n <div ng-messages="zohoAccountForm[\'description\'].$error" ng-show="zohoAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoAccount" ng-click="vm.saveZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid || zohoAccountForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoAccount" ng-click="vm.addNewZohoAccount()" class="send-button md-accent md-raised" ng-disabled="zohoAccountForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOACCOUNT" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n ADD ZOHOACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoAccount" ng-click="vm.deleteZohoAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/configurations/dialog.html",'<md-dialog class="zohoConfiguration-dialog" aria-label="New ZohoConfiguration">\n <form name="zohoConfigurationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.zohoConfiguration.name" ng-required="true" autofocus>\n\n <div ng-messages="zohoConfigurationForm[\'name\'].$error" ng-show="zohoConfigurationForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.zohoConfiguration.channel" required>\n\n <md-option ng-value="\'voice\'"> {{ \'INTEGRATIONS.VOICE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'channel\'].$error" ng-show="zohoConfigurationForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.zohoConfiguration.type" required>\n\n <md-option ng-value="\'inbound\'"> {{ \'INTEGRATIONS.INBOUND_IN_QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'outbound\'"> {{ \'INTEGRATIONS.OUTBOUND_CALL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="zohoConfigurationForm[\'type\'].$error" ng-show="zohoConfigurationForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newZohoConfiguration" ng-click="vm.saveZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid || zohoConfigurationForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newZohoConfiguration" ng-click="vm.addNewZohoConfiguration()" class="send-button md-accent md-raised" ng-disabled="zohoConfigurationForm.$invalid" aria-label="ADD" translate="INTEGRATIONS.ADD_ZOHOCONFIGURATION" translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOCONFIGURATION">\n ADD ZOHOCONFIGURATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newZohoConfiguration" ng-click="vm.deleteZohoConfiguration($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/item/dialog.html",'<md-dialog class="zohoAccount-item-dialog" aria-label="New Item">\n <form name="zohoAccountItemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <div ng-switch="vm.type">\n <div ng-switch-when="subject">\n \x3c!-- SUBJECT SECTION --\x3e\n <div ng-include="\'/subject.html\'"></div>\n \x3c!-- / SUBJECT SECTION --\x3e\n </div>\n <div ng-switch-when="description">\n \x3c!-- DESCRIPTION SECTION --\x3e\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="keyValue">Key Value</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error" ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field\n is required</span>\n </div>\n </div>\n </md-input-container>\n <div ng-if="vm.item.type == \'keyValue\'">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.item.key" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.key.$error" ng-show="zohoAccountItemForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.KEY_REQUIRED">Key field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="keyType" ng-model="vm.item.keyType" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.keyType.$error" ng-show="zohoAccountItemForm.keyType.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="keyContent" ng-model="vm.item.keyContent" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.keyContent.$error" ng-show="zohoAccountItemForm.keyContent.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content\n field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()" required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error" ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable\n name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.keyType == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}\n </md-option>\n </md-select>\n </md-input-container>\n </div>\n \x3c!-- / DESCRIPTION SECTION --\x3e\n </div>\n <div ng-switch-when="field">\n \x3c!-- FIELD SECTION --\x3e\n <div ng-if="vm.accountConnected">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.FIELD">FIELD</label>\n \x3c!-- ITEM TYPE DEFAULT VALUE is STRING --\x3e\n <md-select name="customField" ng-model="vm.customField" required ng-change="vm.item.type = \'string\'">\n\n <md-optgroup label="Standard">\n <md-option ng-value="standard" ng-repeat="standard in vm.fields | filter: {custom: false} ">{{standard.name}}\n </md-option>\n </md-optgroup>\n\n <md-optgroup label="Custom">\n <md-option ng-value="custom" ng-repeat="custom in vm.fields | filter: {custom: true} ">{{custom.name}}\n </md-option>\n </md-optgroup>\n\n </md-select>\n <div ng-messages="zohoAccountItemForm.customField.$error" ng-show="zohoAccountItemForm.customField.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.FIELD_REQUIRED">Field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!-- FIELDS --\x3e\n <div ng-if="vm.customField" ng-include="\'/fields.html\'"></div>\n \x3c!-- FIELDS --\x3e\n\n </div>\n <div ng-if="!vm.accountConnected">\n <p>Account is not connected. Please check your configurations!</p>\n </div>\n \x3c!-- / FIELD SECTION --\x3e\n </div>\n <div ng-switch-default>\n <p>No Item</p>\n </div>\n </div>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newItem" ng-click="vm.saveItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="SAVE" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newItem" ng-click="vm.addNewItem()" class="send-button md-accent md-raised" ng-disabled="zohoAccountItemForm.$invalid || zohoAccountItemForm.$pristine" aria-label="ADD" translate="INTEGRATIONS.ADD" translate-attr-aria-label="INTEGRATIONS.ADD">\n ADD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newItem" ng-click="vm.deleteItem($event)" aria-label="DELETE" translate translate-attr-aria-label="INTEGRATIONS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="INTEGRATIONS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>\n\n<script type="text/ng-template" id="/fields.html">\n\n \x3c!-- type --\x3e\n <md-input-container class="md-block" ng-if="!vm.customField.options.length">\n\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched"\n role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n\n \x3c!--/ type --\x3e\n\n \x3c!-- value --\x3e\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && vm.customField.options.length">\n \x3c!-- options --\x3e\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <md-select name="option" ng-model="vm.item.content" required>\n <md-option ng-value="option.value" ng-repeat="option in vm.customField.options">{{option.name}}</md-option>\n </md-select>\n\n <div ng-messages="zohoAccountItemForm.option.$error"\n ng-show="zohoAccountItemForm.option.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'string\' && !vm.customField.options.length">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n\n <div ng-messages="zohoAccountItemForm.content.$error"\n ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error"\n ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!--/ value --\x3e\n\n<\/script>\n\n<script type="text/ng-template" id="/subject.html">\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.item.type" required>\n <md-option value="string">String</md-option>\n <md-option value="variable">Variable</md-option>\n <md-option value="customVariable">Custom Variable</md-option>\n </md-select>\n <div ng-messages="zohoAccountItemForm.type.$error" ng-show="zohoAccountItemForm.type.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n \n <md-input-container class="md-block" ng-if="vm.item.type == \'string\'">\n <label translate="INTEGRATIONS.CONTENT">Content</label>\n <input type="text" name="content" ng-model="vm.item.content" required md-autofocus>\n <div ng-messages="zohoAccountItemForm.content.$error"\n ng-show="zohoAccountItemForm.content.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.CONTENT_REQUIRED">Content field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'variable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select name="variableName" ng-model="vm.item.variableName" md-selected-text="vm.getSelectedVariable()"\n required>\n <md-optgroup label="Voice: Queue">\n <md-option ng-value="agentColumn" ng-repeat="agentColumn in vm.voiceAgentReportColumns">{{agentColumn}}\n </md-option>\n </md-optgroup>\n <md-optgroup label="Voice: Outbound">\n <md-option ng-value="dialColumn" ng-repeat="dialColumn in vm.voiceDialReportColumns">{{dialColumn}}\n </md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="zohoAccountItemForm.variableName.$error"\n ng-show="zohoAccountItemForm.variableName.$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.VARIABLENAME_REQUIRED">Variable name field is\n required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.item.type == \'customVariable\'">\n <label translate="INTEGRATIONS.VALUE">Value</label>\n <md-select ng-model="vm.item.VariableId" required>\n <md-option ng-value="variable.id" ng-repeat="variable in vm.variables">{{variable.name}}</md-option>\n </md-select>\n </md-input-container>\n <\/script>'),e.put("app/main/apps/integrations/views/zohoAccounts/edit/view.html",'<div id="integrations-zohoAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-zohoAccounts-button md-icon-button" aria-label="Go to zohoAccounts" ng-click="vm.gotoZohoAccounts()" translate translate-attr-aria-label="INTEGRATIONS.GO_TO_ZOHOACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="zohoAccount-image" hide-xs>\n <img ng-src="assets/images/business/zohoAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.zohoAccount.id}}\n <span ng-if="vm.zohoAccount.name">{{vm.zohoAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="INTEGRATIONS.CREATED_AT"></span> <span>{{vm.zohoAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveZohoAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)" translate="INTEGRATIONS.SAVE" translate-attr-aria-label="INTEGRATIONS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.zohoAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.HOST">Host</label>\n <md-select name="host" ng-model="vm.zohoAccount.host" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'zoho.com\'">zoho.com</md-option>\n <md-option ng-value="\'zoho.eu\'">zoho.eu</md-option>\n </md-select>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.zohoAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.MOTIONPROXYADDRESS">MotionProxyAddress</label>\n <input type="url" name="serverUrl" ng-model="vm.zohoAccount.serverUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span></div>\n <div ng-messages="generalForm[\'serverUrl\'].$error" ng-show="generalForm[\'serverUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED">MotionProxyAddress field is required</span>\n </div>\n <div ng-message="url">\n <span translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL">MotionProxyAddress must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="INTEGRATIONS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.zohoAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="zohoAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</div>\n </div>\n <div ng-controller="ZohoAccountConfigurationsController as vm_cc" ng-init="vm_cc.init(vm.zohoAccount, vm.crudPermissions)" layout="row">\n <md-card class="md-whiteframe-1dp" flex="30">\n <div layout="row" layout-align="center center">\n <md-subheader flex="75" class="md-no-sticky">{{ \'INTEGRATIONS.CONFIGURATIONS\' | translate }}</md-subheader>\n <md-button flex="25" ng-if="vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" class="md-icon-button" aria-label="create zohoConfiguration">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n <md-list>\n <md-list-item layout="row" layout-align="center center" ng-repeat="zohoConfiguration in vm_cc.configurations" class="border-top" md-colors="{background: (vm_cc.selectedZohoConfiguration == $index ? \'accent\' : \'grey-A100\')}" ng-click="vm_cc.getZohoConfiguration($index)">\n <span class="text-truncate" flex="80">{{ zohoConfiguration.name }}</span>\n <md-menu ng-if="vm_cc.crudPermissions.canDelete">\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteZohoConfiguration($event, zohoConfiguration)" translate="INTEGRATIONS.DELETE_ZOHOCONFIGURATION">\n Delete ZohoConfiguration\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-list-item>\n </md-list>\n </md-card>\n <div flex></div>\n <md-card class="md-whiteframe-1dp" flex="65">\n <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.subject = query" on-collapse="vm_cc.query.subject = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditSubject($event)" aria-label="add subject" translate translate-attr-label="INTEGRATIONS.ADD_SUBJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedSubjects.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedSubjects.length}} {{vm_cc.selectedSubjects.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedSubjects($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedSubjects">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="subject" md-select-id="id" ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject">\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="id ">{{subject.id}}</td>\n <td ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell class="type ">\n <span ng-if="subject.FieldId">{{subject.nameField || subject.idField}}</span>\n <span ng-if="!subject.FieldId">{{subject.type}}</span>\n </td>\n <td ng-switch="subject.type" ng-click="vm_cc.createOrEditSubject($event, subject)" md-cell>\n <span ng-switch-when="string">{{subject.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{subject.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{subject.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{subject.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[subject.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{subject.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditSubject($event, subject)" translate="INTEGRATIONS.EDIT_SUBJECT">\n Edit Subject\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteSubjectConfirm($event, subject)" translate="INTEGRATIONS.DELETE_SUBJECT">\n Delete Subject\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.DESCRIPTIONS">DESCRIPTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.description = query" on-collapse="vm_cc.query.description = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditDescription($event)" aria-label="add description" translate translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedDescriptions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedDescriptions.length}} {{vm_cc.selectedDescriptions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedDescriptions($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedDescriptions">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="description" md-select-id="id" ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description">\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="id ">{{description.id}}</td>\n <td ng-click="vm_cc.createOrEditDescription($event, description)" md-cell class="type ">\n <span ng-if="description.FieldId">{{description.nameField || description.idField}}</span>\n <span ng-if="!description.FieldId">{{description.type}}</span>\n </td>\n <td ng-switch="description.type" ng-click="vm_cc.createOrEditDescription($event, description)" md-cell>\n <span ng-switch-when="string">{{description.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{description.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{description.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{description.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[description.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{description.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditDescription($event, description)" translate="INTEGRATIONS.EDIT_DESCRIPTION">\n Edit Description\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteDescriptionConfirm($event, description)" translate="INTEGRATIONS.DELETE_DESCRIPTION">\n Delete Description\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n <md-tab>\n <md-tab-label>\n <span translate="INTEGRATIONS.FIELDS">FIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <md-toolbar class="md-table-toolbar md-default no-padding" ng-hide="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <div flex></div>\n <ms-search-bar on-search="vm_cc.query.field = query" on-collapse="vm_cc.query.field = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_cc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_cc.createOrEditField($event)" aria-label="add field" translate translate-attr-label="INTEGRATIONS.ADD_FIELD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_cc.selectedFields.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_cc.selectedFields.length}} {{vm_cc.selectedFields.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_cc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_cc.deleteSelectedFields($event)" aria-label="delete selected" translate translate-attr-label="INTEGRATIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container class="md-whiteframe-1dp padding-horizontal">\n <table md-table md-row-select multiple ng-model="vm_cc.selectedFields">\n <thead md-head>\n <tr md-row>\n <th md-column>{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.TYPE\' | translate }}</th>\n <th md-column>{{ \'INTEGRATIONS.CONTENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="field" md-select-id="id" ng-repeat="field in vm_cc.fields | filter: vm_cc.query.field">\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="id ">{{field.id}}</td>\n <td ng-click="vm_cc.createOrEditField($event, field)" md-cell class="type ">\n <span ng-if="field.FieldId">{{field.nameField || field.idField}}</span>\n <span ng-if="!field.FieldId">{{field.type}}</span>\n </td>\n <td ng-switch="field.type" ng-click="vm_cc.createOrEditField($event, field)" md-cell>\n <span ng-switch-when="string">{{field.content}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n <span ng-switch-when="keyValue">\n {{field.key}}\n <span ng-switch="description.keyType">\n <span ng-switch-when="string">{{field.keyContent}}</span>\n <span ng-switch-when="variable" class="text-boxed">{{field.variableName}}</span>\n <span ng-switch-when="customVariable" class="text-boxed">{{ vm_cc.variablesById[field.VariableId].name }}</span>\n </span>\n </span>\n <span ng-switch-default>{{field.content}}</span>\n </td>\n <td md-cell class="actions" ng-if="!vm_cc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_cc.crudPermissions.canEdit">\n <md-button ng-click="vm_cc.createOrEditField($event, field)" translate="INTEGRATIONS.EDIT_FIELD">\n Edit Field\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">\n <md-button ng-click="vm_cc.deleteFieldConfirm($event, field)" translate="INTEGRATIONS.DELETE_FIELD">\n Delete Field\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-tab-body>\n </md-tab>\n\n\n </md-tabs>\n <div class="padding-20" ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit" ng-click="vm_cc.createOrEditZohoConfiguration($event)" layout="row" layout-sm="column" layout-align="center center" layout-wrap>\n <div class="padding-20 md-whiteframe-3dp md-accent-bg" layout="column" layout-align="center center">\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <span aria-label="add configuration" translate translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION">ADD CONFIGURATION</span>\n </div>\n </div>\n </md-card>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/integrations/views/zohoAccounts/zohoAccounts.html",'<div id="zohoAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-heart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="INTEGRATIONS.ZOHOACCOUNTS">ZohoAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedZohoAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedZohoAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="INTEGRATIONS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-zohoAccounts-count">\n <span>{{vm.selectedZohoAccounts.length}}</span>\n <span translate="INTEGRATIONS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="ZOHOACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllZohoAccounts()" translate="INTEGRATIONS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectZohoAccounts()" translate="INTEGRATIONS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedZohoAccounts" csv-label="true" filename="zohoAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedZohoAccounts($event)" aria-label="delete selected" translate translate-attr-label="ZOHOACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- ZOHOACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedZohoAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getZohoAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'INTEGRATIONS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'INTEGRATIONS.NAME\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'INTEGRATIONS.HOST\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.zohoAccounts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="INTEGRATIONS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="zohoAccount" md-select-id="id" ng-repeat="zohoAccount in vm.zohoAccounts.rows">\n <td md-cell ng-if="zohoAccount.userpic"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="api/users/{{zohoAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!zohoAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{zohoAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="id ">{{zohoAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="name ">{{zohoAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zohoAccount, ev) : vm.createOrEditZohoAccount($event, zohoAccount)" md-cell class="host ">{{ vm.arrayhost[zohoAccount.host].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="INTEGRATIONS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(zohoAccount, $event)" translate="INTEGRATIONS.EDIT_ZOHOACCOUNT">\n Edit ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.testtestintegrationaccount(zohoAccount, $event)" translate="INTEGRATIONS.TEST_ZOHOACCOUNT">\n Test ZohoAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(zohoAccount, $event)" translate="INTEGRATIONS.DELETE_ZOHOACCOUNT">\n Delete ZohoAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'INTEGRATIONS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'INTEGRATIONS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'INTEGRATIONS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.zohoAccounts.count}}" md-on-paginate="vm.getZohoAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / ZOHOACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD ZOHOACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-zohoAccount-button" ng-click="vm.createOrEditZohoAccount($event)" aria-label="add zohoAccount" translate translate-attr-aria-label="INTEGRATIONS.ADD_ZOHOACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD ZOHOACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/jscripty/views/projects/create/dialog.html",'<md-dialog class="project-dialog" aria-label="New Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description">\n\n <div ng-messages="projectForm[\'description\'].$error" ng-show="projectForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newProject" ng-click="vm.saveProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid || projectForm.$pristine" aria-label="SAVE" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newProject" ng-click="vm.addNewProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="ADD" translate="JSCRIPTY.ADD_PROJECT" translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n ADD PROJECT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newProject" ng-click="vm.deleteProject($event)" aria-label="DELETE" translate translate-attr-aria-label="JSCRIPTY.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="JSCRIPTY.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/clone/clone.html",'<md-dialog class="project-dialog" aria-label="Clone Project">\n <form name="projectForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newProject">\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="projectForm[\'name\'].$error" ng-show="projectForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneProject()" class="send-button md-accent md-raised" ng-disabled="projectForm.$invalid" aria-label="CLONE" translate="JSCRIPTY.CLONE_PROJECT" translate-attr-aria-label="JSCRIPTY.CLONE_PROJECT">\n CLONE PROJECT\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/sessions/dialog.html",'<md-dialog class="session-dialog" aria-label="New Session">\n <form name="sessionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <md-list>\n <md-subheader class="md-no-sticky">\n <div class="margin-bottom-5"><span translate="JSCRIPTY.ANSWERS">Answers</span></div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.STARTTIME" class="ng-scope font-weight-700">Start Time</span>: <span class="ng-binding">{{vm.session.starttime | date:\'medium\'}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.MEMBERNAME" class="ng-scope font-weight-700">Member Name</span>: <span class="ng-binding">{{vm.session.membername}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.PROJECT" class="ng-scope font-weight-700">Project</span>: <span class="ng-binding">{{vm.project.name}}</span>\n </div>\n </md-subheader>\n <md-list-item ng-if="vm.questions.rows.length" class="md-2-line contact-item" ng-repeat="question in vm.questions.rows">\n <div class="md-list-item-text compact">\n <h3>{{$index+1}}. {{question.question}}</h3>\n <p>{{question.answer}}</p>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item ng-if="!vm.questions.rows.length" class="md-2-line contact-item">\n <div class="md-list-item-text compact">\n <h3><span class="text-boxed-ligth" translate="JSCRIPTY.NO_RESULTS_AVAILABLE">No results available</span></h3>\n </div>\n </md-list-item>\n </md-list>\n\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/main/apps/jscripty/views/projects/edit/view.html",'<div id="jscripty-project" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-projects-button md-icon-button" aria-label="Go to projects" ng-click="vm.gotoProjects()" translate translate-attr-aria-label="JSCRIPTY.GO_TO_PROJECTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="project-image" hide-xs>\n <img ng-src="assets/images/business/projects.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.project.id}}\n <span ng-if="vm.project.name">{{vm.project.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="JSCRIPTY.CREATED_AT"></span> <span>{{vm.project.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.project, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="JSCRIPTY.CLONE_PROJECT"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveProject()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (builderForm.$invalid) || (previewForm.$invalid) || (sessionsForm.$invalid) || (answersForm.$invalid)" translate="JSCRIPTY.SAVE" translate-attr-aria-label="JSCRIPTY.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="JSCRIPTY.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.project.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="JSCRIPTY.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="JSCRIPTY.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.project.enableUncompleteSave" aria-label="EnableUncompleteSave" ng-disabled="!vm.crudPermissions.canEdit"><span translate="JSCRIPTY.ENABLEUNCOMPLETESAVE">EnableUncompleteSave</span></md-switch>\n <div class="hint"><span translate="JSCRIPTY.HELP.ENABLEUNCOMPLETESAVE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="JSCRIPTY.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.project.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="JSCRIPTY.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.BUILDER">BUILDER</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container builder md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectBuilderController as vm_bc" ng-init="vm_bc.init(vm.project)">\n <mw-form-builder ng-if="vm_bc.project.formData" form-data="vm_bc.project.formData" options="vm_bc.optionsBuilder" read-only="false"></mw-form-builder>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.PREVIEW">PREVIEW</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container preview md-background-bg md-whiteframe-1dp">\n <div layout="column" layout-align="center" ng-controller="ProjectViewerController as vm_vc" ng-init="vm_vc.init(vm.project)">\n <div layout="row" layout-align="center">\n <md-button class="md-raised md-accent" aria-label="Reset" ng-click="vm_vc.resetViewer()">\n Reset\n </md-button>\n </div>\n <mw-form-viewer ng-if="vm_vc.project.formData" form-data="vm_vc.project.formData" response-data="vm_vc.responseData" on-submit="vm_vc.onSubmit($event)" api="vm_vc.formViewer"></mw-form-viewer>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.SESSIONS">SESSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container sessions md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectSessionsController as vm_dc" ng-init="vm_dc.init(vm.project, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="JSCRIPTY.SESSIONS">Sessions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedProjectSessions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedProjectSessions.length}} {{vm_dc.selectedProjectSessions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedProjectSessions" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedProjectSessions($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedProjectSessions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getProjectSessions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'JSCRIPTY.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'JSCRIPTY.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'JSCRIPTY.MEMBERNAME\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'JSCRIPTY.CALLERIDNUM\' | translate }}</th>\n <th md-column md-order-by="completed">{{ \'JSCRIPTY.COMPLETE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="session" md-select-id="id" ng-repeat="session in vm_dc.projectSessions.rows">\n <td md-cell>{{session.id}}</td>\n <td md-cell>{{session.starttime | date:\'medium\'}}</td>\n <td md-cell>{{session.endtime | date:\'medium\'}}</td>\n <td md-cell>{{session.membername}}</td>\n <td md-cell>{{session.calleridnum}}</td>\n <td md-cell class="completed ">\n <md-icon md-colors="{color: {{session.completed ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{session.completed? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.showQuestionsProjectSession($event, session)" translate="JSCRIPTY.SHOW_QUESTIONS_SESSION">\n Results Session\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(session, $event)" translate="JSCRIPTY.DELETE_SESSION">\n Delete Session\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.projectSessions.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="JSCRIPTY.NO_SESSION_AVAILABLE">No session available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.projectSessions.count}}" md-on-paginate="vm_dc.getProjectSessions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="JSCRIPTY.ANSWERS">ANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="project-detail-form-container answers md-background-bg md-whiteframe-1dp">\n <div ng-controller="ProjectAnswersController as vm_an" ng-init="vm_an.init(vm.project)">\n <div class="pb-16" layout="row" layout-align="space-between center">\n <div class="h2 secondary-text" translate="JSCRIPTY.ANSWERS">Answers</div>\n <md-date-range localization-map="vm_an.localizationMap" ng-model="vm_an.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm_an.getAnswers()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n <md-button type="button" ng-disabled="!vm_an.answers" ng-click="vm_an.getSummary($event)" class="md-accent md-raised md-button ng-scope md-default-theme md-ink-ripple md-green-500-bg md-icon-button" title="{{\'JSCRIPTY.EXPORT_TO_CSV\' | translate}}">\n <md-icon md-font-icon="icon-file-excel" class="md-default-theme md-font material-icons icon-file-excel"></md-icon>\n </md-button>\n </div>\n <div layout="row">\n <md-card class="md-whiteframe-1dp" ng-if="vm_an.answers && vm_an.hasIdAnswers" flex>\n <md-list>\n <md-list-item class="md-2-line contact-item" ng-repeat="(key, question) in vm_an.answers">\n <div class="md-list-item-text compact" layout-padding>\n <h3>{{question.question}}</h3>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column></th>\n <th md-column>#</th>\n <th md-column>%</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="(key, value) in question.answers">\n <td md-cell>{{key}}</td>\n <td md-cell width="20px">{{value}}</td>\n <td md-cell width="20px">{{value*100/question.sum | number:1}}</td>\n </tr>\n <tr md-row>\n <td md-cell><b>{{\'JSCRIPTY.TOTAL\' | translate}}</b></td>\n <td md-cell width="20px"><b>{{question.sum}}</b></td>\n <td md-cell width="20px"><b>100</b></td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n </md-list>\n </md-card>\n <span ng-if="!vm_an.answers || !vm_an.hasIdAnswers" class="text-boxed-ligth" translate="JSCRIPTY.NO_ANSWERS_AVAILABLE">No answers available</span>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/jscripty/views/projects/projects.html",'<div id="projects" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-script" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="JSCRIPTY.PROJECTS">Projects</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="JSCRIPTY.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedProjects.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedProjects =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="JSCRIPTY.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-projects-count">\n <span>{{vm.selectedProjects.length}}</span>\n <span translate="JSCRIPTY.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PROJECTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllProjects()" translate="JSCRIPTY.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectProjects()" translate="JSCRIPTY.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedProjects" csv-label="true" filename="projects.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedProjects($event)" aria-label="delete selected" translate translate-attr-label="PROJECTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- PROJECT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedProjects" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getProjects">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'JSCRIPTY.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'JSCRIPTY.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'JSCRIPTY.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'JSCRIPTY.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.projects.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="JSCRIPTY.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="project" md-select-id="id" ng-repeat="project in vm.projects.rows">\n <td md-cell ng-if="project.userpic"><img class="avatar" alt="{{project.name}}" ng-src="api/users/{{project.id}}/avatar" /></td>\n <td md-cell ng-if="!project.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{project.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="id ">{{project.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="name ">{{project.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="description ">{{project.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(project, ev) : vm.createOrEditProject($event, project)" md-cell class="createdAt ">{{project.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="JSCRIPTY.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(project, $event)" translate="JSCRIPTY.EDIT_PROJECT">\n Edit Project\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(project, $event)" translate="JSCRIPTY.CLONE_PROJECT">\n clone Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.sessionsgoto(project, $event)" translate="JSCRIPTY.SESSIONS_PROJECT">\n Sessions Project\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(project, $event)" translate="JSCRIPTY.DELETE_PROJECT">\n Delete Project\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'JSCRIPTY.PAGE\' | translate}}:\', rowsPerPage: \'{{\'JSCRIPTY.ROWSPERPAGE\' | translate}}:\', of: \'{{\'JSCRIPTY.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.projects.count}}" md-on-paginate="vm.getProjects" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PROJECT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PROJECT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-project-button" ng-click="vm.createOrEditProject($event)" aria-label="add project" translate translate-attr-aria-label="JSCRIPTY.ADD_PROJECT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PROJECT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/create/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus>\n\n <div ng-messages="mailAccountForm[\'name\'].$error" ng-show="mailAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'key\'].$error" ng-show="mailAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'email\'].$error" ng-show="mailAccountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'ListId\'].$error" ng-show="mailAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.newMailAccount" class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="cservice" ng-model="vm.mailAccount.cservice" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="mailAccountForm[\'cservice\'].$error" ng-show="mailAccountForm[\'cservice\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Imap.host\'].$error" ng-show="mailAccountForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Imap.port\'].$error" ng-show="mailAccountForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Smtp.host\'].$error" ng-show="mailAccountForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true">\n\n <div ng-messages="mailAccountForm[\'Smtp.port\'].$error" ng-show="mailAccountForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.cservice !== undefined && vm.mailAccount.cservice == null && vm.newMailAccount" class="md-block">\n <md-switch ng-model="vm.mailAccount.cauthentication" aria-label="Authentication"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="cuser" ng-model="vm.mailAccount.cuser" ng-required="true">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="mailAccountForm[\'cuser\'].$error" ng-show="mailAccountForm[\'cuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="(vm.mailAccount.cauthentication == true || vm.mailAccount.cservice != null) && vm.newMailAccount">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="cpassword" ng-model="vm.mailAccount.cpassword" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="mailAccountForm[\'cpassword\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description">\n\n <div ng-messages="mailAccountForm[\'description\'].$error" ng-show="mailAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailAccount" ng-click="vm.saveMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid || mailAccountForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailAccount" ng-click="vm.addNewMailAccount()" class="send-button md-accent md-raised" ng-disabled="mailAccountForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILACCOUNT" translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n ADD MAILACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailAccount" ng-click="vm.deleteMailAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/agentadd/agentadd.html",'<md-dialog class="mailAccount-dialog" aria-label="mailAccount" ng-init="vm.onInit()">\n <form name="mailAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILACCOUNT">Add Agent to mailAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/agent/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'agent\'].$error" ng-show="mailAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'times\'].$error" ng-show="mailAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEXT">Text</label>\n <textarea aria-label="Text text" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.autoreply.text"></textarea>\n </div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/close/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'disposition\'].$error" ng-show="mailAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'condition\'].$error" ng-show="mailAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'truepriority\'].$error" ng-show="mailAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'falsepriority\'].$error" ng-show="mailAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'priority\'].$error" ng-show="mailAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/noop/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'value\'].$error" ng-show="mailAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/queue/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'queue\'].$error" ng-show="mailAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'timeout\'].$error" ng-show="mailAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/system/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="mailAccountFormApp[\'command\'].$error" ng-show="mailAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'variable\'].$error" ng-show="mailAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/apps/tag/dialog.html",'<md-dialog class="mailAccount-dialog" aria-label="New MailAccount">\n <form name="mailAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="mailAccountFormApp[\'tag\'].$error" ng-show="mailAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveMailAccountApp()" class="send-button md-accent md-raised" ng-disabled="mailAccountFormApp.$invalid || mailAccountFormApp.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailCannedAnswers/dialog.html",'<md-dialog class="mailCannedAnswer-dialog" aria-label="New MailCannedAnswer">\n <form name="mailCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.mailCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="mailCannedAnswerForm[\'key\'].$error" ng-show="mailCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.VALUE">Value</label>\n <textarea aria-label="Value value" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailCannedAnswer.value"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailCannedAnswer.description">\n\n <div ng-messages="mailCannedAnswerForm[\'description\'].$error" ng-show="mailCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailCannedAnswer" ng-click="vm.saveMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid || mailCannedAnswerForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailCannedAnswer" ng-click="vm.addNewMailCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="mailCannedAnswerForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILCANNEDANSWER" translate-attr-aria-label="MAIL.ADD_MAILCANNEDANSWER">\n ADD MAILCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailCannedAnswer" ng-click="vm.deleteMailCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/mailDispositions/dialog.html",'<md-dialog class="mailDisposition-dialog" aria-label="New MailDisposition">\n <form name="mailDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.mailDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="mailDispositionForm[\'name\'].$error" ng-show="mailDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailDisposition" ng-click="vm.saveMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid || mailDispositionForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailDisposition" ng-click="vm.addNewMailDisposition()" class="send-button md-accent md-raised" ng-disabled="mailDispositionForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILDISPOSITION" translate-attr-aria-label="MAIL.ADD_MAILDISPOSITION">\n ADD MAILDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailDisposition" ng-click="vm.deleteMailDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailAccounts/edit/view.html",'<div id="mail-mailAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailAccounts-button md-icon-button" aria-label="Go to mailAccounts" ng-click="vm.gotoMailAccounts()" translate translate-attr-aria-label="MAIL.GO_TO_MAILACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailAccount-image" hide-xs>\n <img ng-src="assets/images/business/mailAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailAccount.id}}\n <span ng-if="vm.mailAccount.name">{{vm.mailAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MAIL.GOTO_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (imapForm.$invalid) || (smtpForm.$invalid) || (dispositionForm.$invalid) || (mailDispositionsForm.$invalid) || (mailCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailAccount.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.mailAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="MAIL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.EMAIL_ADDRESS">Email_Address</label>\n <input type="email" name="email" ng-model="vm.mailAccount.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_REQUIRED">Email_Address field is required</span>\n </div>\n <div ng-message="email">\n <span translate="MAIL.ERRORS.EMAIL_ADDRESS_MUST_VALID">Email_Address must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.mailAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_FAMILY">Font_Family</label>\n <ms-font-family name="fontFamily" ng-model="vm.mailAccount.fontFamily" required></ms-font-family>\n <div class="hint"><span translate="MAIL.HELP.FONT_FAMILY"></span></div>\n <div ng-messages="generalForm[\'fontFamily\'].$error" ng-show="generalForm[fontFamily].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_FAMILY_REQUIRED">Font_Family field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.FONT_SIZE">Font_Size</label>\n <input type="number" name="fontSize" ng-model="vm.mailAccount.fontSize" min="8" max="72" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.FONT_SIZE"></span></div>\n <div ng-messages="generalForm[\'fontSize\'].$error" ng-show="generalForm[\'fontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.FONT_SIZE_REQUIRED">Font_Size field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>8</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">Font_Size must be a valid greater or equal than</span> <span>72</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.TEMPLATE">Template</label>\n <textarea aria-label="Template template" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailAccount.template"></textarea>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.markAsUnread" aria-label="mark_as_unread" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MARK_AS_UNREAD">mark_as_unread</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.MARK_AS_UNREAD"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.mailAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="MAIL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.mailAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="mailAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.queueTransfer == true" class="md-block">\n <label translate="MAIL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.mailAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.agentTransfer == true" class="md-block">\n <label translate="MAIL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.mailAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.IMAP">IMAP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container imap md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.IMAP">IMAP</div>\n </div>\n <form name="imapForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Imap.service" ng-model="vm.mailAccount.Imap.service" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="imapForm[\'Imap.service\'].$error" ng-show="imapForm[\'Imap.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_HOST">IMAP_Host</label>\n <input type="text" name="Imap.host" ng-model="vm.mailAccount.Imap.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.host\'].$error" ng-show="imapForm[\'Imap.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_HOST_REQUIRED">IMAP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Imap.service == null)" class="md-block">\n <label translate="MAIL.IMAP_PORT">IMAP_Port</label>\n <input type="number" name="Imap.port" ng-model="vm.mailAccount.Imap.port" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.port\'].$error" ng-show="imapForm[\'Imap.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.IMAP_PORT_REQUIRED">IMAP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.tls" aria-label="ssl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SSL">ssl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Imap.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Imap.user" ng-model="vm.mailAccount.Imap.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="imapForm[\'Imap.user\'].$error" ng-show="imapForm[\'Imap.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Imap.authentication == true || vm.mailAccount.Imap.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Imap.password" ng-model="vm.mailAccount.Imap.password" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="imapForm[\'Imap.password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="MAIL.MAILBOX">mailbox</label>\n <input type="text" name="Imap.mailbox" ng-model="vm.mailAccount.Imap.mailbox" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.mailbox\'].$error" ng-show="imapForm[\'Imap.mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MAILBOX_REQUIRED">mailbox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.CONNTIMEOUT">connTimeout</label>\n <input type="number" name="Imap.connTimeout" ng-model="vm.mailAccount.Imap.connTimeout" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.connTimeout\'].$error" ng-show="imapForm[\'Imap.connTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_REQUIRED">connTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.CONNTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">connTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AUTHTIMEOUT">authTimeout</label>\n <input type="number" name="Imap.authTimeout" ng-model="vm.mailAccount.Imap.authTimeout" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="imapForm[\'Imap.authTimeout\'].$error" ng-show="imapForm[\'Imap.authTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_REQUIRED">authTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AUTHTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">authTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SMTP">SMTP</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container smtp md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.SMTP">SMTP</div>\n </div>\n <form name="smtpForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.SERVICE">Service</label>\n <md-select name="Smtp.service" ng-model="vm.mailAccount.Smtp.service" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SERVICE_REQUIRED">Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.mailAccount.Smtp.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.newMailAccount && vm.mailAccount.cservice == null) || (vm.newMailAccount == undefined && vm.mailAccount.Smtp.service == null)" class="md-block">\n <label translate="MAIL.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.mailAccount.Smtp.port" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.secure" aria-label="Secure" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.SECURE">Secure</span></md-switch>\n <div class="hint"><span translate="MAIL.HELP.SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.mailAccount.Smtp.authentication" aria-label="Authentication" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.AUTHENTICATION">Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null" class="md-block">\n <label translate="MAIL.USERNAME">Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.mailAccount.Smtp.user" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MAIL.HELP.USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.mailAccount.Smtp.authentication == true || vm.mailAccount.Smtp.service != null">\n <label translate="MAIL.PASSWORD">Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.mailAccount.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="MAIL.PASSWORD" required>\n <div class="hint"><span translate="MAIL.HELP.PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.mailAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MAIL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.mailAccount.mandatoryDisposition" class="md-block">\n <label translate="MAIL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.mailAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MAIL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container maildispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailDispositionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILDISPOSITIONS">MailDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailDisposition($event)" aria-label="add mailDisposition" translate translate-attr-label="MAIL.ADD_MAILDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailDispositions.length}} {{vm_dc.selectedMailAccountMailDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailDispositions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailDispositions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailDisposition" md-select-id="id" ng-repeat="mailDisposition in vm_dc.mailAccountMailDispositions.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" md-cell>{{mailDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailDisposition($event, mailDisposition)" translate="MAIL.EDIT_MAILDISPOSITION">\n Edit MailDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailDisposition, $event)" translate="MAIL.DELETE_MAILDISPOSITION">\n Delete MailDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILDISPOSITION_AVAILABLE">No maildisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailDispositions.count}}" md-on-paginate="vm_dc.getMailAccountMailDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container mailcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountMailCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.MAILCANNEDANSWERS">MailCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event)" aria-label="add mailCannedAnswer" translate translate-attr-label="MAIL.ADD_MAILCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountMailCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountMailCannedAnswers.length}} {{vm_dc.selectedMailAccountMailCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountMailCannedAnswers" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountMailCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountMailCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountMailCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'MAIL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mailCannedAnswer" md-select-id="id" ng-repeat="mailCannedAnswer in vm_dc.mailAccountMailCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.value | htmlToPlaintext }}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" md-cell>{{mailCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditMailAccountMailCannedAnswer($event, mailCannedAnswer)" translate="MAIL.EDIT_MAILCANNEDANSWER">\n Edit MailCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mailCannedAnswer, $event)" translate="MAIL.DELETE_MAILCANNEDANSWER">\n Delete MailCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountMailCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="MAIL.NO_MAILCANNEDANSWER_AVAILABLE">No mailcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountMailCannedAnswers.count}}" md-on-paginate="vm_dc.getMailAccountMailCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.mailAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="MAIL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedMailAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedMailAccountApps.length}} {{vm_ac.selectedMailAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedMailAccountApps($event)" aria-label="delete selected" translate translate-attr-label="MAIL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedMailAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.mailAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editMailAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editMailAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.mailAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="MailAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.mailAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getMailAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="MAIL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMailAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMailAccountInteractions.length}} {{vm_dc.selectedMailAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMailAccountInteractions" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMailAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMailAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMailAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'MAIL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'MAIL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'MAIL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'MAIL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MAIL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'MAIL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'MAIL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.mailAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spymailInteraction($event, interaction)" translate="MAIL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event, true)" translate="MAIL.DOWNLOAD_WITH_ATTACHMENTS">\n Download with attachments\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.mailInteractionDownload(interaction, $event)" translate="MAIL.DOWNLOAD_WITHOUT_ATTACHMENTS">\n Download without attachments\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="MAIL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.mailAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="MAIL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.mailAccountInteractions.count}}" md-on-paginate="vm_dc.getMailAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailAccounts/mailAccounts.html",'<div id="mailAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILACCOUNTS">MailAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailAccounts-count">\n <span>{{vm.selectedMailAccounts.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailAccounts()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailAccounts()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailAccounts" csv-label="true" filename="mailAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailAccounts($event)" aria-label="delete selected" translate translate-attr-label="MAILACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'MAIL.EMAIL_ADDRESS\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MAIL.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailAccount" md-select-id="id" ng-repeat="mailAccount in vm.mailAccounts.rows">\n <td md-cell ng-if="mailAccount.userpic"><img class="avatar" alt="{{mailAccount.name}}" ng-src="api/users/{{mailAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!mailAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="id ">{{mailAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="name ">{{mailAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="key ">{{mailAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="email ">{{mailAccount.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="active ">\n <md-icon md-colors="{color: {{mailAccount.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{mailAccount.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailAccount, ev) : vm.createOrEditMailAccount($event, mailAccount)" md-cell class="description ">{{mailAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailAccount, $event)" translate="MAIL.EDIT_MAILACCOUNT">\n Edit MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifysmtpverifysmtp(mailAccount, $event)" translate="MAIL.VERIFYSMTP_MAILACCOUNT">\n verifysmtp MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(mailAccount, $event)" translate="MAIL.INTERACTIONS_MAILACCOUNT">\n Interactions MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailAccount, $event)" translate="MAIL.GOTOREALTIME_MAILACCOUNT">\n goToRealtime MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailAccount, $event)" translate="MAIL.AGENTADD_MAILACCOUNT">\n AgentAdd MailAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailAccount, $event)" translate="MAIL.DELETE_MAILACCOUNT">\n Delete MailAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailAccounts.count}}" md-on-paginate="vm.getMailAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailAccount-button" ng-click="vm.createOrEditMailAccount($event)" aria-label="add mailAccount" translate translate-attr-aria-label="MAIL.ADD_MAILACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailQueues/create/dialog.html",'<md-dialog class="mailQueue-dialog" aria-label="New MailQueue">\n <form name="mailQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newMailQueue">\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="mailQueueForm[\'name\'].$error" ng-show="mailQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="mailQueueForm[\'strategy\'].$error" ng-show="mailQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="mailQueueForm[\'timeout\'].$error" ng-show="mailQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description">\n\n <div ng-messages="mailQueueForm[\'description\'].$error" ng-show="mailQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailQueue" ng-click="vm.saveMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid || mailQueueForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailQueue" ng-click="vm.addNewMailQueue()" class="send-button md-accent md-raised" ng-disabled="mailQueueForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILQUEUE" translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n ADD MAILQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailQueue" ng-click="vm.deleteMailQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/agentadd/agentadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.AGENTADD_MAILQUEUE">Add Agent to mailQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/teamadd/teamadd.html",'<md-dialog class="mailQueue-dialog" aria-label="mailQueue" ng-init="vm.onInit()">\n <form name="mailQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MAIL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailQueues/edit/view.html",'<div id="mail-mailQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-mailQueues-button md-icon-button" aria-label="Go to mailQueues" ng-click="vm.gotoMailQueues()" translate translate-attr-aria-label="MAIL.GO_TO_MAILQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="mailQueue-image" hide-xs>\n <img ng-src="assets/images/business/mailQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.mailQueue.id}}\n <span ng-if="vm.mailQueue.name">{{vm.mailQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MAIL.CREATED_AT"></span> <span>{{vm.mailQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.mailQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MAIL.TEAMADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.mailQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MAIL.AGENTADD_MAILQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMailQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="mailQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MAIL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MAIL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MAIL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.mailQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.mailQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MAIL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/mail/views/mailQueues/mailQueues.html",'<div id="mailQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILQUEUES">MailQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailQueues-count">\n <span>{{vm.selectedMailQueues.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailQueues()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailQueues()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailQueues" csv-label="true" filename="mailQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailQueues($event)" aria-label="delete selected" translate translate-attr-label="MAILQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MAIL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailQueue" md-select-id="id" ng-repeat="mailQueue in vm.mailQueues.rows">\n <td md-cell ng-if="mailQueue.userpic"><img class="avatar" alt="{{mailQueue.name}}" ng-src="api/users/{{mailQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!mailQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="id ">{{mailQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="name ">{{mailQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(mailQueue, ev) : vm.createOrEditMailQueue($event, mailQueue)" md-cell class="strategy ">{{ vm.arraystrategy[mailQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(mailQueue, $event)" translate="MAIL.EDIT_MAILQUEUE">\n Edit MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(mailQueue, $event)" translate="MAIL.TEAMADD_MAILQUEUE">\n teamadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(mailQueue, $event)" translate="MAIL.AGENTADD_MAILQUEUE">\n agentadd MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailQueue, $event)" translate="MAIL.DELETE_MAILQUEUE">\n Delete MailQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(mailQueue, $event)" translate="MAIL.GOTOREALTIME_MAILQUEUE">\n goToRealtime MailQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailQueues.count}}" md-on-paginate="vm.getMailQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailQueue-button" ng-click="vm.createOrEditMailQueue($event)" aria-label="add mailQueue" translate translate-attr-aria-label="MAIL.ADD_MAILQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/mailSubtatuses/create/dialog.html",'<md-dialog class="mailSubstatus-dialog" aria-label="New MailSubstatus">\n <form name="mailSubstatusForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MAIL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.mailSubstatus.name" ng-required="true" autofocus>\n\n <div ng-messages="mailSubstatusForm[\'name\'].$error" ng-show="mailSubstatusForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MAIL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.mailSubstatus.description">\n\n <div ng-messages="mailSubstatusForm[\'description\'].$error" ng-show="mailSubstatusForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MAIL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMailSubstatus" ng-click="vm.saveMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid || mailSubstatusForm.$pristine" aria-label="SAVE" translate="MAIL.SAVE" translate-attr-aria-label="MAIL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMailSubstatus" ng-click="vm.addNewMailSubstatus()" class="send-button md-accent md-raised" ng-disabled="mailSubstatusForm.$invalid" aria-label="ADD" translate="MAIL.ADD_MAILSUBSTATUS" translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n ADD MAILSUBSTATUS\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMailSubstatus" ng-click="vm.deleteMailSubstatus($event)" aria-label="DELETE" translate translate-attr-aria-label="MAIL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MAIL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/mail/views/mailSubtatuses/mailSubtatuses.html",'<div id="mailSubtatuses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-email" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MAIL.MAILSUBSTATUSES">MailSubstatuses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MAIL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMailSubstatuses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMailSubstatuses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MAIL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-mailSubtatuses-count">\n <span>{{vm.selectedMailSubstatuses.length}}</span>\n <span translate="MAIL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MAILSUBSTATUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMailSubstatuses()" translate="MAIL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMailSubstatuses()" translate="MAIL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMailSubstatuses" csv-label="true" filename="mailSubtatuses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMailSubstatuses($event)" aria-label="delete selected" translate translate-attr-label="MAILSUBSTATUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MAILSUBSTATUS TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMailSubstatuses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailSubstatuses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MAIL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MAIL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailSubtatuses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="mailSubstatus" md-select-id="id" ng-repeat="mailSubstatus in vm.mailSubtatuses.rows">\n <td md-cell ng-if="mailSubstatus.userpic"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="api/users/{{mailSubstatus.id}}/avatar" /></td>\n <td md-cell ng-if="!mailSubstatus.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{mailSubstatus.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="id ">{{mailSubstatus.id}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="name ">{{mailSubstatus.name}}</td>\n <td ng-click="vm.createOrEditMailSubstatus($event, mailSubstatus)" md-cell class="description ">{{mailSubstatus.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(mailSubstatus, $event)" translate="MAIL.EDIT_MAILSUBSTATUS">\n Edit MailSubstatus\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(mailSubstatus, $event)" translate="MAIL.DELETE_MAILSUBSTATUS">\n Delete MailSubstatus\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.mailSubtatuses.count}}" md-on-paginate="vm.getMailSubstatuses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MAILSUBSTATUS TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MAILSUBSTATUS BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-mailSubstatus-button" ng-click="vm.createOrEditMailSubstatus($event)" aria-label="add mailSubstatus" translate translate-attr-aria-label="MAIL.ADD_MAILSUBSTATUS">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MAILSUBSTATUS BUTTON --\x3e\n</div>'),e.put("app/main/apps/mail/views/realtime/accounts/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.ACCOUNTS">Accounts</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMailAccounts">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.KEY\' | translate }}</th>\n <th md-column>{{ \'MAIL.TOTAL\' | translate }}</th>\n <th md-column>{{ \'MAIL.IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.OUT\' | translate }}</th>\n <th md-column>{{ \'MAIL.IMAP_STATUS\' | translate }}</th>\n <th md-column>{{ \'MAIL.SMTP_STATUS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.mailAccounts">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.mailAccounts[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.mailAccounts[value].name}}</td>\n <td md-cell>{{vm.mailAccounts[value].key}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(vm.mailAccounts[value].in || 0) + (vm.mailAccounts[value].out || 0)}}</span>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-down-bold blue-fg"></md-icon>\n </span>\n <span class="md-capture blue-fg">{{vm.mailAccounts[value].in || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.in">{{vm.mailAccounts[value].lastIn ? (vm.mailAccounts[value].lastIn | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row">\n <span>\n <md-icon md-font-icon="icon-arrow-up-bold green-fg"></md-icon>\n </span>\n <span class="md-capture green-fg">{{vm.mailAccounts[value].out || 0}}</span>\n <span class="text-boxed" ng-if="mailAccount.out">{{vm.mailAccounts[value].lastOut ? (vm.mailAccounts[value].lastOut | date: \'shortTime\') : \'\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Imap.messageStatus}}</md-tooltip>\n <div ng-switch="vm.mailAccounts[value].Imap.status">\n <md-icon ng-switch-when="error" md-font-icon="icon-alert yellow-fg"></md-icon>\n <md-icon ng-switch-when="disabled" md-font-icon="icon-close grey-fg"></md-icon>\n <md-icon ng-switch-default md-font-icon="icon-checkbox-marked-circle-outline green-fg"></md-icon>\n </div>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Imap.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed" ng-if="vm.mailAccounts[value].active">{{vm.mailAccounts[value].Imap.lastSync | date: \'shortTime\'}}</span>\n </div>\n </td>\n <td md-cell>\n <div layout="row" layout-align="start center" ng-if="vm.mailAccounts[value].Smtp.status">\n <div layout="column" layout-align="center center">\n <md-button class="md-icon-button" aria-label="Status">\n <md-tooltip>{{vm.mailAccounts[value].Smtp.messageStatus}}</md-tooltip>\n <md-icon md-font-icon="{{ vm.mailAccounts[value].Smtp.status == \'error\' ? \'icon-alert yellow-fg\' : \'icon-checkbox-marked-circle-outline green-fg\'}}"></md-icon>\n </md-button>\n <span class="md-caption grey-fg">{{ (\'MAIL.\' + vm.mailAccounts[value].Smtp.status.toUpperCase()) | translate}}</span>\n </div>\n <span class="text-boxed">{{vm.mailAccounts[value].Smtp.lastSync | date: \'shortTime\'}}</span>\n </div>\n <span class="md-caption grey-fg" ng-if="!vm.mailAccounts[value].Smtp.status">{{ \'MAIL.NEVER_VERIFIED\' | translate }}</span>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.goToMailAccount($event, vm.mailAccounts[value])" translate="MAIL.EDIT_ACCOUNT">\n Edit Account\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.verifySmtp($event, vm.mailAccounts[value])" translate="MAIL.VERIFY_SMTP">\n Verify Smtp\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getmailAccounts" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MAIL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MAIL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MAIL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MAIL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MAIL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'MAIL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MAIL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MAIL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'MAIL.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'MAIL.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MAIL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"MAIL.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"MAIL.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"MAIL.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"MAIL.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"MAIL.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'MAIL.PAGE' | translate}}:', rowsPerPage: '{{'MAIL.ROWSPERPAGE' | translate}}:', of: '{{'MAIL.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/mail/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MAIL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MAIL.NAME\' | translate }}</th>\n <th md-column>{{ \'MAIL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MAIL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MAIL.READY\' | translate }}</th>\n <th md-column>{{ \'MAIL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="MAIL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MAIL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMailQueue($event, vm.queues[value])" translate="MAIL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MAIL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MAIL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MAIL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MAIL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/mail/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MAIL.ACCOUNTS">Accounts</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/create/dialog.html",'<md-dialog class="plugin-dialog" aria-label="New Plugin">\n <form name="pluginForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus>\n\n <div ng-messages="pluginForm[\'name\'].$error" ng-show="pluginForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'type\'].$error" ng-show="pluginForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="!vm.newPlugin"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description">\n\n <div ng-messages="pluginForm[\'description\'].$error" ng-show="pluginForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true">\n\n <div ng-messages="pluginForm[\'icon\'].$error" ng-show="pluginForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required>\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="pluginForm[\'sidebar\'].$error" ng-show="pluginForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl">\n\n <div ng-messages="pluginForm[\'adminUrl\'].$error" ng-show="pluginForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl">\n\n <div ng-messages="pluginForm[\'agentUrl\'].$error" ng-show="pluginForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'scriptName\'].$error" ng-show="pluginForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true">\n\n <div ng-messages="pluginForm[\'scriptPath\'].$error" ng-show="pluginForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" ng-disabled="!vm.newPlugin">\n\n <div ng-messages="pluginForm[\'version\'].$error" ng-show="pluginForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPlugin" ng-click="vm.savePlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid || pluginForm.$pristine" aria-label="SAVE" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPlugin" ng-click="vm.addNewPlugin()" class="send-button md-accent md-raised" ng-disabled="pluginForm.$invalid" aria-label="ADD" translate="MARKETPLACE.ADD_PLUGIN" translate-attr-aria-label="MARKETPLACE.ADD_PLUGIN">\n ADD PLUGIN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPlugin" ng-click="vm.deletePlugin($event)" aria-label="DELETE" translate translate-attr-aria-label="MARKETPLACE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MARKETPLACE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/marketplace/views/plugins/edit/view.html",'<div id="marketplace-plugin" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-plugins-button md-icon-button" aria-label="Go to plugins" ng-click="vm.gotoPlugins()" translate translate-attr-aria-label="MARKETPLACE.GO_TO_PLUGINS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="plugin-image" hide-xs>\n <img ng-src="assets/images/business/plugins.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.plugin.id}}\n <span ng-if="vm.plugin.name">{{vm.plugin.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MARKETPLACE.CREATED_AT"></span> <span>{{vm.plugin.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.savePlugin()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="MARKETPLACE.SAVE" translate-attr-aria-label="MARKETPLACE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MARKETPLACE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="plugin-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MARKETPLACE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.plugin.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.TYPE">Type</label>\n <input type="text" name="type" ng-model="vm.plugin.type" disabled>\n\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.plugin.active" aria-label="Active" ng-disabled="true"><span translate="MARKETPLACE.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.plugin.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.ICON">Icon</label>\n <input type="text" name="icon" ng-model="vm.plugin.icon" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'icon\'].$error" ng-show="generalForm[\'icon\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ICON_REQUIRED">Icon field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.SIDEBAR">Sidebar</label>\n <md-select name="sidebar" ng-model="vm.plugin.sidebar" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'always\'">Always</md-option>\n <md-option ng-value="\'adminOnly\'">Admin Only</md-option>\n <md-option ng-value="\'agentOnly\'">Agent Only</md-option>\n <md-option ng-value="\'never\'">Never</md-option>\n </md-select>\n <div ng-messages="generalForm[\'sidebar\'].$error" ng-show="generalForm[\'sidebar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SIDEBAR_REQUIRED">Sidebar field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'adminOnly\'" class="md-block">\n <label translate="MARKETPLACE.ADMINURL">AdminUrl</label>\n <input type="text" name="adminUrl" ng-model="vm.plugin.adminUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'adminUrl\'].$error" ng-show="generalForm[\'adminUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.ADMINURL_REQUIRED">AdminUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.sidebar === \'always\' || vm.plugin.sidebar === \'agentOnly\'" class="md-block">\n <label translate="MARKETPLACE.AGENTURL">AgentUrl</label>\n <input type="text" name="agentUrl" ng-model="vm.plugin.agentUrl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'agentUrl\'].$error" ng-show="generalForm[\'agentUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.AGENTURL_REQUIRED">AgentUrl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTNAME">ScriptName</label>\n <input type="text" name="scriptName" ng-model="vm.plugin.scriptName" disabled>\n\n <div ng-messages="generalForm[\'scriptName\'].$error" ng-show="generalForm[\'scriptName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTNAME_REQUIRED">ScriptName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.plugin.type === \'script\'" class="md-block">\n <label translate="MARKETPLACE.SCRIPTPATH">ScriptPath</label>\n <input type="text" name="scriptPath" ng-model="vm.plugin.scriptPath" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'scriptPath\'].$error" ng-show="generalForm[\'scriptPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.SCRIPTPATH_REQUIRED">ScriptPath field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MARKETPLACE.VERSION">Version</label>\n <input type="text" name="version" ng-model="vm.plugin.version" disabled>\n\n <div ng-messages="generalForm[\'version\'].$error" ng-show="generalForm[\'version\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MARKETPLACE.ERRORS.VERSION_REQUIRED">Version field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/marketplace/views/plugins/plugins.html",'<div id="plugins" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cart" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MARKETPLACE.PLUGINS">Plugins</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MARKETPLACE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPlugins.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPlugins =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MARKETPLACE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-plugins-count">\n <span>{{vm.selectedPlugins.length}}</span>\n <span translate="MARKETPLACE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PLUGINS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPlugins()" translate="MARKETPLACE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPlugins()" translate="MARKETPLACE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPlugins" csv-label="true" filename="plugins.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPlugins($event)" aria-label="delete selected" translate translate-attr-label="PLUGINS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div ng-if="vm.installing">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="MARKETPLACE.INSTALLING">Installing</span>\n <md-progress-linear md-mode="indeterminate" class="md-accent padding-20"></md-progress-linear>\n </div>\n </md-card>\n </div>\n\n \x3c!-- PLUGIN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPlugins" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPlugins">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="name">{{ \'MARKETPLACE.NAME\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'MARKETPLACE.TYPE\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MARKETPLACE.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'MARKETPLACE.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="version">{{ \'MARKETPLACE.VERSION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.plugins.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MARKETPLACE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="plugin" md-select-id="id" ng-repeat="plugin in vm.plugins.rows">\n <td md-cell ng-if="plugin.userpic"><img class="avatar" alt="{{plugin.name}}" ng-src="api/users/{{plugin.id}}/avatar" /></td>\n <td md-cell ng-if="!plugin.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{plugin.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="name ">{{plugin.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="type ">{{plugin.type}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="active ">\n <md-icon md-colors="{color: {{plugin.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{plugin.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="description ">{{plugin.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(plugin, ev) : vm.createOrEditPlugin($event, plugin)" md-cell class="version ">{{plugin.version}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MARKETPLACE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit && !plugin.active">\n <md-button ng-click="vm.installplugin(plugin, $event)" translate="MARKETPLACE.INSTALL_PLUGIN">\n Install Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(plugin, $event)" translate="MARKETPLACE.EDIT_PLUGIN">\n Edit Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n <md-button ng-click="vm.stopplugin(plugin, $event)" translate="MARKETPLACE.STOP_PLUGIN">\n Stop Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active && plugin.type == \'script\'">\n <md-button ng-click="vm.restartplugin(plugin, $event)" translate="MARKETPLACE.RESTART_PLUGIN">\n Restart Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(plugin, $event)" translate="MARKETPLACE.DOWNLOAD_PLUGIN">\n Download Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit && plugin.active">\n <md-button ng-click="vm.uninstallplugin(plugin, $event)" translate="MARKETPLACE.UNINSTALL_PLUGIN">\n Uninstall Plugin\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(plugin, $event)" translate="MARKETPLACE.DELETE_PLUGIN">\n Delete Plugin\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MARKETPLACE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MARKETPLACE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MARKETPLACE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.plugins.count}}" md-on-paginate="vm.getPlugins" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PLUGIN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD PLUGIN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-plugin-button" ng-click="vm.uploadPlugin($event)" aria-label="upload plugin" translate translate-attr-aria-label="MARKETPLACE.UPLOAD_PLUGIN">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD PLUGIN BUTTON --\x3e\n</div>'),e.put("app/main/apps/marketplace/views/plugins/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="plugin-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="MARKETPLACE.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="MARKETPLACE.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="MARKETPLACE.UPLOADING">Uploading</span>\n <span>{{vm.plugin.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="MARKETPLACE.FINISH" translate-attr-aria-label="MARKETPLACE.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/create/dialog.html",'<md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'TrunkId\'].$error" ng-show="ivrCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'IntervalId\'].$error" ng-show="ivrCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="ivrCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" required>\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="ivrCampaignForm[\'SquareProjectId\'].$error" ng-show="ivrCampaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="ivrCampaignForm[\'limitCalls\'].$error" ng-show="ivrCampaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description">\n\n <div ng-messages="ivrCampaignForm[\'description\'].$error" ng-show="ivrCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign" ng-click="vm.saveIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign" ng-click="vm.addNewIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n ADD IVRCAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign" ng-click="vm.deleteIvrCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/clone/clone.html",'<md-dialog class="ivrCampaign-dialog" aria-label="Clone IvrCampaign">\n <form name="ivrCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newIvrCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="ivrCampaignForm[\'name\'].$error" ng-show="ivrCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneIvrCampaign()" class="send-button md-accent md-raised" ng-disabled="ivrCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n CLONE IVRCAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/listadd/listadd.html",'<md-dialog class="ivrCampaign-dialog" aria-label="ivrCampaign" ng-init="vm.onInit()">\n <form name="ivrCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">Add List in IVRCAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/edit/view.html",'<div id="motiondialer-ivrCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-ivrCampaigns-button md-icon-button" aria-label="Go to ivrCampaigns" ng-click="vm.gotoIvrCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_IVRCAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="ivrCampaign-image" hide-xs>\n <img ng-src="assets/images/business/ivrCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.ivrCampaign.id}}\n <span ng-if="vm.ivrCampaign.name">{{vm.ivrCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.ivrCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.ivrCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.ivrCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_IVRCAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveIvrCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.ivrCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.ivrCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.ivrCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.ivrCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.ivrCampaign.dialCutDigit" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.ivrCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="SquareProjectId" ng-model="vm.ivrCampaign.SquareProjectId" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="SquareProjectId.id" ng-repeat="SquareProjectId in vm.projects" ng-disabled="SquareProjectId.canSelect === false">{{ SquareProjectId.name }}</md-option>\n </md-select>\n <div ng-messages="campaignForm[\'SquareProjectId\'].$error" ng-show="campaignForm[\'SquareProjectId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>\n <input type="number" name="limitCalls" ng-model="vm.ivrCampaign.limitCalls" min="1" max="200" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'limitCalls\'].$error" ng-show="campaignForm[\'limitCalls\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED">ConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">ConcurrentCalls must be a valid greater or equal than</span> <span>200</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.ivrCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.ivrCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.ivrCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.ivrCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.ivrCampaign.dialPrefix" ng-pattern="/^\\d+$/" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.ivrCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.ivrCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.ivrCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.ivrCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.ivrCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.ivrCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.ivrCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.ivrCampaign.dialOrderByScheduledAt" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.ivrCampaign.dialGlobalInterval" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.ivrCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="ivrCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.ivrCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.ivrCampaign.dialAMDInitialSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.ivrCampaign.dialAMDGreeting" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.ivrCampaign.dialAMDAfterGreetingSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.ivrCampaign.dialAMDTotalAnalysisTime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.ivrCampaign.dialAMDMinWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.ivrCampaign.dialAMDBetweenWordsSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.ivrCampaign.dialAMDMaximumNumberOfWords" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.ivrCampaign.dialAMDSilenceThreshold" min="0" max="32767" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.ivrCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.ivrCampaign.dialAMDMaximumWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.ivrCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.ivrCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="ivrCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHoppers.length}} {{vm_dc.selectedIvrCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHoppers" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIvrCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.ivrCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIvrCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHoppers.rows.length">\n <td md-cell colspan="10">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHoppers.count}}" md-on-paginate="vm_dc.getIvrCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperHistories.length}} {{vm_dc.selectedIvrCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperHistories" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.ivrCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getIvrCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsIvrCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsIvrCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperFinals.length}} {{vm_dc.selectedIvrCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperFinals" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedIvrCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="IVRCAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.ivrCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="ivrCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="IvrCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.ivrCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIvrCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIvrCampaignHopperBlacks.length}} {{vm_dc.selectedIvrCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIvrCampaignHopperBlacks" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIvrCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIvrCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.ivrCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.ivrCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.ivrCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getIvrCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/ivrCampaigns/ivrCampaigns.html",'<div id="ivrCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.IVRCAMPAIGNS">IvrCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIvrCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIvrCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-ivrCampaigns-count">\n <span>{{vm.selectedIvrCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="IVRCAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIvrCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIvrCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIvrCampaigns" csv-label="true" filename="ivrCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIvrCampaigns($event)" aria-label="delete selected" translate translate-attr-label="IVRCAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- IVRCAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIvrCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIvrCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="SquareProjectId">{{ \'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.ivrCampaigns.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="ivrCampaign" md-select-id="id" ng-repeat="ivrCampaign in vm.ivrCampaigns.rows">\n <td md-cell ng-if="ivrCampaign.userpic"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="api/users/{{ivrCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!ivrCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{ivrCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="id ">{{ivrCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="name ">{{ivrCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="active ">\n <md-icon md-colors="{color: {{ivrCampaign.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{ivrCampaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':ivrCampaign.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(ivrCampaign, ev) : vm.createOrEditIvrCampaign($event, ivrCampaign)" md-cell class="SquareProjectId ">{{ (vm.projects | filter : {\'id\':ivrCampaign.SquareProjectId})[0].name }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(ivrCampaign, $event)" translate="MOTIONDIALER.EDIT_IVRCAMPAIGN">\n Edit IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(ivrCampaign, $event)" translate="MOTIONDIALER.CLONE_IVRCAMPAIGN">\n clone IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.LISTADD_IVRCAMPAIGN">\n listadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(ivrCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_IVRCAMPAIGN">\n blacklistadd IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(ivrCampaign, $event)" translate="MOTIONDIALER.DELETE_IVRCAMPAIGN">\n Delete IvrCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(ivrCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_IVRCAMPAIGN">\n goToRealtime IvrCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.ivrCampaigns.count}}" md-on-paginate="vm.getIvrCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / IVRCAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD IVRCAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-ivrCampaign-button" ng-click="vm.createOrEditIvrCampaign($event)" aria-label="add ivrCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD IVRCAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/create/dialog.html",'<md-dialog class="queueCampaign-dialog" aria-label="New QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required>\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'TrunkId\'].$error" ng-show="queueCampaignForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required>\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'IntervalId\'].$error" ng-show="queueCampaignForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required>\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="queueCampaignForm[\'dialCheckDuplicateType\'].$error" ng-show="queueCampaignForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" required>\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="queueCampaignForm[\'dialMethod\'].$error" ng-show="queueCampaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="queueCampaignForm[\'dialPredictiveOptimization\'].$error" ng-show="queueCampaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="queueCampaignForm[\'dialLimitQueue\'].$error" ng-show="queueCampaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'dialQueueTimeout\'].$error" ng-show="queueCampaignForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="queueCampaignForm[\'timeout\'].$error" ng-show="queueCampaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description">\n\n <div ng-messages="queueCampaignForm[\'description\'].$error" ng-show="queueCampaignForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newQueueCampaign" ng-click="vm.saveQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid || queueCampaignForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newQueueCampaign" ng-click="vm.addNewQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n ADD QUEUECAMPAIGN\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newQueueCampaign" ng-click="vm.deleteQueueCampaign($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/agentadd/agentadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">Add Agent to queueCampaign</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/blacklistadd/blacklistadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/clone/clone.html",'<md-dialog class="queueCampaign-dialog" aria-label="Clone QueueCampaign">\n <form name="queueCampaignForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newQueueCampaign">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="queueCampaignForm[\'name\'].$error" ng-show="queueCampaignForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneQueueCampaign()" class="send-button md-accent md-raised" ng-disabled="queueCampaignForm.$invalid" aria-label="CLONE" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN" translate-attr-aria-label="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n CLONE QUEUECAMPAIGN\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/hoppers/dialog.html",'<md-dialog class="hopper-dialog" aria-label="New Hopper">\n <form name="hopperForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div class="md-block">\n <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click name="scheduledatDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.dateRangeFrom.$error" ng-show="hopperForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click name="scheduledatTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.hopper.scheduledat" ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)">\n <div ng-messages="hopperForm.timeRangeFrom.$error" ng-show="hopperForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="MOTIONDIALER.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PRIORITY">Priority</label>\n <md-select name="priority" ng-model="vm.hopper.priority">\n <md-option ng-value="\'4\'">Highest</md-option>\n <md-option ng-value="\'3\'">High</md-option>\n <md-option ng-value="\'2\'">Medium</md-option>\n <md-option ng-value="\'1\'">Low</md-option>\n <md-option ng-value="\'0\'">Lowest</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PRIORITY"></span></div>\n <div ng-messages="hopperForm[\'priority\'].$error" ng-show="hopperForm[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"><span translate="MOTIONDIALER.RECALLAGENT">RecallAgent</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.hopper.recallme" class="md-block">\n <label translate="MOTIONDIALER.AGENT">Agent</label>\n <md-select name="UserId" ng-model="vm.hopper.UserId" required>\n <md-option ng-value="UserId.id" ng-repeat="UserId in vm.agents" ng-disabled="UserId.canSelect === false">{{ UserId.name }}</md-option>\n </md-select>\n <div ng-messages="hopperForm[\'UserId\'].$error" ng-show="hopperForm[\'UserId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newHopper" ng-click="vm.saveHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid || hopperForm.$pristine" aria-label="SAVE" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newHopper" ng-click="vm.addNewHopper()" class="send-button md-accent md-raised" ng-disabled="hopperForm.$invalid" aria-label="ADD" translate="MOTIONDIALER.ADD_HOPPER" translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER">\n ADD HOPPER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newHopper" ng-click="vm.deleteHopper($event)" aria-label="DELETE" translate translate-attr-aria-label="MOTIONDIALER.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/listadd/listadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">Add List in QUEUECAMPAIGN</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect ng-hide="vm.loading" options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveLists()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/resetlist/resetlist.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.RESETLIST ">Reset List</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-disabled="vm.loading" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ng-hide="vm.loading">\n <div layout="row" layout-wrap flex>\n <div flex-xs flex="50">\n <md-checkbox aria-label="Select All" ng-checked="vm.isChecked()" md-indeterminate="vm.isIndeterminate()" ng-click="vm.toggleAll()">\n <span ng-if="vm.isChecked()" translate="MOTIONDIALER.UNSELECTALL"></span>\n <span ng-if="!vm.isChecked()" translate="MOTIONDIALER.SELECTALL"></span>\n </md-checkbox>\n </div>\n <div flex-xs flex="50">\n </div>\n <div flex="{{vm.items.length > 10 ? 50 : 100 }}" ng-repeat="item in vm.items">\n <md-checkbox ng-checked="vm.exists(item, vm.selected)" ng-click="vm.toggle(item, vm.selected)">\n {{ item.name | limitTo:40 }}\n </md-checkbox>\n </div>\n </div>\n </md-dialog-content>\n <md-dialog-actions ng-hide="vm.loading" layout="row" layout-align="end center">\n <div>\n </div>\n <md-button type="submit" ng-click="vm.listSelected()" class="send-button md-accent md-raised" ng-disabled="vm.loading" aria-label="RESET" translate="MOTIONDIALER.RESET" translate-attr-aria-label="MOTIONDIALER.RESET">\n SAVE\n </md-button>\n </md-dialog-actions>\n <div ng-hide="!vm.loading" layout-fill style="min-height: 397px;" layout="row" layout-sm="column" layout-align="center center">\n <md-progress-circular class="md-primary md-hue-1" md-diameter="96"></md-progress-circular>\n </div>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/teamadd/teamadd.html",'<md-dialog class="queueCampaign-dialog" aria-label="queueCampaign" ng-init="vm.onInit()">\n <form name="queueCampaignForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="MOTIONDIALER.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="MOTIONDIALER.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="queueCampaignForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/edit/view.html",'<div id="motiondialer-queueCampaign" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-queueCampaigns-button md-icon-button" aria-label="Go to queueCampaigns" ng-click="vm.gotoQueueCampaigns()" translate translate-attr-aria-label="MOTIONDIALER.GO_TO_QUEUECAMPAIGNS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="queueCampaign-image" hide-xs>\n <img ng-src="assets/images/business/queueCampaigns.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.queueCampaign.id}}\n <span ng-if="vm.queueCampaign.name">{{vm.queueCampaign.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="MOTIONDIALER.CREATED_AT"></span> <span>{{vm.queueCampaign.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.listadddialog(vm.queueCampaign, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="listadd">\n <md-tooltip><span translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-format-list-numbers"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.blacklistadddialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="blacklistadd">\n <md-tooltip><span translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-block-helper"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.queueCampaign, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.queueCampaign, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.resetlistdialog(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="resetlist">\n <md-tooltip><span translate="MOTIONDIALER.RESETLIST_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-restore"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.queueCampaign, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="MOTIONDIALER.GOTO_QUEUECAMPAIGN"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveQueueCampaign()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (campaignForm.$invalid) || (queueForm.$invalid) || (originateForm.$invalid) || (globalForm.$invalid) || (congestionForm.$invalid) || (busyForm.$invalid) || (noanswerForm.$invalid) || (advancedForm.$invalid) || (advancedpreviewForm.$invalid) || (recallmeForm.$invalid) || (globalintervalForm.$invalid) || (timezoneForm.$invalid) || (amdForm.$invalid) || (hopperStatisticsForm.$invalid) || (hoppersForm.$invalid) || (hopperHistoriesForm.$invalid) || (hopperFinalsForm.$invalid) || (hopperBlacksForm.$invalid)" translate="MOTIONDIALER.SAVE" translate-attr-aria-label="MOTIONDIALER.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.queueCampaign.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialActive" aria-label="Active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TRUNK">Trunk</label>\n <md-select name="TrunkId" ng-model="vm.queueCampaign.TrunkId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="TrunkId.id" ng-repeat="TrunkId in vm.trunks" ng-disabled="TrunkId.canSelect === false">{{ TrunkId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkId\'].$error" ng-show="generalForm[\'TrunkId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BACKUPTRUNK">BackupTrunk</label>\n <md-select name="TrunkBackupId" ng-model="vm.queueCampaign.TrunkBackupId" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="TrunkBackupId.id" ng-repeat="TrunkBackupId in vm.trunks" ng-disabled="TrunkBackupId.canSelect === false">{{ TrunkBackupId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'TrunkBackupId\'].$error" ng-show="generalForm[\'TrunkBackupId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BACKUPTRUNK_REQUIRED">BackupTrunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.INTERVAL">Interval</label>\n <md-select name="IntervalId" ng-model="vm.queueCampaign.IntervalId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="IntervalId.id" ng-repeat="IntervalId in vm.interval" ng-disabled="IntervalId.canSelect === false">{{ IntervalId.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'IntervalId\'].$error" ng-show="generalForm[\'IntervalId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED">Interval field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>\n <md-select name="dialCheckDuplicateType" ng-model="vm.queueCampaign.dialCheckDuplicateType" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'always\'"> {{ \'MOTIONDIALER.ALWAYS\' | translate }} </md-option>\n\n <md-option ng-value="\'never\'"> {{ \'MOTIONDIALER.NEVER\' | translate }} </md-option>\n\n <md-option ng-value="\'onlyIfOpen\'"> {{ \'MOTIONDIALER.ONLY_IF_OPEN\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'dialCheckDuplicateType\'].$error" ng-show="generalForm[\'dialCheckDuplicateType\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED">CheckDuplicate field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CUTDIGIT">CutDigit</label>\n <input type="number" name="dialCutDigit" ng-model="vm.queueCampaign.dialCutDigit" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'dialCutDigit\'].$error" ng-show="generalForm[\'dialCutDigit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_REQUIRED">CutDigit field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO">CutDigit must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.queueCampaign.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container campaign md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CAMPAIGN">CAMPAIGN</div>\n </div>\n <form name="campaignForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.METHOD">Method</label>\n <md-select name="dialMethod" ng-model="vm.queueCampaign.dialMethod" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'progressive\'">Progressive</md-option>\n <md-option ng-value="\'power\'">PowerDialing</md-option>\n <md-option ng-value="\'predictive\'">Predictive</md-option>\n <md-option ng-value="\'preview\'">Preview</md-option>\n <md-option ng-value="\'booked\'">BookedProgressive</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.METHOD"></span></div>\n <div ng-messages="campaignForm[\'dialMethod\'].$error" ng-show="campaignForm[\'dialMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'power\'" class="md-block">\n <span translate="MOTIONDIALER.POWERLEVEL">PowerLevel</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.POWERLEVEL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPowerLevel" min="1" max="10" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <label translate="MOTIONDIALER.PREDICTIVEOPTIMIZATION">PredictiveOptimization</label>\n <md-select name="dialPredictiveOptimization" ng-model="vm.queueCampaign.dialPredictiveOptimization" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'agentBusyFactor\'"> {{ \'MOTIONDIALER.AGENTBUSYFACTOR\' | translate }} </md-option>\n\n <md-option ng-value="\'dropRate\'"> {{ \'MOTIONDIALER.DROPRATE\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATION"></span></div>\n <div ng-messages="campaignForm[\'dialPredictiveOptimization\'].$error" ng-show="campaignForm[\'dialPredictiveOptimization\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREDICTIVEOPTIMIZATION_REQUIRED">PredictiveOptimization field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEOPTIMIZATIONPERCENTAGE">PredictiveOptimizationPercentage</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEOPTIMIZATIONPERCENTAGE"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveOptimizationPercentage" min="1" max="95" step="0.1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod == \'predictive\'" class="md-block">\n <span translate="MOTIONDIALER.PREDICTIVEINTERVAL">PredictiveInterval</span>\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREDICTIVEINTERVAL"></span></div>\n <md-slider md-discrete flex ng-model="vm.queueCampaign.dialPredictiveInterval" min="5" max="30" step="1" class="md-accent">\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="md-block">\n <label translate="MOTIONDIALER.MAXCONCURRENTCALLS">MaxConcurrentCalls</label>\n <input type="number" name="dialLimitQueue" ng-model="vm.queueCampaign.dialLimitQueue" min="0" max="9999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MAXCONCURRENTCALLS"></span></div>\n <div ng-messages="campaignForm[\'dialLimitQueue\'].$error" ng-show="campaignForm[\'dialLimitQueue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_REQUIRED">MaxConcurrentCalls field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxConcurrentCalls must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AGENTTIMEOUT">AgentTimeout</label>\n <input type="number" name="timeout" ng-model="vm.queueCampaign.timeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AGENTTIMEOUT"></span></div>\n <div ng-messages="campaignForm[\'timeout\'].$error" ng-show="campaignForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_REQUIRED">AgentTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AgentTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container queue md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.QUEUE">QUEUE</div>\n </div>\n <form name="queueForm" novalidate>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUEOPTIONS">QueueOptions</label>\n <input type="text" name="dialQueueOptions" ng-model="vm.queueCampaign.dialQueueOptions" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="queueForm[\'dialQueueOptions\'].$error" ng-show="queueForm[\'dialQueueOptions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUEOPTIONS_REQUIRED">QueueOptions field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.QUEUETIMEOUT">QueueTimeout</label>\n <input type="number" name="dialQueueTimeout" ng-model="vm.queueCampaign.dialQueueTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.QUEUETIMEOUT"></span></div>\n <div ng-messages="queueForm[\'dialQueueTimeout\'].$error" ng-show="queueForm[\'dialQueueTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_REQUIRED">QueueTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">QueueTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'booked\' || vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.queueCampaign.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'roundrobin\'" ng-if="vm.queueCampaign.dialMethod === \'booked\'">Round Robin</md-option>\n <md-option ng-value="\'leastrecent\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Random</md-option>\n <md-option ng-value="\'linear\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'" ng-if="vm.queueCampaign.dialMethod !== \'booked\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="queueForm[\'strategy\'].$error" ng-show="queueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.queueCampaign.retry" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RETRY"></span></div>\n <div ng-messages="queueForm[\'retry\'].$error" ng-show="queueForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.queueCampaign.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="queueForm[\'wrapuptime\'].$error" ng-show="queueForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.queueCampaign.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.WEIGHT"></span></div>\n <div ng-messages="queueForm[\'weight\'].$error" ng-show="queueForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.queueCampaign.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="queueForm[\'musiconhold\'].$error" ng-show="queueForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT">CallySquareProject</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED">CallySquareProject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECT2">CallySquareProject2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECT2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT2_REQUIRED">CallySquareProject2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW">CallySquareProjectPreview</label>\n <md-select name="dialQueueProject" ng-model="vm.queueCampaign.dialQueueProject" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject.name" ng-repeat="dialQueueProject in vm.projects" ng-disabled="dialQueueProject.canSelect === false">{{ dialQueueProject.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject\'].$error" ng-show="queueForm[\'dialQueueProject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW_REQUIRED">CallySquareProjectPreview field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="md-block">\n <label translate="MOTIONDIALER.CALLYSQUAREPROJECTPREVIEW2">CallySquareProjectPreview2</label>\n <md-select name="dialQueueProject2" ng-model="vm.queueCampaign.dialQueueProject2" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">None</md-option>\n <md-option ng-value="dialQueueProject2.name" ng-repeat="dialQueueProject2 in vm.projects" ng-disabled="dialQueueProject2.canSelect === false">{{ dialQueueProject2.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.CALLYSQUAREPROJECTPREVIEW2"></span></div>\n <div ng-messages="queueForm[\'dialQueueProject2\'].$error" ng-show="queueForm[\'dialQueueProject2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECTPREVIEW2_REQUIRED">CallySquareProjectPreview2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialQueueProject2 && (vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\')" class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAgiAfterHangupAgent" aria-label="RunIfHangupAgent" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.RUNIFHANGUPAGENT">RunIfHangupAgent</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RUNIFHANGUPAGENT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container originate md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ORIGINATE">ORIGINATE</div>\n </div>\n <form name="originateForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNAME">OriginateCallerIdName</label>\n <input type="text" name="dialOriginateCallerIdName" ng-model="vm.queueCampaign.dialOriginateCallerIdName" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNAME"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdName\'].$error" ng-show="originateForm[\'dialOriginateCallerIdName\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNAME_REQUIRED">OriginateCallerIdName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATECALLERIDNUMBER">OriginateCallerIdNumber</label>\n <input type="text" name="dialOriginateCallerIdNumber" ng-model="vm.queueCampaign.dialOriginateCallerIdNumber" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATECALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialOriginateCallerIdNumber\'].$error" ng-show="originateForm[\'dialOriginateCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATECALLERIDNUMBER_REQUIRED">OriginateCallerIdNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RANDOMLASTDIGITCALLERIDNUMBER">RandomLastDigitCallerIdNumber</label>\n <input type="number" name="dialRandomLastDigitCallerIdNumber" ng-model="vm.queueCampaign.dialRandomLastDigitCallerIdNumber" min="0" max="15" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.RANDOMLASTDIGITCALLERIDNUMBER"></span></div>\n <div ng-messages="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$error" ng-show="originateForm[\'dialRandomLastDigitCallerIdNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED">RandomLastDigitCallerIdNumber field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO">RandomLastDigitCallerIdNumber must be a valid greater or equal than</span> <span>15</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.ORIGINATETIMEOUT">OriginateTimeout</label>\n <input type="number" name="dialOriginateTimeout" ng-model="vm.queueCampaign.dialOriginateTimeout" min="1" max="999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.ORIGINATETIMEOUT"></span></div>\n <div ng-messages="originateForm[\'dialOriginateTimeout\'].$error" ng-show="originateForm[\'dialOriginateTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_REQUIRED">OriginateTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">OriginateTimeout must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.PREFIX">Prefix</label>\n <input type="text" name="dialPrefix" ng-model="vm.queueCampaign.dialPrefix" ng-pattern="/^\\d+$/" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.PREFIX"></span></div>\n <div ng-messages="originateForm[\'dialPrefix\'].$error" ng-show="originateForm[\'dialPrefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="MOTIONDIALER.ERRORS.PREFIX_MUST_VALID_PATTERN" translate-values="{ regex: \'/^\\d+$/\' }">Prefix must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.RETRYANDFREQUENCY">RETRYANDFREQUENCY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALMAXRETRY">GlobalMaxRetry</label>\n <input type="number" name="dialGlobalMaxRetry" ng-model="vm.queueCampaign.dialGlobalMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALMAXRETRY"></span></div>\n <div ng-messages="globalForm[\'dialGlobalMaxRetry\'].$error" ng-show="globalForm[\'dialGlobalMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_REQUIRED">GlobalMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">GlobalMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container congestion md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.CONGESTION">CONGESTION</div>\n </div>\n <form name="congestionForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONMAXRETRY">CongestionMaxRetry</label>\n <input type="number" name="dialCongestionMaxRetry" ng-model="vm.queueCampaign.dialCongestionMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONMAXRETRY"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionMaxRetry\'].$error" ng-show="congestionForm[\'dialCongestionMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_REQUIRED">CongestionMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONGESTIONRETRYTIME">CongestionRetryTime</label>\n <input type="number" name="dialCongestionRetryFrequency" ng-model="vm.queueCampaign.dialCongestionRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONGESTIONRETRYTIME"></span></div>\n <div ng-messages="congestionForm[\'dialCongestionRetryFrequency\'].$error" ng-show="congestionForm[\'dialCongestionRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_REQUIRED">CongestionRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">CongestionRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container busy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.BUSY">BUSY</div>\n </div>\n <form name="busyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYMAXRETRY">BusyMaxRetry</label>\n <input type="number" name="dialBusyMaxRetry" ng-model="vm.queueCampaign.dialBusyMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYMAXRETRY"></span></div>\n <div ng-messages="busyForm[\'dialBusyMaxRetry\'].$error" ng-show="busyForm[\'dialBusyMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_REQUIRED">BusyMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.BUSYRETRYTIME">BusyRetryTime</label>\n <input type="number" name="dialBusyRetryFrequency" ng-model="vm.queueCampaign.dialBusyRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.BUSYRETRYTIME"></span></div>\n <div ng-messages="busyForm[\'dialBusyRetryFrequency\'].$error" ng-show="busyForm[\'dialBusyRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_REQUIRED">BusyRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">BusyRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container noanswer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.NOANSWER">NOANSWER</div>\n </div>\n <form name="noanswerForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERMAXRETRY">NoAnswerMaxRetry</label>\n <input type="number" name="dialNoAnswerMaxRetry" ng-model="vm.queueCampaign.dialNoAnswerMaxRetry" min="1" max="999" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERMAXRETRY"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerMaxRetry\'].$error" ng-show="noanswerForm[\'dialNoAnswerMaxRetry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_REQUIRED">NoAnswerMaxRetry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerMaxRetry must be a valid greater or equal than</span> <span>999</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.NOANSWERRETRYTIME">NoAnswerRetryTime</label>\n <input type="number" name="dialNoAnswerRetryFrequency" ng-model="vm.queueCampaign.dialNoAnswerRetryFrequency" min="1" max="99999" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.NOANSWERRETRYTIME"></span></div>\n <div ng-messages="noanswerForm[\'dialNoAnswerRetryFrequency\'].$error" ng-show="noanswerForm[\'dialNoAnswerRetryFrequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_REQUIRED">NoAnswerRetryTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO">NoAnswerRetryTime must be a valid greater or equal than</span> <span>99999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.queueCampaign.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.queueCampaign.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.queueCampaign.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.queueCampaign.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.queueCampaign.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.queueCampaign.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.queueCampaign.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.queueCampaign.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'MOTIONDIALER.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'MOTIONDIALER.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'preview\' || vm.queueCampaign.dialMethod === \'booked\'" class="queueCampaign-detail-form-container advancedpreview md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.ADVANCEDPREVIEW">ADVANCEDPREVIEW</div>\n </div>\n <form name="advancedpreviewForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.acw" class="md-block">\n <label translate="MOTIONDIALER.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.queueCampaign.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedpreviewForm[\'acwTimeout\'].$error" ng-show="advancedpreviewForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.queueCampaign.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'monitor_format\'].$error" ng-show="advancedpreviewForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALORDERBYSCHEDULEDAT">DialOrderByScheduledAt</label>\n <md-select name="dialOrderByScheduledAt" ng-model="vm.queueCampaign.dialOrderByScheduledAt" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'DESC\'"> {{ \'MOTIONDIALER.DESC\' | translate }} </md-option>\n\n <md-option ng-value="\'ASC\'"> {{ \'MOTIONDIALER.ASC\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALORDERBYSCHEDULEDAT"></span></div>\n <div ng-messages="advancedpreviewForm[\'dialOrderByScheduledAt\'].$error" ng-show="advancedpreviewForm[\'dialOrderByScheduledAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALORDERBYSCHEDULEDAT_REQUIRED">DialOrderByScheduledAt field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.mandatoryDisposition" class="md-block">\n <label translate="MOTIONDIALER.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.queueCampaign.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="MOTIONDIALER.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedpreviewForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="queueCampaign-detail-form-container recallme md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.RECALLME">RECALLME</div>\n </div>\n <form name="recallmeForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.DIALRECALLMETIMEOUT">DialRecallMeTimeout</label>\n <input type="number" name="dialRecallMeTimeout" ng-model="vm.queueCampaign.dialRecallMeTimeout" min="1" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLMETIMEOUT"></span></div>\n <div ng-messages="recallmeForm[\'dialRecallMeTimeout\'].$error" ng-show="recallmeForm[\'dialRecallMeTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_REQUIRED">DialRecallMeTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">DialRecallMeTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialRecallInQueue" aria-label="DialRecallInQueue" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.DIALRECALLINQUEUE">DialRecallInQueue</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.DIALRECALLINQUEUE"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container globalinterval md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.GLOBALINTERVAL">GLOBALINTERVAL</div>\n </div>\n <form name="globalintervalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.GLOBALINTERVAL">GlobalInterval</label>\n <input type="text" name="dialGlobalInterval" ng-model="vm.queueCampaign.dialGlobalInterval" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.GLOBALINTERVAL"></span></div>\n <div ng-messages="globalintervalForm[\'dialGlobalInterval\'].$error" ng-show="globalintervalForm[\'dialGlobalInterval\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.GLOBALINTERVAL_REQUIRED">GlobalInterval field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod != \'preview\'" class="queueCampaign-detail-form-container timezone md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.TIMEZONE">TIMEZONE</div>\n </div>\n <form name="timezoneForm" novalidate>\n <md-input-container class="md-block">\n <label translate="MOTIONDIALER.TIMEZONE">Timezone</label>\n <ms-timezone name="dialTimezone" ng-model="vm.queueCampaign.dialTimezone" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n < <div class="hint"><span translate="MOTIONDIALER.HELP.TIMEZONE"></span>\n </div>\n <div ng-messages="timezoneForm[\'dialTimezone\'].$error" ng-show="timezoneForm[dialTimezone].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div ng-if="vm.queueCampaign.dialMethod === \'progressive\' || vm.queueCampaign.dialMethod === \'predictive\' || vm.queueCampaign.dialMethod === \'power\'" class="queueCampaign-detail-form-container amd md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="MOTIONDIALER.AMD">AMD</div>\n </div>\n <form name="amdForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queueCampaign.dialAMDActive" aria-label="AMDActive" ng-disabled="!vm.crudPermissions.canEdit"><span translate="MOTIONDIALER.AMDACTIVE">AMDActive</span></md-switch>\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDACTIVE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDINITIALSILENCE">AMDInitialSilence</label>\n <input type="number" name="dialAMDInitialSilence" ng-model="vm.queueCampaign.dialAMDInitialSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDINITIALSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDInitialSilence\'].$error" ng-show="amdForm[\'dialAMDInitialSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_REQUIRED">AMDInitialSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDINITIALSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDInitialSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDGREETING">AMDGreeting</label>\n <input type="number" name="dialAMDGreeting" ng-model="vm.queueCampaign.dialAMDGreeting" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDGREETING"></span></div>\n <div ng-messages="amdForm[\'dialAMDGreeting\'].$error" ng-show="amdForm[\'dialAMDGreeting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_REQUIRED">AMDGreeting field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDGREETING_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDGreeting must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDAFTERGREETINGSILENCE">AMDAfterGreetingSilence</label>\n <input type="number" name="dialAMDAfterGreetingSilence" ng-model="vm.queueCampaign.dialAMDAfterGreetingSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDAFTERGREETINGSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDAfterGreetingSilence\'].$error" ng-show="amdForm[\'dialAMDAfterGreetingSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_REQUIRED">AMDAfterGreetingSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDAFTERGREETINGSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDAfterGreetingSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDTOTALANALYSISTIME">AMDTotalAnalysisTime</label>\n <input type="number" name="dialAMDTotalAnalysisTime" ng-model="vm.queueCampaign.dialAMDTotalAnalysisTime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDTOTALANALYSISTIME"></span></div>\n <div ng-messages="amdForm[\'dialAMDTotalAnalysisTime\'].$error" ng-show="amdForm[\'dialAMDTotalAnalysisTime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_REQUIRED">AMDTotalAnalysisTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDTOTALANALYSISTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDTotalAnalysisTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMINWORDLENGTH">AMDMinWordLength</label>\n <input type="number" name="dialAMDMinWordLength" ng-model="vm.queueCampaign.dialAMDMinWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMINWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMinWordLength\'].$error" ng-show="amdForm[\'dialAMDMinWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_REQUIRED">AMDMinWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMINWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMinWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDBETWEENWORDSSILENCE">AMDBetweenWordsSilence</label>\n <input type="number" name="dialAMDBetweenWordsSilence" ng-model="vm.queueCampaign.dialAMDBetweenWordsSilence" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDBETWEENWORDSSILENCE"></span></div>\n <div ng-messages="amdForm[\'dialAMDBetweenWordsSilence\'].$error" ng-show="amdForm[\'dialAMDBetweenWordsSilence\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_REQUIRED">AMDBetweenWordsSilence field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDBETWEENWORDSSILENCE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDBetweenWordsSilence must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMNUMBEROFWORDS">AMDMaximumNumberOfWords</label>\n <input type="number" name="dialAMDMaximumNumberOfWords" ng-model="vm.queueCampaign.dialAMDMaximumNumberOfWords" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMNUMBEROFWORDS"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumNumberOfWords\'].$error" ng-show="amdForm[\'dialAMDMaximumNumberOfWords\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_REQUIRED">AMDMaximumNumberOfWords field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMNUMBEROFWORDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumNumberOfWords must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDSILENCETHRESHOLD">AMDSilenceThreshold</label>\n <input type="number" name="dialAMDSilenceThreshold" ng-model="vm.queueCampaign.dialAMDSilenceThreshold" min="0" max="32767" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDSILENCETHRESHOLD"></span></div>\n <div ng-messages="amdForm[\'dialAMDSilenceThreshold\'].$error" ng-show="amdForm[\'dialAMDSilenceThreshold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_REQUIRED">AMDSilenceThreshold field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="MOTIONDIALER.ERRORS.AMDSILENCETHRESHOLD_MUST_BE_LESS_THAN_OR_EQUAL_TO">AMDSilenceThreshold must be a valid greater or equal than</span> <span>32767</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.queueCampaign.dialAMDActive" class="md-block">\n <label translate="MOTIONDIALER.AMDMAXIMUMWORDLENGTH">AMDMaximumWordLength</label>\n <input type="number" name="dialAMDMaximumWordLength" ng-model="vm.queueCampaign.dialAMDMaximumWordLength" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="MOTIONDIALER.HELP.AMDMAXIMUMWORDLENGTH"></span></div>\n <div ng-messages="amdForm[\'dialAMDMaximumWordLength\'].$error" ng-show="amdForm[\'dialAMDMaximumWordLength\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_REQUIRED">AMDMaximumWordLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="MOTIONDIALER.ERRORS.AMDMAXIMUMWORDLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AMDMaximumWordLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HOPPERS">HOPPERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperstatistics md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperStatisticsController as vm_hs" ng-init="vm_hs.init(vm.queueCampaign)">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERWIDGET">Hoppers</span>\n <div flex></div>\n <md-button class="md-icon-button" ng-click="vm_hs.init(vm.queueCampaign)" aria-label="refresh Hopper" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n \x3c!-- WIDGET GROUP --\x3e\n <div class="widget-group" layout="row" flex="100" layout-wrap>\n\n \x3c!-- WIDGET 1 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{(vm_hs.total || 0) + (vm_hs.closed || 0)}}</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.TOTAL\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 1 --\x3e\n\n \x3c!-- WIDGET 2 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.fresh || 0}} ({{vm_hs.total ? ((((vm_hs.fresh || 0) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.FRESH\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 2 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.total ? (vm_hs.total - (vm_hs.fresh || 0)) : 0}} ({{vm_hs.total ? ((((vm_hs.total - (vm_hs.fresh || 0)) * 100)/((vm_hs.closed || 0) + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.OPEN\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n \x3c!-- WIDGET 3 --\x3e\n <ms-widget class="h-140" layout="column" flex="100" flex-gt-xs="50" flex-gt-md="25">\n\n \x3c!-- Front --\x3e\n <ms-widget-front class="p-16 white-bg" layout="row" flex>\n <div class="pt-8 pb-8" layout="column" layout-align="center center" flex>\n <div class="md-display-1 pb-8">{{vm_hs.closed ? (vm_hs.closed || 0) : 0}} ({{vm_hs.closed ? ((((vm_hs.closed) * 100)/(vm_hs.closed + (vm_hs.total || 0))) | number: 2) : 0}}%)</div>\n <div class="font-weight-500 secondary-text">{{ \'MOTIONDIALER.CLOSED\' | translate }}</div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n\n </ms-widget>\n \x3c!-- / WIDGET 3 --\x3e\n\n </div>\n \x3c!-- / WIDGET GROUP --\x3e\n </div>\n\n </div>\n <div class="queueCampaign-detail-form-container hoppers md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHoppersController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERS">Hoppers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHoppers()" aria-label="refresh Hoppers" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHoppers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHoppers.length}} {{vm_dc.selectedQueueCampaignHoppers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHoppers" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedQueueCampaignHoppers($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHoppers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHoppers">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="priority">{{ \'MOTIONDIALER.PRIORITY\' | translate }}</th>\n <th md-column md-order-by="recallme">{{ \'MOTIONDIALER.RECALLAGENT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopper" md-select-id="id" ng-repeat="hopper in vm_dc.queueCampaignHoppers.rows">\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.ContactId}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.phone}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countcongestionretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countbusyretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.countnoanswerretry}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{hopper.scheduledat | date:\'medium\'}}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell>{{ vm_dc.arraypriority[hopper.priority].option }}</td>\n <td ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" md-cell class="recallme ">\n <md-icon md-colors="{color: {{hopper.recallme ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{hopper.recallme? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditQueueCampaignHopper($event, hopper)" translate="MOTIONDIALER.EDIT_HOPPER">\n Edit Hopper\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(hopper, $event)" translate="MOTIONDIALER.DELETE_HOPPER">\n Delete Hopper\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHoppers.rows.length">\n <td md-cell colspan="12">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPER_AVAILABLE">No hopper available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHoppers.count}}" md-on-paginate="vm_dc.getQueueCampaignHoppers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.HISTORY">HISTORY</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperhistories md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperHistoriesController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERHISTORIES">HopperHistories</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperHistories()" aria-label="refresh HopperHistories" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERHISTORIES">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperHistories.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperHistories.length}} {{vm_dc.selectedQueueCampaignHopperHistories.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperHistories" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperHistories" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperHistories">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="scheduledat">{{ \'MOTIONDIALER.SCHEDULEDAT\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperHistory" md-select-id="id" ng-repeat="hopperHistory in vm_dc.queueCampaignHopperHistories.rows">\n <td md-cell>{{hopperHistory.uniqueid}}</td>\n <td md-cell>{{hopperHistory.ContactId}}</td>\n <td md-cell>{{hopperHistory.calleridnum}}</td>\n <td md-cell>{{hopperHistory.calleridname}}</td>\n <td md-cell>{{hopperHistory.statedesc}}</td>\n <td md-cell>{{hopperHistory.scheduledat | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperHistory.endtime | date:\'medium\'}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperHistories.rows.length">\n <td md-cell colspan="11">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERHISTORY_AVAILABLE">No hopperhistory available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperHistories.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperHistories" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.FINAL">FINAL</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperfinals md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperFinalsController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERFINALS">HopperFinals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getQueueCampaignHopperFinals()" aria-label="refresh HopperFinals" translate translate-attr-label="MOTIONDIALER.REFRESH_HOPPERFINALS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="vm_dc.countContactsQueueCampaignHopperFinal(vm_dc.query.id); $mdOpenMenu($event);">\n <md-icon md-font-icon="icon-backup-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(3)">\n <span translate="MOTIONDIALER.NOANSWER ">NoAnswer</span>\n <span class="badge">({{vm_dc.contacts.noAnswerContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(5)">\n <span translate="MOTIONDIALER.BUSY ">Busy</span>\n <span class="badge">({{vm_dc.contacts.busyContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(8)">\n <span translate="MOTIONDIALER.CONGESTION ">Congestion</span>\n <span class="badge">({{vm_dc.contacts.congestionContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(10)">\n <span translate="MOTIONDIALER.DROPPED ">Drop</span>\n <span class="badge">({{vm_dc.contacts.dropContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(11)">\n <span translate="MOTIONDIALER.ABANDONED ">Abandoned</span>\n <span class="badge">({{vm_dc.contacts.abandonedContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(22)">\n <span translate="MOTIONDIALER.RECALLFAILEDTIMEOUT">Recall</span>\n <span class="badge">({{vm_dc.contacts.reCallContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(0)">\n <span translate="MOTIONDIALER.NO_SUCH_NUMBER">NoSuchNumber</span>\n <span class="badge">({{vm_dc.contacts.noSuchContacts}})</span>\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm_dc.moveContactsQueueCampaignHopperFinal(19)">\n <span translate="MOTIONDIALER.ANSWERING_MACHINE">AnsweringMachine</span>\n <span class="badge">({{vm_dc.contacts.answeringMachine}})</span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperFinals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperFinals.length}} {{vm_dc.selectedQueueCampaignHopperFinals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperFinals" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.moveSelectedQueueCampaignHopperFinals($event)" aria-label="move selected" translate translate-attr-label="QUEUECAMPAIGNS.MOVE_SELECTED">\n <md-icon md-font-icon="icon-restore"></md-icon>\n <md-tooltip><span translate="MOTIONDIALER.RESTORECONTACTS"></span></md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperFinals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperFinals">\n <tr md-row>\n <th md-column md-order-by="uniqueid">{{ \'MOTIONDIALER.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column md-order-by="calleridname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="statedesc">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th md-column md-order-by="countcongestionretry">{{ \'MOTIONDIALER.CONGESTION\' | translate }}</th>\n <th md-column md-order-by="countbusyretry">{{ \'MOTIONDIALER.BUSY\' | translate }}</th>\n <th md-column md-order-by="countnoanswerretry">{{ \'MOTIONDIALER.NOANSWER\' | translate }}</th>\n <th md-column md-order-by="starttime">{{ \'MOTIONDIALER.STARTTIME\' | translate }}</th>\n <th md-column md-order-by="endtime">{{ \'MOTIONDIALER.ENDTIME\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'MOTIONDIALER.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperFinal" md-select-id="id" ng-repeat="hopperFinal in vm_dc.queueCampaignHopperFinals.rows">\n <td md-cell>{{hopperFinal.uniqueid}}</td>\n <td md-cell>{{hopperFinal.ContactId}}</td>\n <td md-cell>{{hopperFinal.calleridnum}}</td>\n <td md-cell>{{hopperFinal.calleridname}}</td>\n <td md-cell>{{hopperFinal.statedesc}}</td>\n <td md-cell>{{hopperFinal.countcongestionretry}}</td>\n <td md-cell>{{hopperFinal.countbusyretry}}</td>\n <td md-cell>{{hopperFinal.countnoanswerretry}}</td>\n <td md-cell>{{hopperFinal.starttime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.endtime | date:\'medium\'}}</td>\n <td md-cell>{{hopperFinal.disposition}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.moveConfirm(hopperFinal, $event)" translate="MOTIONDIALER.MOVE_HOPPERFINAL">\n Move HopperFinal\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperFinals.rows.length">\n <td md-cell colspan="23">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERFINAL_AVAILABLE">No hopperfinal available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperFinals.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperFinals" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.BLACKLIST">BLACKLIST</span>\n </md-tab-label>\n <md-tab-body>\n <div class="queueCampaign-detail-form-container hopperblacks md-background-bg md-whiteframe-1dp">\n <div ng-controller="QueueCampaignHopperBlacksController as vm_dc" ng-init="vm_dc.init(vm.queueCampaign, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.HOPPERBLACKS">HopperBlacks</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedQueueCampaignHopperBlacks.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedQueueCampaignHopperBlacks.length}} {{vm_dc.selectedQueueCampaignHopperBlacks.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedQueueCampaignHopperBlacks" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedQueueCampaignHopperBlacks" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getQueueCampaignHopperBlacks">\n <tr md-row>\n <th md-column md-order-by="ContactId">{{ \'MOTIONDIALER.CONTACTID\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'MOTIONDIALER.PHONE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="hopperBlack" md-select-id="id" ng-repeat="hopperBlack in vm_dc.queueCampaignHopperBlacks.rows">\n <td md-cell>{{hopperBlack.ContactId}}</td>\n <td md-cell>{{hopperBlack.phone}}</td>\n <td md-cell class="actions">\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.queueCampaignHopperBlacks.rows.length">\n <td md-cell colspan="4">\n <span class="text-boxed-ligth" translate="MOTIONDIALER.NO_HOPPERBLACK_AVAILABLE">No hopperblack available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.queueCampaignHopperBlacks.count}}" md-on-paginate="vm_dc.getQueueCampaignHopperBlacks" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n</div>\n\x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/motiondialer/views/queueCampaigns/queueCampaigns.html",'<div id="queueCampaigns" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-fire" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="MOTIONDIALER.QUEUECAMPAIGNS">QueueCampaigns</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="MOTIONDIALER.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedQueueCampaigns.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedQueueCampaigns =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="MOTIONDIALER.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-queueCampaigns-count">\n <span>{{vm.selectedQueueCampaigns.length}}</span>\n <span translate="MOTIONDIALER.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="QUEUECAMPAIGNS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllQueueCampaigns()" translate="MOTIONDIALER.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectQueueCampaigns()" translate="MOTIONDIALER.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedQueueCampaigns" csv-label="true" filename="queueCampaigns.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedQueueCampaigns($event)" aria-label="delete selected" translate translate-attr-label="QUEUECAMPAIGNS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- QUEUECAMPAIGN TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedQueueCampaigns" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueueCampaigns">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'MOTIONDIALER.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="TrunkId">{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialMethod">{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'MOTIONDIALER.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queueCampaigns.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="queueCampaign" md-select-id="id" ng-repeat="queueCampaign in vm.queueCampaigns.rows">\n <td md-cell ng-if="queueCampaign.userpic"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="api/users/{{queueCampaign.id}}/avatar" /></td>\n <td md-cell ng-if="!queueCampaign.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{queueCampaign.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="id ">{{queueCampaign.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="name ">{{queueCampaign.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialActive ">\n <md-icon md-colors="{color: {{queueCampaign.dialActive ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{queueCampaign.dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="TrunkId ">{{ (vm.trunks | filter : {\'id\':queueCampaign.TrunkId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="dialMethod ">{{ vm.arraydialMethod[queueCampaign.dialMethod].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(queueCampaign, ev) : vm.createOrEditQueueCampaign($event, queueCampaign)" md-cell class="strategy ">{{ vm.arraystrategy[queueCampaign.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(queueCampaign, $event)" translate="MOTIONDIALER.EDIT_QUEUECAMPAIGN">\n Edit QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(queueCampaign, $event)" translate="MOTIONDIALER.CLONE_QUEUECAMPAIGN">\n clone QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.listadddialog(queueCampaign, $event)" translate="MOTIONDIALER.LISTADD_QUEUECAMPAIGN">\n listadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.blacklistadddialog(queueCampaign, $event)" translate="MOTIONDIALER.BLACKLISTADD_QUEUECAMPAIGN">\n blacklistadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(queueCampaign, $event)" translate="MOTIONDIALER.TEAMADD_QUEUECAMPAIGN">\n teamadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(queueCampaign, $event)" translate="MOTIONDIALER.AGENTADD_QUEUECAMPAIGN">\n agentadd QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(queueCampaign, $event)" translate="MOTIONDIALER.DELETE_QUEUECAMPAIGN">\n Delete QueueCampaign\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(queueCampaign, $event)" translate="MOTIONDIALER.GOTOREALTIME_QUEUECAMPAIGN">\n goToRealtime QueueCampaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.queueCampaigns.count}}" md-on-paginate="vm.getQueueCampaigns" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / QUEUECAMPAIGN TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD QUEUECAMPAIGN BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-queueCampaign-button" ng-click="vm.createOrEditQueueCampaign($event)" aria-label="add queueCampaign" translate translate-attr-aria-label="MOTIONDIALER.ADD_QUEUECAMPAIGN">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD QUEUECAMPAIGN BUTTON --\x3e\n</div>'),e.put("app/main/apps/motiondialer/views/realtime/abandonedcalls/view.html",' <md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitAt">{{\'DASHBOARDS.QUEUECALLEREXITAT\' | translate}}</th>\n <th md-column md-order-by="queuecallerexitreason">{{\'DASHBOARDS.QUEUECALLEREXITREASON\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitAt ? (contact.queuecallerexitAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.queuecallerexitreason}}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.dispositions.length > 0" ng-repeat="disposition in vm.dispositions">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/motiondialer/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'MOTIONDIALER.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'MOTIONDIALER.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'MOTIONDIALER.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'MOTIONDIALER.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'MOTIONDIALER.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'MOTIONDIALER.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'MOTIONDIALER.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'MOTIONDIALER.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'MOTIONDIALER.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"MOTIONDIALER.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"MOTIONDIALER.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"MOTIONDIALER.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"MOTIONDIALER.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"MOTIONDIALER.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'MOTIONDIALER.PAGE' | translate}}:', rowsPerPage: '{{'MOTIONDIALER.ROWSPERPAGE' | translate}}:', of: '{{'MOTIONDIALER.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/motiondialer/views/realtime/ivr_campaigns/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCampaigns">\n <tr md-row>\n <th md-column>{{\'MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.TOTAL_MANAGED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.LIMITED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.ORIGINATED\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.MESSAGE\' | translate}}</th>\n <th md-column>{{\'MOTIONDIALER.CALLYSQUAREPROJECT\' | translate}}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.campaigns">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, campaign) in vm.campaigns">\n <td md-cell>\n <span>{{campaign.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrTotalCallsDays || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.ivrAnswerCallsDay || 0}} ({{(campaign.ivrTotalCallsDays) ? (campaign.ivrAnswerCallsDay || 0) * 100/(campaign.ivrTotalCallsDays ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.limitCalls || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.message ? (\'MOTIONDIALER.\'+campaign.message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{campaign.dialQueueProject || \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{campaign.Trunk ? campaign.Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{campaign.active ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{campaign.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditIvrCampaign($event, campaign)" translate="MOTIONDIALER.EDIT_CAMPAIGN">\n Edit Campaign\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getCampaigns" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'MOTIONDIALER.DID\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.QUEUE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.CALLER\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.AGENT\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'MOTIONDIALER.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="MOTIONDIALER.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="MOTIONDIALER.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="MOTIONDIALER.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\'\n MOTIONDIALER.NAME\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.TOTAL\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.MANAGED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.DROPPED\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n MOTIONDIALER.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{(queue.answered + queue.outboundNoAnswerCallsDay + queue.outboundBusyCallsDay + queue.outboundCongestionCallsDay + queue.outboundNoSuchCallsDay + queue.outboundUnknownCallsDay + queue.outboundDropCallsDayTimeout + queue.outboundDropCallsDayCallersExit + queue.outboundBlacklistCallsDay + queue.outboundOriginateFailureCallsDay + queue.outboundAnswerAgiCallsDay + queue.outboundReCallsDay + queue.outboundRejectCallsDay )|| 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{queue.total || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.answered) ? (100 - (((queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total)) | number:1 ) - (((queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total )) | number:1 ) ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayCallersExit || 0}} ({{(queue.outboundDropCallsDayCallersExit) ? (queue.outboundDropCallsDayCallersExit || 0) * 100/(queue.total ) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.outboundDropCallsDayTimeout || 0}} ({{(queue.outboundDropCallsDayTimeout) ? (queue.outboundDropCallsDayTimeout || 0) * 100/(queue.total) : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumHoldTime / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? (queue.sumDuration / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'MOTIONDIALER.NAME\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.PAUSED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.READY\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.WAITING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TALKING\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.ORIGINATED\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.MESSAGE\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.METHOD\' | translate }}</th>\n <th md-column>{{ \'MOTIONDIALER.TRUNK\' | translate }}</th>\n <th md-column md-order-by="dialActive">{{ \'MOTIONDIALER.ACTIVE\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) + (vm.queues[value].pTalking || 0)}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].originated || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].message ? (\'MOTIONDIALER.\'+vm.queues[value].message | translate) : \'--\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].dialMethod || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].Trunk ? vm.queues[value].Trunk.name : \'--\'}}</span>\n </td>\n <td md-cell>\n <md-icon md-colors="{color: {{vm.queues[value].dialActive ? \'\\\'green\\\'\' : \'\\\'red\\\'\'}}}" md-font-icon="{{vm.queues[value].dialActive ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="MOTIONDIALER.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditMotionDialerQueue($event, vm.queues[value])" translate="MOTIONDIALER.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="MOTIONDIALER.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/motiondialer/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="MOTIONDIALER.IVR_CAMPAIGNS">Ivr Campaigns</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/create/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelAccount">\n\n <div ng-messages="openchannelAccountForm[\'name\'].$error" ng-show="openchannelAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="openchannelAccountForm[\'key\'].$error" ng-show="openchannelAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="openchannelAccountForm[\'replyUri\'].$error" ng-show="openchannelAccountForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="openchannelAccountForm[\'ListId\'].$error" ng-show="openchannelAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description">\n\n <div ng-messages="openchannelAccountForm[\'description\'].$error" ng-show="openchannelAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelAccount" ng-click="vm.saveOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid || openchannelAccountForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelAccount" ng-click="vm.addNewOpenchannelAccount()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELACCOUNT" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n ADD OPENCHANNELACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelAccount" ng-click="vm.deleteOpenchannelAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/agentadd/agentadd.html",'<md-dialog class="openchannelAccount-dialog" aria-label="openchannelAccount" ng-init="vm.onInit()">\n <form name="openchannelAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">Add Agent to openchannelAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/agent/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'agent\'].$error" ng-show="openchannelAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'times\'].$error" ng-show="openchannelAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="openchannelAccountFormApp[\'text\'].$error" ng-show="openchannelAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/close/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'disposition\'].$error" ng-show="openchannelAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'condition\'].$error" ng-show="openchannelAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'truepriority\'].$error" ng-show="openchannelAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'falsepriority\'].$error" ng-show="openchannelAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'priority\'].$error" ng-show="openchannelAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/noop/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'value\'].$error" ng-show="openchannelAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/queue/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'queue\'].$error" ng-show="openchannelAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'timeout\'].$error" ng-show="openchannelAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/system/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="openchannelAccountFormApp[\'command\'].$error" ng-show="openchannelAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'variable\'].$error" ng-show="openchannelAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/apps/tag/dialog.html",'<md-dialog class="openchannelAccount-dialog" aria-label="New OpenchannelAccount">\n <form name="openchannelAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="openchannelAccountFormApp[\'tag\'].$error" ng-show="openchannelAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOpenchannelAccountApp()" class="send-button md-accent md-raised" ng-disabled="openchannelAccountFormApp.$invalid || openchannelAccountFormApp.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelCannedAnswers/dialog.html",'<md-dialog class="openchannelCannedAnswer-dialog" aria-label="New OpenchannelCannedAnswer">\n <form name="openchannelCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">Key</label>\n <input type="" name="key" ng-model="vm.openchannelCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="openchannelCannedAnswerForm[\'key\'].$error" ng-show="openchannelCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.VALUE">Value</label>\n <textarea name="value" ng-model="vm.openchannelCannedAnswer.value" required></textarea>\n\n <div ng-messages="openchannelCannedAnswerForm[\'value\'].$error" ng-show="openchannelCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelCannedAnswer.description">\n\n <div ng-messages="openchannelCannedAnswerForm[\'description\'].$error" ng-show="openchannelCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelCannedAnswer" ng-click="vm.saveOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid || openchannelCannedAnswerForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelCannedAnswer" ng-click="vm.addNewOpenchannelCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="openchannelCannedAnswerForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n ADD OPENCHANNELCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelCannedAnswer" ng-click="vm.deleteOpenchannelCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/openchannelDispositions/dialog.html",'<md-dialog class="openchannelDisposition-dialog" aria-label="New OpenchannelDisposition">\n <form name="openchannelDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="" name="name" ng-model="vm.openchannelDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="openchannelDispositionForm[\'name\'].$error" ng-show="openchannelDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelDisposition" ng-click="vm.saveOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid || openchannelDispositionForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelDisposition" ng-click="vm.addNewOpenchannelDisposition()" class="send-button md-accent md-raised" ng-disabled="openchannelDispositionForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n ADD OPENCHANNELDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelDisposition" ng-click="vm.deleteOpenchannelDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/edit/view.html",'<div id="openchannel-openchannelAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelAccounts-button md-icon-button" aria-label="Go to openchannelAccounts" ng-click="vm.gotoOpenchannelAccounts()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelAccount-image" hide-xs>\n <img ng-src="assets/images/business/openchannelAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelAccount.id}}\n <span ng-if="vm.openchannelAccount.name">{{vm.openchannelAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (openchannelDispositionsForm.$invalid) || (openchannelCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.KEY">key</label>\n <input type="text" name="key" ng-model="vm.openchannelAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="OPENCHANNEL.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.REPLYURI">replyUri</label>\n <input type="url" name="replyUri" ng-model="vm.openchannelAccount.replyUri" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.REPLYURI"></span></div>\n <div ng-messages="generalForm[\'replyUri\'].$error" ng-show="generalForm[\'replyUri\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_REQUIRED">replyUri field is required</span>\n </div>\n <div ng-message="url">\n <span translate="OPENCHANNEL.ERRORS.REPLYURI_MUST_VALID_URL">replyUri must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.LIST">List</label>\n <md-select name="ListId" ng-model="vm.openchannelAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.openchannelAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.MAPKEY">MapKey</label>\n <md-select name="mapKey" ng-model="vm.openchannelAccount.mapKey" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-optgroup label="standard">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="!mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n <md-optgroup label="custom">\n <md-option ng-value="mapKey.columnName" ng-repeat="mapKey in vm.fields" ng-if="mapKey.columnName.toString().startsWith(\'cf_\')" ng-disabled="mapKey.canSelect === false">{{ mapKey.displayName }}</md-option>\n </md-optgroup>\n </md-select>\n <div ng-messages="generalForm[\'mapKey\'].$error" ng-show="generalForm[\'mapKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MAPKEY_REQUIRED">MapKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.RECEIVEURI">receiveUri</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUri" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUri" name="receiveUri" ng-value="vm.location + \'/api/openchannel/accounts/\' + vm.openchannelAccount.id + \'/notify\'" ng-readonly="true">\n </div>\n <div class="hint"><span translate="OPENCHANNEL.HELP.RECEIVEURI"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="OPENCHANNEL.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.openchannelAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.queueTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.openchannelAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.agentTransfer == true" class="md-block">\n <label translate="OPENCHANNEL.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.openchannelAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.openchannelAccount.token" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.TOKEN"></span></div>\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="openchannelAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.openchannelAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="OPENCHANNEL.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.openchannelAccount.mandatoryDisposition" class="md-block">\n <label translate="OPENCHANNEL.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.openchannelAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="OPENCHANNEL.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchanneldispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelDispositionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELDISPOSITIONS">OpenchannelDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event)" aria-label="add openchannelDisposition" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelDispositions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelDispositions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelDisposition" md-select-id="id" ng-repeat="openchannelDisposition in vm_dc.openchannelAccountOpenchannelDispositions.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" md-cell>{{openchannelDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelDisposition($event, openchannelDisposition)" translate="OPENCHANNEL.EDIT_OPENCHANNELDISPOSITION">\n Edit OpenchannelDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelDisposition, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELDISPOSITION">\n Delete OpenchannelDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELDISPOSITION_AVAILABLE">No openchanneldisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelDispositions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container openchannelcannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountOpenchannelCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.OPENCHANNELCANNEDANSWERS">OpenchannelCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event)" aria-label="add openchannelCannedAnswer" translate translate-attr-label="OPENCHANNEL.ADD_OPENCHANNELCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length}} {{vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountOpenchannelCannedAnswers" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountOpenchannelCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountOpenchannelCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'OPENCHANNEL.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="openchannelCannedAnswer" md-select-id="id" ng-repeat="openchannelCannedAnswer in vm_dc.openchannelAccountOpenchannelCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" md-cell>{{openchannelCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditOpenchannelAccountOpenchannelCannedAnswer($event, openchannelCannedAnswer)" translate="OPENCHANNEL.EDIT_OPENCHANNELCANNEDANSWER">\n Edit OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(openchannelCannedAnswer, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELCANNEDANSWER">\n Delete OpenchannelCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountOpenchannelCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_OPENCHANNELCANNEDANSWER_AVAILABLE">No openchannelcannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountOpenchannelCannedAnswers.count}}" md-on-paginate="vm_dc.getOpenchannelAccountOpenchannelCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.openchannelAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="OPENCHANNEL.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOpenchannelAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOpenchannelAccountApps.length}} {{vm_ac.selectedOpenchannelAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOpenchannelAccountApps($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNEL.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOpenchannelAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.openchannelAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOpenchannelAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOpenchannelAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.openchannelAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OpenchannelAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.openchannelAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getOpenchannelAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="OPENCHANNEL.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedOpenchannelAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedOpenchannelAccountInteractions.length}} {{vm_dc.selectedOpenchannelAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedOpenchannelAccountInteractions" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedOpenchannelAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedOpenchannelAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getOpenchannelAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'OPENCHANNEL.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.CONTACT\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'OPENCHANNEL.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'OPENCHANNEL.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'OPENCHANNEL.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'OPENCHANNEL.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.openchannelAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spyopenchannelInteraction($event, interaction)" translate="OPENCHANNEL.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.openchannelInteractionDownload(interaction, $event)" translate="OPENCHANNEL.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="OPENCHANNEL.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.openchannelAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="OPENCHANNEL.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.openchannelAccountInteractions.count}}" md-on-paginate="vm_dc.getOpenchannelAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelAccounts/openchannelAccounts.html",'<div id="openchannelAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELACCOUNTS">OpenchannelAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelAccounts-count">\n <span>{{vm.selectedOpenchannelAccounts.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelAccounts()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelAccounts" csv-label="true" filename="openchannelAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelAccounts($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OPENCHANNELACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'OPENCHANNEL.KEY\' | translate }}</th>\n <th md-column md-order-by="replyUri">{{ \'OPENCHANNEL.REPLYURI\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'OPENCHANNEL.LIST\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'OPENCHANNEL.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelAccounts.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelAccount" md-select-id="id" ng-repeat="openchannelAccount in vm.openchannelAccounts.rows">\n <td md-cell ng-if="openchannelAccount.userpic"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="api/users/{{openchannelAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="id ">{{openchannelAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="name ">{{openchannelAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="key ">{{openchannelAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="replyUri ">{{openchannelAccount.replyUri}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':openchannelAccount.ListId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelAccount, ev) : vm.createOrEditOpenchannelAccount($event, openchannelAccount)" md-cell class="description ">{{openchannelAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(openchannelAccount, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELACCOUNT">\n Edit OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(openchannelAccount, $event)" translate="OPENCHANNEL.INTERACTIONS_OPENCHANNELACCOUNT">\n Interactions OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelAccount, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELACCOUNT">\n AgentAdd OpenchannelAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(openchannelAccount, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELACCOUNT">\n Delete OpenchannelAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelAccounts.count}}" md-on-paginate="vm.getOpenchannelAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelAccount-button" ng-click="vm.createOrEditOpenchannelAccount($event)" aria-label="add openchannelAccount" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/create/dialog.html",'<md-dialog class="openchannelQueue-dialog" aria-label="New OpenchannelQueue">\n <form name="openchannelQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newOpenchannelQueue">\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="openchannelQueueForm[\'name\'].$error" ng-show="openchannelQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="openchannelQueueForm[\'strategy\'].$error" ng-show="openchannelQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="openchannelQueueForm[\'timeout\'].$error" ng-show="openchannelQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description">\n\n <div ng-messages="openchannelQueueForm[\'description\'].$error" ng-show="openchannelQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOpenchannelQueue" ng-click="vm.saveOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid || openchannelQueueForm.$pristine" aria-label="SAVE" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOpenchannelQueue" ng-click="vm.addNewOpenchannelQueue()" class="send-button md-accent md-raised" ng-disabled="openchannelQueueForm.$invalid" aria-label="ADD" translate="OPENCHANNEL.ADD_OPENCHANNELQUEUE" translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n ADD OPENCHANNELQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOpenchannelQueue" ng-click="vm.deleteOpenchannelQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="OPENCHANNEL.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="OPENCHANNEL.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/agentadd/agentadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">Add Agent to openchannelQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/teamadd/teamadd.html",'<md-dialog class="openchannelQueue-dialog" aria-label="openchannelQueue" ng-init="vm.onInit()">\n <form name="openchannelQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="OPENCHANNEL.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/openchannel/views/openchannelQueues/edit/view.html",'<div id="openchannel-openchannelQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-openchannelQueues-button md-icon-button" aria-label="Go to openchannelQueues" ng-click="vm.gotoOpenchannelQueues()" translate translate-attr-aria-label="OPENCHANNEL.GO_TO_OPENCHANNELQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="openchannelQueue-image" hide-xs>\n <img ng-src="assets/images/business/openchannelQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.openchannelQueue.id}}\n <span ng-if="vm.openchannelQueue.name">{{vm.openchannelQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="OPENCHANNEL.CREATED_AT"></span> <span>{{vm.openchannelQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.openchannelQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.openchannelQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOpenchannelQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="OPENCHANNEL.SAVE" translate-attr-aria-label="OPENCHANNEL.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="openchannelQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="OPENCHANNEL.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.openchannelQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="OPENCHANNEL.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="OPENCHANNEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.openchannelQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.openchannelQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="OPENCHANNEL.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="OPENCHANNEL.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.openchannelQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="OPENCHANNEL.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/openchannel/views/openchannelQueues/openchannelQueues.html",'<div id="openchannelQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-google-earth" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="OPENCHANNEL.OPENCHANNELQUEUES">OpenchannelQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="OPENCHANNEL.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOpenchannelQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOpenchannelQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="OPENCHANNEL.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-openchannelQueues-count">\n <span>{{vm.selectedOpenchannelQueues.length}}</span>\n <span translate="OPENCHANNEL.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OPENCHANNELQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOpenchannelQueues()" translate="OPENCHANNEL.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOpenchannelQueues()" translate="OPENCHANNEL.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOpenchannelQueues" csv-label="true" filename="openchannelQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOpenchannelQueues($event)" aria-label="delete selected" translate translate-attr-label="OPENCHANNELQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OPENCHANNELQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOpenchannelQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOpenchannelQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'OPENCHANNEL.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'OPENCHANNEL.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.openchannelQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="openchannelQueue" md-select-id="id" ng-repeat="openchannelQueue in vm.openchannelQueues.rows">\n <td md-cell ng-if="openchannelQueue.userpic"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="api/users/{{openchannelQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!openchannelQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{openchannelQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="id ">{{openchannelQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="name ">{{openchannelQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(openchannelQueue, ev) : vm.createOrEditOpenchannelQueue($event, openchannelQueue)" md-cell class="strategy ">{{ vm.arraystrategy[openchannelQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(openchannelQueue, $event)" translate="OPENCHANNEL.EDIT_OPENCHANNELQUEUE">\n Edit OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.TEAMADD_OPENCHANNELQUEUE">\n teamadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(openchannelQueue, $event)" translate="OPENCHANNEL.AGENTADD_OPENCHANNELQUEUE">\n agentadd OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(openchannelQueue, $event)" translate="OPENCHANNEL.DELETE_OPENCHANNELQUEUE">\n Delete OpenchannelQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(openchannelQueue, $event)" translate="OPENCHANNEL.GOTOREALTIME_OPENCHANNELQUEUE">\n goToRealtime OpenchannelQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.openchannelQueues.count}}" md-on-paginate="vm.getOpenchannelQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OPENCHANNELQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OPENCHANNELQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-openchannelQueue-button" ng-click="vm.createOrEditOpenchannelQueue($event)" aria-label="add openchannelQueue" translate translate-attr-aria-label="OPENCHANNEL.ADD_OPENCHANNELQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OPENCHANNELQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/openchannel/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'OPENCHANNEL.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'OPENCHANNEL.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'OPENCHANNEL.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'OPENCHANNEL.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'OPENCHANNEL.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'OPENCHANNEL.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'OPENCHANNEL.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'OPENCHANNEL.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'OPENCHANNEL.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"OPENCHANNEL.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"OPENCHANNEL.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"OPENCHANNEL.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"OPENCHANNEL.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"OPENCHANNEL.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'OPENCHANNEL.PAGE' | translate}}:', rowsPerPage: '{{'OPENCHANNEL.ROWSPERPAGE' | translate}}:', of: '{{'OPENCHANNEL.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/openchannel/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="OPENCHANNEL.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'OPENCHANNEL.NAME\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.PAUSED\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.READY\' | translate }}</th>\n <th md-column>{{ \'OPENCHANNEL.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="OPENCHANNEL.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="OPENCHANNEL.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditOpenchannelQueue($event, vm.queues[value])" translate="OPENCHANNEL.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="OPENCHANNEL.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'OPENCHANNEL.PAGE\' | translate}}:\', rowsPerPage: \'{{\'OPENCHANNEL.ROWSPERPAGE\' | translate}}:\', of: \'{{\'OPENCHANNEL.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/openchannel/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="OPENCHANNEL.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/plugins/views/plugin/plugin.html",'<div ng-if="!vm.plugin">\n <p>Plugin not available...</p>\n</div>\n<div id="plugin" ng-if="vm.plugin" ng-cloak layout-fill>\n <iframe ng-src="{{vm.getTrustedURL()}}" frameborder=0 style="border:0px; width:100%; height:100%;"></iframe>\n</div>'),e.put("app/main/apps/settings/views/customizations/create/dialog.html",'<md-dialog class="customization-dialog" aria-label="New Customization">\n <form name="customizationForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationForm[\'headerWhiteLabel\'].$error" ng-show="customizationForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationForm[\'pageTitle\'].$error" ng-show="customizationForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomization" ng-click="vm.saveCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid || customizationForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomization" ng-click="vm.addNewCustomization()" class="send-button md-accent md-raised" ng-disabled="customizationForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_CUSTOMIZATION" translate-attr-aria-label="SETTINGS.ADD_CUSTOMIZATION">\n ADD CUSTOMIZATION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomization" ng-click="vm.deleteCustomization($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/customizations/customizations.html",'<div id="customizations" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.CUSTOMIZATIONS">Customizations</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveCustomization()" ng-disabled="(customizationsForm.$pristine && logoForm.$pristine && logologinForm.$pristine && preferredForm.$pristine) || (customizationsForm.$invalid || logoForm.$invalid || logologinForm.$invalid || preferredForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="customization-detail-form-container customizations md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.CUSTOMIZATIONS">CUSTOMIZATIONS</div>\n </div>\n <form name="customizationsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLogo" aria-label="Default_Logo"><span translate="SETTINGS.DEFAULT_LOGO">Default_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultLoginLogo" aria-label="Default_Login_Logo"><span translate="SETTINGS.DEFAULT_LOGIN_LOGO">Default_Login_Logo</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultHeaderWhiteLabel" aria-label="Default_Header_WhiteLabel"><span translate="SETTINGS.DEFAULT_HEADER_WHITELABEL">Default_Header_WhiteLabel</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultHeaderWhiteLabel" class="md-block">\n <label translate="SETTINGS.HEADER_WHITELABEL">Header_WhiteLabel</label>\n <input type="text" name="headerWhiteLabel" ng-model="vm.customization.headerWhiteLabel" ng-required="true">\n\n <div ng-messages="customizationsForm[\'headerWhiteLabel\'].$error" ng-show="customizationsForm[\'headerWhiteLabel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.HEADER_WHITELABEL_REQUIRED">Header_WhiteLabel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.customization.defaultPageTitle" aria-label="Default_Page_Title"><span translate="SETTINGS.DEFAULT_PAGE_TITLE">Default_Page_Title</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.customization.defaultPageTitle" class="md-block">\n <label translate="SETTINGS.PAGE_TITLE">Page_Title</label>\n <input type="text" name="pageTitle" ng-model="vm.customization.pageTitle" ng-required="true">\n\n <div ng-messages="customizationsForm[\'pageTitle\'].$error" ng-show="customizationsForm[\'pageTitle\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PAGE_TITLE_REQUIRED">Page_Title field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.preferred" class="md-block">\n <md-switch ng-model="vm.customization.defaultPreferred" aria-label="Default_Preferred"><span translate="SETTINGS.DEFAULT_PREFERRED">Default_Preferred</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n\n <div ng-if="!vm.customization.defaultLogo" class="customization-detail-form-container logo md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGO">LOGO</div>\n </div>\n <div ng-controller="CustomizationlogoController as vm_cl" ng-init="vm_cl.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cl.ngFlowOptions" flow-name="vm_cl.ngFlow.flow" flow-files-submitted="vm_cl.upload()" flow-file-added="vm_cl.fileAdded($file)" flow-file-success="vm_cl.fileSuccess($file, $message)" flow-complete="vm_cl.uploadComplete()" flow-drop flow-drag-enter="vm_cl.dropping=true" flow-drag-leave="vm_cl.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logoimage in vm_cl.customization.images" ng-switch="logoimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logoimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logoimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logoimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultLoginLogo" class="customization-detail-form-container logologin md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.LOGOLOGIN">LOGOLOGIN</div>\n </div>\n <div ng-controller="CustomizationlogologinController as vm_cll" ng-init="vm_cll.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cll.ngFlowOptions" flow-name="vm_cll.ngFlow.flow" flow-files-submitted="vm_cll.upload()" flow-file-added="vm_cll.fileAdded($file)" flow-file-success="vm_cll.fileSuccess($file, $message)" flow-complete="vm_cll.uploadComplete()" flow-drop flow-drag-enter="vm_cll.dropping=true" flow-drag-leave="vm_cll.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="logologinimage in vm_cll.customization.images" ng-switch="logologinimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{logologinimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="logologinimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{logologinimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n <div ng-if="!vm.customization.defaultPreferred && vm.license.preferred" class="customization-detail-form-container preferred md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.PREFERRED">PREFERRED</div>\n </div>\n <div ng-controller="CustomizationpreferredController as vm_cp" ng-init="vm_cp.init(vm.customization)" class="customization-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="customization-image-uploader" flow-init="vm_cp.ngFlowOptions" flow-name="vm_cp.ngFlow.flow" flow-files-submitted="vm_cp.upload()" flow-file-added="vm_cp.fileAdded($file)" flow-file-success="vm_cp.fileSuccess($file, $message)" flow-complete="vm_cp.uploadComplete()" flow-drop flow-drag-enter="vm_cp.dropping=true" flow-drag-leave="vm_cp.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="preferredimage in vm_cp.customization.images" ng-switch="preferredimage.type">\n <div class="customization-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{preferredimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="preferredimage.file">\n </div>\n\n <div class="customization-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{preferredimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/generals/create/dialog.html",'<md-dialog class="general-dialog" aria-label="New General">\n <form name="generalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n\n <div ng-messages="generalForm[\'min_internal\'].$error" ng-show="generalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" ng-required="true">\n\n <div ng-messages="generalForm[\'chatTimeout\'].$error" ng-show="generalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n\n <div ng-messages="generalForm[\'stunaddr\'].$error" ng-show="generalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n\n <div ng-messages="generalForm[\'turnaddr\'].$error" ng-show="generalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n\n <div ng-messages="generalForm[\'turnusername\'].$error" ng-show="generalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n\n <div ng-messages="generalForm[\'turnpassword\'].$error" ng-show="generalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv">\n\n <div ng-messages="generalForm[\'splitSizeCsv\'].$error" ng-show="generalForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf">\n\n <div ng-messages="generalForm[\'splitSizePdf\'].$error" ng-show="generalForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx">\n\n <div ng-messages="generalForm[\'splitSizeXlsx\'].$error" ng-show="generalForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newGeneral" ng-click="vm.saveGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid || generalForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newGeneral" ng-click="vm.addNewGeneral()" class="send-button md-accent md-raised" ng-disabled="generalForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_GENERAL" translate-attr-aria-label="SETTINGS.ADD_GENERAL">\n ADD GENERAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newGeneral" ng-click="vm.deleteGeneral($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/generals/generals.html",'<div id="generals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.GENERAL">General</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.saveGeneral()" ng-disabled="(globalForm.$pristine && motionbarForm.$pristine && reportForm.$pristine && agentOmniDesktopInterfaceForm.$pristine) || (globalForm.$invalid || motionbarForm.$invalid || reportForm.$invalid || agentOmniDesktopInterfaceForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="general-detail-form-container global md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GLOBAL">GLOBAL</div>\n </div>\n <form name="globalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MIN_INTERNAL">Min_Internal</label>\n <input type="number" name="min_internal" ng-model="vm.general.min_internal" min="0" ng-required="true" autofocus>\n\n <div ng-messages="globalForm[\'min_internal\'].$error" ng-show="globalForm[\'min_internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_REQUIRED">Min_Internal field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Min_Internal must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.securePassword" aria-label="Security_Suite"><span translate="SETTINGS.SECURITY_SUITE">Security_Suite</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SECURITY_SUITE"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.callRecordingEncryption" aria-label="Call_Recording_Encryption"><span translate="SETTINGS.CALL_RECORDING_ENCRYPTION">Call_Recording_Encryption</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.CHATTIMEOUT">chatTimeout</label>\n <input type="number" name="chatTimeout" ng-model="vm.general.chatTimeout" min="0" ng-required="true">\n\n <div ng-messages="globalForm[\'chatTimeout\'].$error" ng-show="globalForm[\'chatTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_REQUIRED">chatTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SETTINGS.ERRORS.CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">chatTimeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.STUNADDR">Stunaddr</label>\n <input type="text" name="stunaddr" ng-model="vm.general.stunaddr">\n\n <div ng-messages="globalForm[\'stunaddr\'].$error" ng-show="globalForm[\'stunaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.STUNADDR_REQUIRED">Stunaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURNADDR">Turnaddr</label>\n <input type="text" name="turnaddr" ng-model="vm.general.turnaddr">\n\n <div ng-messages="globalForm[\'turnaddr\'].$error" ng-show="globalForm[\'turnaddr\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURNADDR_REQUIRED">Turnaddr field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_USERNAME">Turn_Username</label>\n <input type="text" name="turnusername" ng-model="vm.general.turnusername">\n\n <div ng-messages="globalForm[\'turnusername\'].$error" ng-show="globalForm[\'turnusername\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_USERNAME_REQUIRED">Turn_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TURN_PASSWORD">Turn_Password</label>\n <input type="text" name="turnpassword" ng-model="vm.general.turnpassword">\n\n <div ng-messages="globalForm[\'turnpassword\'].$error" ng-show="globalForm[\'turnpassword\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TURN_PASSWORD_REQUIRED">Turn_Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.rtlSupport" aria-label="RtlSupport"><span translate="SETTINGS.RTLSUPPORT">RtlSupport</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.RTLSUPPORT"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container motionbar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.MOTIONBAR">MOTIONBAR</div>\n </div>\n <form name="motionbarForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarAutoUpdater" aria-label="MotionbarAutoUpdater"><span translate="SETTINGS.MOTIONBARAUTOUPDATER">MotionbarAutoUpdater</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.phoneBarAutoUpdater" class="md-block">\n <label translate="SETTINGS.MOTIONBARAUTOUPDATERURL">MotionbarAutoUpdaterUrl</label>\n <input type="url" name="phoneBarAutoUpdaterUrl" ng-model="vm.general.phoneBarAutoUpdaterUrl" ng-required="vm.general.phoneBarAutoUpdater">\n\n <div ng-messages="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$error" ng-show="motionbarForm[\'phoneBarAutoUpdaterUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_REQUIRED">MotionbarAutoUpdaterUrl field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SETTINGS.ERRORS.MOTIONBARAUTOUPDATERURL_MUST_VALID_URL">MotionbarAutoUpdaterUrl must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.phoneBarRememberMeEnabled" aria-label="MotionbarRememberMe"><span translate="SETTINGS.MOTIONBARREMEMBERME">MotionbarRememberMe</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.MOTIONBARREMEMBERME"></span></div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container report md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.REPORT">REPORT</div>\n </div>\n <form name="reportForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.split" aria-label="Split"><span translate="SETTINGS.SPLIT">Split</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZECSV">SplitSizeCsv</label>\n <input type="number" name="splitSizeCsv" ng-model="vm.general.splitSizeCsv">\n\n <div ng-messages="reportForm[\'splitSizeCsv\'].$error" ng-show="reportForm[\'splitSizeCsv\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZECSV_REQUIRED">SplitSizeCsv field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEPDF">SplitSizePdf</label>\n <input type="number" name="splitSizePdf" ng-model="vm.general.splitSizePdf">\n\n <div ng-messages="reportForm[\'splitSizePdf\'].$error" ng-show="reportForm[\'splitSizePdf\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEPDF_REQUIRED">SplitSizePdf field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.general.split" class="md-block">\n <label translate="SETTINGS.SPLITSIZEXLSX">SplitSizeXlsx</label>\n <input type="number" name="splitSizeXlsx" ng-model="vm.general.splitSizeXlsx">\n\n <div ng-messages="reportForm[\'splitSizeXlsx\'].$error" ng-show="reportForm[\'splitSizeXlsx\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SPLITSIZEXLSX_REQUIRED">SplitSizeXlsx field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n <div class="general-detail-form-container agentomnidesktopinterface md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.AGENTOMNIDESKTOPINTERFACE">AGENTOMNIDESKTOPINTERFACE</div>\n </div>\n <form name="agentOmniDesktopInterfaceForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.general.enableEmailPreview" aria-label="EnableEmailPreview"><span translate="SETTINGS.ENABLEEMAILPREVIEW">EnableEmailPreview</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.MESSAGESALIGNMENT">messagesAlignment</label>\n <md-select name="messagesAlignment" ng-model="vm.general.messagesAlignment">\n <md-option ng-value="\'alternate\'">Alternate</md-option>\n <md-option ng-value="\'left\'">Left</md-option>\n <md-option ng-value="\'right\'">Right</md-option>\n </md-select>\n <div ng-messages="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$error" ng-show="agentOmniDesktopInterfaceForm[\'messagesAlignment\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.MESSAGESALIGNMENT_REQUIRED">messagesAlignment field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/license/license.html",'<div id="license" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.LICENSE">LICENSE</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n <div>\n <md-button type="submit" ng-click="vm.requestLicense()" class="send-button md-raised" translate="SETTINGS.REQUEST_LICENSE" translate-attr-aria-label="SETTINGS.REQUEST_LICENSE">\n REQUEST LICENSE\n </md-button>\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n \x3c!-- LICENSE CARD --\x3e\n <div layout="row" flex>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="row" layout-align="center">\n <div flex layout="row" layout-align="start center">\n <div>\n <a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank" class="md-button md-fab green-A700-bg" aria-label="Eat cake">\n <md-tooltip><span translate="SETTINGS.PRICES">Prices</span></md-tooltip>\n <md-icon md-font-icon="icon-coin"></md-icon>\n </a>\n </div>\n </div>\n <div flex>\n <div ng-switch="vm.license.months" class="text-center">\n <span ng-switch-when="1" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></span>\n <span ng-switch-when="12" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.ANNUALLY">ANNUALLY</span></span>\n <span ng-switch-when="36" class="md-title md-accent-fg text-bold">{{ \'SETTINGS.PLAN\' | translate }}: <span translate="SETTINGS.PERPETUAL">PERPETUAL</span></span>\n </div>\n </div>\n <div flex layout="row" layout-align="end center">\n <div>\n <md-button type="submit" ng-click="vm.updateLicense()" class="md-button md-fab md-accent">\n <md-tooltip><span translate="SETTINGS.UPDATE_LICENSE">License</span></md-tooltip>\n <md-icon md-font-icon="icon-pencil"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n\n <span ng-if="!vm.license.demo && !vm.license.gray" class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_DATE\' | translate }}: {{vm.license.expiration | date: \'longDate\'}}</span>\n <span class="text-center padding-bottom-10"> {{ vm.license.machineUuid !== vm.license.uuid ? \'SETTINGS.OLD_TOKEN\' : \'SETTINGS.TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.uuid}}</span></span>\n\n <div layout="column">\n <span ng-if="vm.license.grayReason == \'changed\'" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.NEW_TOKEN_DETECTED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.NEW_TOKEN\' | translate }}: <span class="text-italic text-bold">{{vm.license.machineUuid}}</span></span>\n <span ng-if="vm.license.gray" class="blink md-subhead md-warn-fg text-center">{{ \'SETTINGS.EXPIRATION_GRAY_PERIOD\' | translate }}: {{vm.license.deadline | date: \'longDate\'}}</span>\n <span ng-if="vm.license.gray" class="text-center padding-bottom-10 text-italic text-bold"> {{\'SETTINGS.EXPIRATION_REASON\' | translate }} </span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_DISABLED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_REASON_MESSAGE_CHANGED\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10"> {{\'SETTINGS.EXPIRATION_CHANGED_ADVISE\' | translate }}</span>\n <span ng-if="vm.license.grayReason == \'changed\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=New%20token%20detected&body=Hi xCALLY, New Token: {{vm.license.machineUuid}}, Old token: {{vm.license.uuid}}">license@xcally.com</a>.</span>\n <span ng-if="vm.license.grayReason == \'disabled\'" class="text-center padding-bottom-10">{{ \'SETTINGS.SEND_EMAIL_TO\' | translate }}: <a href="mailto:license@xcally.com?subject=License%20disabled&body=Hi xCALLY, My Token: {{vm.license.machineUuid}}">license@xcally.com</a>.</span>\n </div>\n\n <div ng-if="vm.license.demo" layout="column">\n <span class="md-subhead md-warn-fg text-center">{{ \'SETTINGS.TRIAL_VERSION\' | translate }}</span>\n <span class="md-subhead md-warn-fg text-center"><a href="https://www.xcally.com/en/index.html#pricing-table2-h" target="_blank">{{ \'SETTINGS.PRICES\' | translate}}</a></span>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-account" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.users || 0 }} <span ng-class="{\'red-fg\': vm.license.users <= vm.users && vm.license.users > 0}">({{vm.license.users >= vm.users ? vm.users : vm.license.users}})</span></h3>\n <p translate="SETTINGS.USERS">Users</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-headphones" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.agents || 0 }} <span ng-class="{\'red-fg\': (vm.license.agents <= vm.agents && vm.license.agents > 0) }">({{vm.license.agents >= vm.agents ? vm.agents : vm.license.agents}})</span></h3>\n <p translate="SETTINGS.AGENTS">Agents</p>\n </div>\n </md-list-item>\n <md-list-item class="md-2-line" flex="33">\n <md-icon md-font-icon="icon-phone" class="md-avatar-icon"></md-icon>\n <div class="md-list-item-text">\n <h3>{{ vm.license.telephones || 0 }} <span ng-class="{\'red-fg\': vm.license.telephones <= vm.telephones && vm.license.telephones > 0}">({{vm.license.telephones >= vm.telephones ? vm.telephones : vm.license.telephones}})</span></h3>\n <p translate="SETTINGS.TELEPHONES">Telephones</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n <md-list layout="row">\n <md-list-item flex="33" class="md-2-line" ng-repeat="channel in vm.channels | limitTo:3:3">\n <md-icon md-font-icon="{{channel.icon}}" class="md-avatar-icon" ng-class="vm.license[channel.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{channel.name | uppercase}}"></h3>\n <p ng-class="vm.license[channel.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[channel.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="module in vm.modules" flex="33">\n <md-icon md-font-icon="{{module.icon}}" class="md-avatar-icon" ng-class="vm.license[module.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{module.name | uppercase}}"></h3>\n <p ng-class="vm.license[module.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[module.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <div ng-repeat="session in vm.sessions" flex="33">\n <md-list-item class="md-2-line">\n <md-icon md-font-icon="{{session.icon}}" class="md-avatar-icon" ng-class="vm.license[session.enabled] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <div layout="row" layout="start center">\n <h3 translate="SETTINGS.{{session.name | uppercase}}"></h3>\n <button ng-if="session.restart" ng-click="vm.gotoProcess($event)" class="md-mini" aria-label="restart">\n <md-tooltip>Restart</md-tooltip>\n <md-icon md-font-icon="icon-reload"></md-icon>\n </button>\n </div>\n <p ng-if="vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">{{vm.license[session.name]}} {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.name] && vm.license[session.enabled]" class="green-A700-fg">UNLIMITED {{ \'SETTINGS.\' + session.label | uppercase | translate }}</p>\n <p ng-if="!vm.license[session.enabled]" class="red-A700-fg">{{ \'SETTINGS.DISABLED\' | translate }}</p>\n </div>\n </md-list-item>\n\n </div>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="addon in vm.addons" flex="33">\n <md-icon md-font-icon="{{addon.icon}}" class="md-avatar-icon" ng-class="vm.license[addon.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{addon.name | uppercase}}"></h3>\n <p ng-class="vm.license[addon.name] ? \'green-A700-fg\' : \'red-A700-fg\'">{{ \'SETTINGS.\' + (vm.license[addon.name] ? \'ENABLED\' : \'DISABLED\') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <md-divider></md-divider>\n <md-list layout="row">\n <md-list-item class="md-2-line" ng-repeat="other in vm.others" flex="33">\n <md-icon md-font-icon="{{other.icon}}" class="md-avatar-icon" ng-class="vm.license[other.name] ? \'green-A700-bg\' : \'red-A700-bg\'"></md-icon>\n <div class="md-list-item-text">\n <h3 translate="SETTINGS.{{other.name | uppercase}}"></h3>\n'+" <p ng-class=\"vm.license[other.name] ? 'green-A700-fg' : 'red-A700-fg'\">{{ 'SETTINGS.' + (vm.license[other.name] ? 'ENABLED' : 'DISABLED') | translate }}</p>\n </div>\n </md-list-item>\n </md-list>\n </md-card>\n </div>\n \x3c!-- / LICENSE CARD --\x3e\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>"),e.put("app/main/apps/settings/views/license/request/dialog.html",'<md-dialog class="request-dialog" aria-label="Send Request">\n <form name="requestForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.REQUEST_LICENSE">Request License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.license.name" required>\n <div ng-messages="requestForm.name.$error" ng-show="requestForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.NAME_REQUIRED">Address field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.license.email" required>\n <div ng-messages="requestForm.email.$error" ng-show="requestForm.email.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.PLAN">Plan</label>\n <md-select name="plan" ng-model="vm.license.months" required>\n <md-option ng-value="1"><span translate="SETTINGS.MONTH_TO_MONTH">MONTH TO MONTH</span></md-option>\n <md-option ng-value="12"><span translate="SETTINGS.ANNUALLY">ANNUALLY</span></md-option>\n <md-option ng-value="36"><span translate="SETTINGS.PERPETUAL">PERPETUAL</span></md-option>\n </md-select>\n <div ng-messages="requestForm.plan.$error" ng-show="requestForm.plan.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PLAN_REQUIRED">Plan field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.STAFF\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.USERS">Users</label>\n <input type="number" name="users" ng-model="vm.license.users" required>\n <div ng-messages="requestForm.users.$error" ng-show="requestForm.users.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.USERS_REQUIRED">Users field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.AGENTS">Agents</label>\n <input type="number" name="agents" ng-model="vm.license.agents" required>\n <div ng-messages="requestForm.agents.$error" ng-show="requestForm.agents.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.AGENTS_REQUIRED">Agents field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" flex>\n <label translate="SETTINGS.TELEPHONES">Telephones</label>\n <input type="number" name="telephones" ng-model="vm.license.telephones" required>\n <div ng-messages="requestForm.telephones.$error" ng-show="requestForm.telephones.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TELEPHONES_REQUIRED">Telephones field is required</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.CHANNELS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n <md-switch ng-model="vm.license[channel.name]" aria-label="{{channel.name}}" ng-repeat="channel in vm.channels | limitTo:3:3"><span translate="SETTINGS.{{channel.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.MODULES\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[module.name]" aria-label="{{module.name}}" ng-repeat="module in vm.modules"><span translate="SETTINGS.{{module.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.SESSIONS\' | translate }}</md-subheader>\n <div layout="row">\n <md-input-container ng-repeat="session in vm.sessions" class="md-block" flex="50">\n <label>{{ \'SETTINGS.\' + session.name | uppercase | translate }} ({{ \'SETTINGS.\' + session.label | uppercase | translate }})</label>\n <input type="number" name="{{session.name}}" ng-model="vm.license[session.name]" required>\n <div class="hint"><span>0={{ \'SETTINGS.UNLIMITED_CHANNELS\' | translate }}</span></div>\n <div ng-messages="requestForm[session.name].$error" ng-show="requestForm[session.name].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.CHANNEL_REQUIRED">Mandatory field</span>\n </div>\n </div>\n </md-input-container>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.ADDONS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[addon.name]" aria-label="{{module.name}}" ng-repeat="addon in vm.addons"><span translate="SETTINGS.{{addon.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-subheader class="md-no-sticky">{{ \'SETTINGS.OTHERS\' | translate }}</md-subheader>\n <div layout="row" layout-align="space-between center">\n <md-switch ng-model="vm.license[other.name]" aria-label="{{other.name}}" ng-repeat="other in vm.others"><span translate="SETTINGS.{{other.name | uppercase}}"></span></md-switch>\n </div>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <textarea name="description" ng-model="vm.license.description"></textarea>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.sendRequest()" class="send-button md-accent md-raised" ng-disabled="requestForm.$invalid || requestForm.$pristine" aria-label="SEND" translate="SETTINGS.SEND" translate-attr-aria-label="SETTINGS.SEND">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/license/update/dialog.html",'<md-dialog class="update-dialog" aria-label="Update License">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title" translate="SETTINGS.UPDATE_LICENSE">Update License</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-content layout="row">\n <span class="md-title" translate="SETTINGS.UPDATE_LICENSE_MANUALLY">Do you want to update your license manually?</span>\n </md-content>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ENTER_LICENSE">Enter your license</label>\n <textarea name="key" ng-model="vm.licenseKey" required></textarea>\n <div ng-messages="updateForm.name.$error" ng-show="updateForm.key.$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LICENSE_REQUIRED">License key field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.updateLicense()" class="send-button md-accent md-raised" ng-disabled="updateForm.$invalid || updateForm.$pristine" aria-label="UPDATE" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">\n UPDATE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/create/dialog.html",'<md-dialog class="network-dialog" aria-label="New Network">\n <form name="networkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.network.type" autofocus required>\n <md-option ng-value="\'localnet\'">LocalNET</md-option>\n <md-option ng-value="\'externip\'">ExternIP</md-option>\n </md-select>\n <div ng-messages="networkForm[\'type\'].$error" ng-show="networkForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'localnet\'" class="md-block">\n <label translate="SETTINGS.LOCALNETADDRESS">localNetAddress</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.LOCALNETADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_REQUIRED">localNetAddress field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.LOCALNETADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">localNetAddress must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.network.type == \'externip\'" class="md-block">\n <label translate="SETTINGS.ADDRESS">Address</label>\n <input type="text" name="value" ng-model="vm.network.value" ng-pattern="/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.ADDRESS"></span></div>\n <div ng-messages="networkForm[\'value\'].$error" ng-show="networkForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ADDRESS_REQUIRED">Address field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.ADDRESS_MUST_VALID_PATTERN" translate-values="{ regex: \'/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\' }">Address must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newNetwork" ng-click="vm.saveNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid || networkForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newNetwork" ng-click="vm.addNewNetwork()" class="send-button md-accent md-raised" ng-disabled="networkForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_NETWORK" translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n ADD NETWORK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-click="vm.deleteNetwork($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/networks/networks.html",'<div id="networks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.NETWORKS">Networks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SETTINGS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedNetworks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedNetworks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SETTINGS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-networks-count">\n <span>{{vm.selectedNetworks.length}}</span>\n <span translate="SETTINGS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="NETWORKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllNetworks()" translate="SETTINGS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectNetworks()" translate="SETTINGS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedNetworks" csv-label="true" filename="networks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-click="vm.deleteSelectedNetworks($event)" aria-label="delete selected" translate translate-attr-label="NETWORKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- NETWORK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedNetworks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getNetworks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SETTINGS.ID\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SETTINGS.TYPE\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SETTINGS.ADDRESS\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SETTINGS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.networks.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="SETTINGS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="network" md-select-id="id" ng-repeat="network in vm.networks.rows">\n <td md-cell ng-if="network.userpic"><img class="avatar" alt="{{network.name}}" ng-src="api/users/{{network.id}}/avatar" /></td>\n <td md-cell ng-if="!network.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{network.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="id ">{{network.id}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="type ">{{ vm.arraytype[network.type].option }}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="value ">{{network.value}}</td>\n <td ng-click="vm.createOrEditNetwork($event, network)" md-cell class="createdAt ">{{network.createdAt | date:\'medium\' }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SETTINGS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.editdialog(network, $event)" translate="SETTINGS.EDIT_NETWORK">\n Edit Network\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(network, $event)" translate="SETTINGS.DELETE_NETWORK">\n Delete Network\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SETTINGS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SETTINGS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SETTINGS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.networks.count}}" md-on-paginate="vm.getNetworks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / NETWORK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD NETWORK BUTTON --\x3e\n <md-button class="md-fab md-accent" id="add-network-button" ng-click="vm.createOrEditNetwork($event)" aria-label="add network" translate translate-attr-aria-label="SETTINGS.ADD_NETWORK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD NETWORK BUTTON --\x3e\n</div>'),e.put("app/main/apps/settings/views/smtps/create/dialog.html",'<md-dialog class="smtp-dialog" aria-label="New Smtp">\n <form name="smtpForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n\n <div ng-messages="smtpForm[\'name\'].$error" ng-show="smtpForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="smtpForm[\'email\'].$error" ng-show="smtpForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="smtpForm[\'Smtp.service\'].$error" ng-show="smtpForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n\n <div ng-messages="smtpForm[\'Smtp.host\'].$error" ng-show="smtpForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n\n <div ng-messages="smtpForm[\'Smtp.port\'].$error" ng-show="smtpForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="smtpForm[\'Smtp.user\'].$error" ng-show="smtpForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="smtpForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n\n <div ng-messages="smtpForm[\'description\'].$error" ng-show="smtpForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmtp" ng-click="vm.saveSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid || smtpForm.$pristine" aria-label="SAVE" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmtp" ng-click="vm.addNewSmtp()" class="send-button md-accent md-raised" ng-disabled="smtpForm.$invalid" aria-label="ADD" translate="SETTINGS.ADD_SMTP" translate-attr-aria-label="SETTINGS.ADD_SMTP">\n ADD SMTP\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmtp" ng-click="vm.deleteSmtp($event)" aria-label="DELETE" translate translate-attr-aria-label="SETTINGS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SETTINGS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/smtps/smtps.html",'<div id="smtps" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SMTP">Smtp</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div>\n <md-button type="submit" ng-click="vm.verifySmtp()" ng-disabled="!vm.smtp.id" class="send-button md-accent md-raised" translate="SETTINGS.VERIFY" translate-attr-aria-label="SETTINGS.VERIFY">\n VERIFY\n </md-button>\n <md-button type="submit" ng-click="vm.saveSmtp()" ng-disabled="(generalForm.$pristine) || (generalForm.$invalid)" class="send-button md-accent md-raised" translate="SETTINGS.SAVE" translate-attr-aria-label="SETTINGS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n <div class="smtp-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SETTINGS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SETTINGS.ACCOUNTNAME">AccountName</label>\n <input type="text" name="name" ng-model="vm.smtp.name" ng-required="true" autofocus>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.ACCOUNTNAME_REQUIRED">AccountName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.EMAILADDRESS">EmailAddress</label>\n <input type="email" name="email" ng-model="vm.smtp.email" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n <div ng-message="email">\n <span translate="SETTINGS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SETTINGS.SMTP_SERVICE">SMTP_Service</label>\n <md-select name="Smtp.service" ng-model="vm.smtp.Smtp.service" required>\n <md-option ng-value="null">Custom</md-option>\n <md-option ng-value="\'gmail\'">Gmail</md-option>\n <md-option ng-value="\'hotmail\'">Hotmail</md-option>\n <md-option ng-value="\'yahoo\'">Yahoo</md-option>\n <md-option ng-value="\'outlook365\'">Outlook365</md-option>\n </md-select>\n <div ng-messages="generalForm[\'Smtp.service\'].$error" ng-show="generalForm[\'Smtp.service\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_SERVICE_REQUIRED">SMTP_Service field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_HOST">SMTP_Host</label>\n <input type="text" name="Smtp.host" ng-model="vm.smtp.Smtp.host" ng-required="true">\n\n <div ng-messages="generalForm[\'Smtp.host\'].$error" ng-show="generalForm[\'Smtp.host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_HOST_REQUIRED">SMTP_Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <label translate="SETTINGS.SMTP_PORT">SMTP_Port</label>\n <input type="number" name="Smtp.port" ng-model="vm.smtp.Smtp.port" ng-required="true">\n\n <div ng-messages="generalForm[\'Smtp.port\'].$error" ng-show="generalForm[\'Smtp.port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_PORT_REQUIRED">SMTP_Port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.secure" aria-label="SMTP_Secure"><span translate="SETTINGS.SMTP_SECURE">SMTP_Secure</span></md-switch>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_SECURE"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.service == null" class="md-block">\n <md-switch ng-model="vm.smtp.Smtp.authentication" aria-label="SMTP_Authentication"><span translate="SETTINGS.SMTP_AUTHENTICATION">SMTP_Authentication</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null" class="md-block">\n <label translate="SETTINGS.SMTP_USERNAME">SMTP_Username</label>\n <input type="text" name="Smtp.user" ng-model="vm.smtp.Smtp.user" ng-required="true">\n\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_USERNAME"></span></div>\n <div ng-messages="generalForm[\'Smtp.user\'].$error" ng-show="generalForm[\'Smtp.user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.SMTP_USERNAME_REQUIRED">SMTP_Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smtp.Smtp.authentication == true || vm.smtp.Smtp.service != null">\n <label translate="SETTINGS.SMTP_PASSWORD">SMTP_Password</label>\n <input type="password" name="Smtp.pass" ng-model="vm.smtp.Smtp.pass" placeholder="Password" translate translate-attr-placeholder="SETTINGS.PASSWORD" required>\n <div class="hint"><span translate="SETTINGS.HELP.SMTP_PASSWORD"></span></div>\n <div ng-messages="generalForm[\'Smtp.pass\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SETTINGS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="SETTINGS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.smtp.description">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SETTINGS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/settings/views/system/system.html",'<div id="system" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.SYSTEM">SYSTEM</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" md-border-bottom flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.GENERAL">GENERAL</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget flex="50" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg">\n <div class="h3">OS</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{vm.system.system.manufacturer}} {{vm.system.system.model}}</div>\n <div class="h4">{{vm.system.cpu.manufacturer}} {{vm.system.cpu.brand}} - {{vm.system.cpu.speed}} GHz - {{vm.system.cpu.cores}} Cores</div>\n <div class="h4">{{vm.system.os.distro}} - {{vm.system.os.release}} - Kernel: {{vm.system.os.kernel}}</div>\n <div class="h4">Node.js: {{vm.system.node}}</div>\n <div class="h4">Host: {{vm.system.os.hostname}} - Uptime: {{vm.system.time.uptime / 60 | number:0}} m</div>\n <div class="h4">TimeZone: {{vm.system.time.timezone}} ({{vm.system.time.timezoneName}})</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-1">\n <div class="h3">CPU</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.AVG_LOAD">AVG Load</span>\n <span class="h3 secondary-text font-weight-500">{{vm.system.currentLoad.avgload * 100 | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{vm.system.currentLoad.avgload * 100 | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n <ms-widget flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">MEM</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{vm.system.mem.total / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.FREE\' | translate}}: {{vm.system.mem.available / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{vm.system.mem.active / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h3 secondary-text font-weight-500">{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0}}%</span>\n </div>\n <md-progress-linear class="md-warn" md-mode="determinate" value="{{(vm.system.mem.active / vm.system.mem.total) * 100 | number : 0 }}"></md-progress-linear>\n\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="disk in vm.system.fsSize" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">DISK {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.FILE_SYSTEM\' | translate}}: {{disk.fs}}</div>\n <div class="h4">{{\'SETTINGS.MOUNT_POINT\' | translate}}: "{{disk.mount}}"</div>\n <div class="h4">{{\'SETTINGS.TOTAL\' | translate}}: {{disk.size / 1024 / 1024 / 1024 | number:0}} GB</div>\n <div class="h4">{{\'SETTINGS.USED\' | translate}}: {{disk.used / 1024 / 1024 / 1024 | number:0}} GB</div>\n </div>\n <div class="p-16 pb-32">\n <div class="pb-8" layout="row" layout-align="space-between start">\n <span class="h3" translate="SETTINGS.USED">Used</span>\n <span class="h4 secondary-text font-weight-500">{{disk.use | number:0}}%</span>\n </div>\n <md-progress-linear class="red" md-mode="determinate" value="{{disk.use | number:0}}"></md-progress-linear>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row" layout-xs="column" layout-wrap>\n <ms-widget ng-repeat="net in vm.system.net" flex="25" flex-xs="100">\n \x3c!-- Front --\x3e\n <ms-widget-front class="white-bg">\n <div class="ph-16 pt-16 pb-8 md-accent-bg md-hue-3">\n <div class="h3">NET {{$index + 1}}</div>\n </div>\n\n <div layout="row" layout-align="start center" layout-wrap>\n <div flex="100" flex-gt-md="100">\n <div class="p-16 pb-32">\n <div class="h4">{{\'SETTINGS.INTERFACE\' | translate}}: {{net.iface}}</div>\n <div class="h4">IPv4: {{net.ip4}}</div>\n <div class="h4">IPv6: {{net.ip6}}</div>\n <div class="h4">MAC: {{net.mac}}</div>\n </div>\n </div>\n </div>\n </ms-widget-front>\n \x3c!-- / Front --\x3e\n </ms-widget>\n </md-card>\n\n <md-card class="md-whiteframe-1dp padding-20" layout="row">\n <div flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.TOP_N_PROCESSES" translate-values="{value: vm.processLimit}"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm1 = query" on-collapse="vm.searchTerm1 = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>pmem</th>\n <th md-column>pcpu</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.system.processes.list | limitTo: vm.processLimit | filter: vm.searchTerm1 | orderBy:\'-pcpu\'">\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.command}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\n \'green-600-bg\': process.state == \'running\',\n \'yellow-600-bg\': process.state == \'sleeping\',\n \'red-600-bg\': process.state == \'blocked\'}">{{process.state | uppercase}}</span>\n </td>\n <td md-cell>{{process.pmem}}%</td>\n <td md-cell>{{process.pcpu}}%</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SETTINGS.PROCESSES">PROCESSES</span>\n </md-tab-label>\n\n <md-tab-body>\n <div class="system-detail-form-container general md-background-bg md-whiteframe-1dp">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.MOTION_PROCESS_MANAGEMENT"></span>\n <div flex></div>\n <ms-search-bar on-search="vm.searchTerm2 = query" on-collapse="vm.searchTerm2 = undefined" debounce="300"></ms-search-bar>\n <md-button ng-click="vm.getProcesses()" class="md-icon-button" aria-label="Reload">\n <md-icon md-font-icon="icon-reload" class="s24"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column>id</th>\n <th md-column>pid</th>\n <th md-column>{{\'SETTINGS.NAME\' | translate}}</th>\n <th md-column>{{\'SETTINGS.STATE\' | translate}}</th>\n <th md-column>MEM</th>\n <th md-column>CPU</th>\n <th md-column width="20px">Actions</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-repeat="process in vm.processes | filter: vm.searchTerm2 | orderBy:\'-monit.cpu\'">\n <td md-cell>{{process.pm_id}}</td>\n <td md-cell>{{process.pid}}</td>\n <td md-cell>{{process.name == \'agi\' ? \'agi (Cally Square IVR)\' : process.name}}</td>\n <td md-cell>\n <span class="text-boxed white-fg" ng-class="{\'green-600-bg\': process.pm2_env.status == \'online\', \'red-600-bg\': process.pm2_env.status == \'stopped\'}">{{process.pm2_env.status | uppercase}}</span>\n </td>\n <td md-cell>{{process.monit.memory / 1024 / 1024 | number:0}} MB</td>\n <td md-cell>{{process.monit.cpu}}%</td>\n <td md-cell>\n <md-button ng-if="process.pm2_env.status !== \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'online\')" class="md-icon-button" aria-label="Play">\n <md-icon md-font-icon="icon-play" class="s24"></md-icon>\n </md-button>\n <md-button ng-if="process.pm2_env.status === \'online\'" ng-click="vm.updateProcess($event, process.pm_id, \'stopped\')" class="md-icon-button" aria-label="Stop">\n <md-icon md-font-icon="icon-stop" class="s24"></md-icon>\n </md-button>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell></td>\n <td md-cell>{{ (vm.processes | map: \'monit.memory\' | sum) / 1024 / 1024 | number:0 }} MB</td>\n <td md-cell></td>\n <td md-cell></td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SETTINGS.USEFUL_COMMANDS"></span>\n <div flex></div>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30%">{{\'SETTINGS.COMMAND\' | translate}}</th>\n <th md-column>{{\'SETTINGS.DESCRIPTION\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr>\n <td md-cell class="no-border">pm2 list</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LIST\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 start <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_START\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 stop <id | name | all></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_STOP\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 restart <id | name></td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_RESTART\' | translate}}</td>\n </tr>\n <tr>\n <td md-cell class="no-border">pm2 logs [id | name]</td>\n <td md-cell class="no-border">{{ \'SETTINGS.PM2_LOGS\' | translate}}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </md-card>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/settings/views/updates/update/dialog.html",'<md-dialog aria-label="Update">\n <form name="updateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n </div>\n </md-toolbar>\n\n <div md-background-bg layout="row" layout-align="start start">\n <md-progress-linear md-mode="determinate" value="{{vm.progress}}" class="md-warn"></md-progress-linear>\n </div>\n\n <md-dialog-content ms-scroll>\n <div layout="row" layout-align="center center">\n <div ng-if="vm.updating" layout="column" layout-align="center center">\n <span class="text-center md-title">Grab a quick coffee and</span>\n <span class="text-center md-title">get back here as soon as completed!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n <div ng-if="!vm.updating">\n <div ng-if="vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Completed! Thank you for your time.</span>\n <span class="text-center md-title">In order to complete the update,</span>\n <span class="text-center md-title">please click on reload button</span>\n </div>\n <div ng-if="!vm.success" layout="column" layout-align="center center">\n <span class="text-center md-title">Update Error!</span>\n <span class="text-center md-title">Please contact your administrator!</span>\n <span class="text-center md-title">{{vm.output}}</span>\n </div>\n </div>\n <img src="assets/images/business/users.jpg" alt="" width="128" height="128" />\n </div>\n </md-dialog-content>\n\n <md-dialog-actions ng-if="!vm.updating" layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.reload()" class="send-button md-warm md-raised" aria-label="RELOAD" translate="SETTINGS.RELOAD" translate-attr-aria-label="SETTINGS.RELOAD">\n RELOAD\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/settings/views/updates/updates.html",'<div id="updates" class="page-layout simple fullwidth doc-page">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-cog" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SETTINGS.UPDATES">UPDATES</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n \x3c!-- UPDATE CARD --\x3e\n <div layout="row" ng-if="!vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.CURRENT_VERSION">CURRENT VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.current}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.current}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-20dp padding-20" flex ng-if="vm.version.current != vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.NEW_VERSION">NEW VERSION</span>\n\n <span class="md-display-3 padding-20">{{vm.version.latest}}</span>\n\n <md-button href="https://wiki.xcallymotion.com/display/XMV/Motion+GUI#MotionGUI-Version{{vm.version.latest}}" target="_blank" class="md-accent" title="CHANGELOG" aria-label="CHANGELOG" translate="SETTINGS.CHANGELOG" translate-attr-aria-label="SETTINGS.CHANGELOG">\n CHANGELOG\n </md-button>\n <md-button ng-click="vm.updateConfirm($event)" class="md-raised md-warn" aria-label="CHANGELOG" translate="SETTINGS.UPDATE" translate-attr-aria-label="SETTINGS.UPDATE">UPDATE</md-button>\n </div>\n </md-card>\n <md-card class="md-whiteframe-1dp padding-20" flex ng-if="vm.version.current == vm.version.latest">\n <div layout="column" layout-align="center center">\n\n <span class="md-title md-warn-fg padding-20 text-bold" translate="SETTINGS.REMOTE_VERSION">REMOTE VERSION</span>\n\n <span class="md-subhead padding-20" translate="SETTINGS.NO_NEW_VERSION_AVAILABLE">NO NEW VERSION AVAILABLE</span>\n </div>\n </md-card>\n </div>\n \x3c!-- / UPDATE CARD --\x3e\n\n <div ng-if="vm.updating">\n <md-card class="md-whiteframe-1dp padding-20" flex>\n <div layout="column" layout-align="center center">\n <span class="md-title md-accent-fg padding-20 text-bold" translate="SETTINGS.UPDATING">...</span>\n <md-progress-linear md-mode="determinate" class="md-accent padding-20" value="{{vm.progress}}"></md-progress-linear>\n <span class="md-display-1 padding-5 text-center">Grab a quick coffee and</span>\n <span class="md-display-1 padding-5 text-center">get back here as soon as completed</span>\n <img src="assets/images/business/users.jpg" alt="" width="40%" height="40%" />\n </div>\n </md-card>\n </div>\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'SMS.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'SMS.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'SMS.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'SMS.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'SMS.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'SMS.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'SMS.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'SMS.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'SMS.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'SMS.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'SMS.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"SMS.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"SMS.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"SMS.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"SMS.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"SMS.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'SMS.PAGE' | translate}}:', rowsPerPage: '{{'SMS.ROWSPERPAGE' | translate}}:', of: '{{'SMS.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/sms/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column>{{ \'SMS.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'SMS.PAUSED\' | translate }}</th>\n <th md-column>{{ \'SMS.READY\' | translate }}</th>\n <th md-column>{{ \'SMS.WAITING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditSmsQueue($event, vm.queues[value])" translate="SMS.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="SMS.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/sms/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/create/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus ng-disabled="!vm.newSmsAccount">\n\n <div ng-messages="smsAccountForm[\'name\'].$error" ng-show="smsAccountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'key\'].$error" ng-show="smsAccountForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="smsAccountForm[\'remote\'].$error" ng-show="smsAccountForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required>\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="smsAccountForm[\'ListId\'].$error" ng-show="smsAccountForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required>\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'type\'].$error" ng-show="smsAccountForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'phone\'].$error" ng-show="smsAccountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'accountSid\'].$error" ng-show="smsAccountForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authId\'].$error" ng-show="smsAccountForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'authToken\'].$error" ng-show="smsAccountForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required>\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="smsAccountForm[\'smsMethod\'].$error" ng-show="smsAccountForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'username\'].$error" ng-show="smsAccountForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="smsAccountForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'baseUrl\'].$error" ng-show="smsAccountForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true">\n\n <div ng-messages="smsAccountForm[\'apiKey\'].$error" ng-show="smsAccountForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description">\n\n <div ng-messages="smsAccountForm[\'description\'].$error" ng-show="smsAccountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsAccount" ng-click="vm.saveSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid || smsAccountForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsAccount" ng-click="vm.addNewSmsAccount()" class="send-button md-accent md-raised" ng-disabled="smsAccountForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSACCOUNT" translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n ADD SMSACCOUNT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsAccount" ng-click="vm.deleteSmsAccount($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/agentadd/agentadd.html",'<md-dialog class="smsAccount-dialog" aria-label="smsAccount" ng-init="vm.onInit()">\n <form name="smsAccountForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSACCOUNT">Add Agent to smsAccount</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/agent/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT">Agent</label>\n <md-select name="agent" ng-model="vm.agent.agent" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents" ng-disabled="agent.canSelect === false">{{ agent.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'agent\'].$error" ng-show="smsAccountFormApp[\'agent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_REQUIRED">Agent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.agent.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/autoreply/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TIMES">times</label>\n <md-select name="times" ng-model="vm.autoreply.times" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="1">One Time</md-option>\n <md-option ng-value="0">Always</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'times\'].$error" ng-show="smsAccountFormApp[\'times\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMES_REQUIRED">times field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TEXT">Text</label>\n <textarea name="text" ng-model="vm.autoreply.text" md-maxlength="255" required></textarea>\n\n <div ng-messages="smsAccountFormApp[\'text\'].$error" ng-show="smsAccountFormApp[\'text\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.TEXT_REQUIRED">Text field is required</span>\n </div>\n\n\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.TEXT_MAX_LENGTH" translate-values=\'{max: 255}\'>Text must have a maximum length equal to 255</span>\n </div>\n\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/close/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.DISPOSITION">Disposition</label>\n <input type="text" name="disposition" ng-model="vm.close.disposition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'disposition\'].$error" ng-show="smsAccountFormApp[\'disposition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DISPOSITION_REQUIRED">Disposition field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotoif/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.CONDITION">Condition</label>\n <input type="text" name="condition" ng-model="vm.gotoif.condition" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'condition\'].$error" ng-show="smsAccountFormApp[\'condition\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.CONDITION_REQUIRED">Condition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TRUEPRIORITY">truepriority</label>\n <input type="number" name="truepriority" ng-model="vm.gotoif.truepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'truepriority\'].$error" ng-show="smsAccountFormApp[\'truepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TRUEPRIORITY_REQUIRED">truepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">truepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.FALSEPRIORITY">falsepriority</label>\n <input type="number" name="falsepriority" ng-model="vm.gotoif.falsepriority" min="1" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'falsepriority\'].$error" ng-show="smsAccountFormApp[\'falsepriority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.FALSEPRIORITY_REQUIRED">falsepriority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">falsepriority must be a valid greater or equal than</span> <span>1</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/gotop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.PRIORITY">Priority</label>\n <input type="number" name="priority" ng-model="vm.gotop.priority" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'priority\'].$error" ng-show="smsAccountFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Priority must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/noop/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.noop.value" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'value\'].$error" ng-show="smsAccountFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/queue/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'queue\'].$error" ng-show="smsAccountFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'timeout\'].$error" ng-show="smsAccountFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/system/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.COMMAND">Command</label>\n <input type="text" name="command" ng-model="vm.system.command" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="smsAccountFormApp[\'command\'].$error" ng-show="smsAccountFormApp[\'command\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.COMMAND_REQUIRED">Command field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VARIABLE">Variable</label>\n <md-select name="variable" ng-model="vm.system.variable" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="variable.name" ng-repeat="variable in vm.variables" ng-disabled="variable.canSelect === false">{{ variable.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'variable\'].$error" ng-show="smsAccountFormApp[\'variable\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/apps/tag/dialog.html",'<md-dialog class="smsAccount-dialog" aria-label="New SmsAccount">\n <form name="smsAccountFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.TAG">Tag</label>\n <md-select name="tag" ng-model="vm.tag.tag" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="smsAccountFormApp[\'tag\'].$error" ng-show="smsAccountFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TAG_REQUIRED">Tag field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveSmsAccountApp()" class="send-button md-accent md-raised" ng-disabled="smsAccountFormApp.$invalid || smsAccountFormApp.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsCannedAnswers/dialog.html",'<md-dialog class="smsCannedAnswer-dialog" aria-label="New SmsCannedAnswer">\n <form name="smsCannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">Key</label>\n <input type="" name="key" ng-model="vm.smsCannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="smsCannedAnswerForm[\'key\'].$error" ng-show="smsCannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.smsCannedAnswer.value" required></textarea>\n\n <div ng-messages="smsCannedAnswerForm[\'value\'].$error" ng-show="smsCannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="SMS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsCannedAnswer.description">\n\n <div ng-messages="smsCannedAnswerForm[\'description\'].$error" ng-show="smsCannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsCannedAnswer" ng-click="vm.saveSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid || smsCannedAnswerForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsCannedAnswer" ng-click="vm.addNewSmsCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="smsCannedAnswerForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSCANNEDANSWER" translate-attr-aria-label="SMS.ADD_SMSCANNEDANSWER">\n ADD SMSCANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsCannedAnswer" ng-click="vm.deleteSmsCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/smsDispositions/dialog.html",'<md-dialog class="smsDisposition-dialog" aria-label="New SmsDisposition">\n <form name="smsDispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.smsDisposition.name" ng-required="true" autofocus>\n\n <div ng-messages="smsDispositionForm[\'name\'].$error" ng-show="smsDispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsDisposition" ng-click="vm.saveSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid || smsDispositionForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsDisposition" ng-click="vm.addNewSmsDisposition()" class="send-button md-accent md-raised" ng-disabled="smsDispositionForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSDISPOSITION" translate-attr-aria-label="SMS.ADD_SMSDISPOSITION">\n ADD SMSDISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsDisposition" ng-click="vm.deleteSmsDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsAccounts/edit/view.html",'<div id="sms-smsAccount" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsAccounts-button md-icon-button" aria-label="Go to smsAccounts" ng-click="vm.gotoSmsAccounts()" translate translate-attr-aria-label="SMS.GO_TO_SMSACCOUNTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsAccount-image" hide-xs>\n <img ng-src="assets/images/business/smsAccounts.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsAccount.id}}\n <span ng-if="vm.smsAccount.name">{{vm.smsAccount.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsAccount.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsAccount, $event)" class="md-fab md-warn md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSACCOUNT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsAccount()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (notificationForm.$invalid) || (transferForm.$invalid) || (proxyForm.$invalid) || (dispositionForm.$invalid) || (smsDispositionsForm.$invalid) || (smsCannedAnswersForm.$invalid) || (actionsForm.$invalid) || (interactionsForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsAccount.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.KEY">key</label>\n <input type="text" name="key" ng-model="vm.smsAccount.key" md-maxlength="5" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'key\'].$error" ng-show="generalForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.KEY_REQUIRED">key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 5}\'>key must have a maximum length equal to 5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.LIST">List</label>\n <md-select name="ListId" ng-model="vm.smsAccount.ListId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="ListId.id" ng-repeat="ListId in vm.lists" ng-disabled="ListId.canSelect === false">{{ ListId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.LIST"></span></div>\n <div ng-messages="generalForm[\'ListId\'].$error" ng-show="generalForm[\'ListId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.smsAccount.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'twilio\'">Twilio</md-option>\n <md-option ng-value="\'skebby\'">Skebby</md-option>\n <md-option ng-value="\'connectel\'">Connectel</md-option>\n <md-option ng-value="\'clicksend\'">ClickSend</md-option>\n <md-option ng-value="\'plivo\'">Plivo</md-option>\n <md-option ng-value="\'infobip\'">Infobip</md-option>\n <md-option ng-value="\'clickatell\'">Clickatell</md-option>\n <md-option ng-value="\'csc\'">CSCTelecom</md-option>\n <md-option ng-value="\'intelepeer\'">Intelepeer</md-option>\n </md-select>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.smsAccount.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'phone\'].$error" ng-show="generalForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\'" class="md-block">\n <label translate="SMS.ACCOUNTSID">AccountSID</label>\n <input type="text" name="accountSid" ng-model="vm.smsAccount.accountSid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'accountSid\'].$error" ng-show="generalForm[\'accountSid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.ACCOUNTSID_REQUIRED">AccountSID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHID">AuthID</label>\n <input type="text" name="authId" ng-model="vm.smsAccount.authId" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authId\'].$error" ng-show="generalForm[\'authId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHID_REQUIRED">AuthID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'twilio\' || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'plivo\'" class="md-block">\n <label translate="SMS.AUTHTOKEN">AuthToken</label>\n <input type="text" name="authToken" ng-model="vm.smsAccount.authToken" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'authToken\'].$error" ng-show="generalForm[\'authToken\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AUTHTOKEN_REQUIRED">AuthToken field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\'" class="md-block">\n <label translate="SMS.METHOD">Method</label>\n <md-select name="smsMethod" ng-model="vm.smsAccount.smsMethod" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SI\'">Basic</md-option>\n <md-option ng-value="\'TI\'">Classic</md-option>\n <md-option ng-value="\'GP\'">Classic+</md-option>\n </md-select>\n <div ng-messages="generalForm[\'smsMethod\'].$error" ng-show="generalForm[\'smsMethod\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.METHOD_REQUIRED">Method field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.USERNAME">Username</label>\n <input type="text" name="username" ng-model="vm.smsAccount.username" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'username\'].$error" ng-show="generalForm[\'username\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.smsAccount.type == \'skebby\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'infobip\'">\n <label translate="SMS.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.smsAccount.password" placeholder="Password" translate translate-attr-placeholder="SMS.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.smsAccount.type == \'infobip\'" class="md-block">\n <label translate="SMS.BASEURL">BaseURL</label>\n <input type="text" name="baseUrl" ng-model="vm.smsAccount.baseUrl" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'baseUrl\'].$error" ng-show="generalForm[\'baseUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.BASEURL_REQUIRED">BaseURL field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.APIKEY">ApiKey</label>\n <input type="text" name="apiKey" ng-model="vm.smsAccount.apiKey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'apiKey\'].$error" ng-show="generalForm[\'apiKey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.APIKEY_REQUIRED">ApiKey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'plivo\'|| vm.smsAccount.type == \'csc\'|| vm.smsAccount.type == \'infobip\' || vm.smsAccount.type == \'intelepeer\'" class="md-block">\n <label translate="SMS.SENDERSTRING">SenderString</label>\n <input type="text" name="senderString" ng-model="vm.smsAccount.senderString" md-maxlength="11" ng-pattern="/^[A-Za-z0-9\\.\\s]*$/i" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'senderString\'].$error" ng-show="generalForm[\'senderString\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.SENDERSTRING_REQUIRED">SenderString field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.SENDERSTRING_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\s]*$/i\' }">SenderString must be valid pattern </span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.SENDERSTRING_MAX_LENGTH" translate-values=\'{max: 11}\'>SenderString must have a maximum length equal to 11</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\'" class="md-block">\n <md-switch ng-model="vm.smsAccount.deliveryReport" aria-label="deliveryReport" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.DELIVERYREPORT">deliveryReport</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.WAITFORTHEASSIGNEDAGENT">WaitForTheAssignedAgent</label>\n <input type="number" name="waitForTheAssignedAgent" ng-model="vm.smsAccount.waitForTheAssignedAgent" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'waitForTheAssignedAgent\'].$error" ng-show="generalForm[\'waitForTheAssignedAgent\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_REQUIRED">WaitForTheAssignedAgent field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO">WaitForTheAssignedAgent must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsAccount.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.RECEIVEURL">receiveUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-receiveUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-receiveUrl" name="receiveUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/notify?token=\' + vm.smsAccount.token" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.RECEIVEURL"></span></div>\n </md-input-container>\n <md-input-container ng-if="( (vm.smsAccount.type == \'skebby\' && vm.smsAccount.smsMethod == \'GP\') || vm.smsAccount.type == \'connectel\' || vm.smsAccount.type == \'clicksend\' || vm.smsAccount.type == \'csc\' || vm.smsAccount.type == \'clickatell\') && vm.smsAccount.deliveryReport" class="md-block">\n <label translate="SMS.DELIVERYREPORTURL">deliveryReportUrl</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-deliveryReportUrl" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-deliveryReportUrl" name="deliveryReportUrl" ng-value="vm.smsAccount.remote + \'/api/sms/accounts/\' + vm.smsAccount.id + \'/status?token=\' + vm.smsAccount.token + (vm.smsAccount.type == \'csc\' ? \'&message-id={message-id}&state={state}\' : \'\')" ng-readonly="true">\n </div>\n <div class="hint"><span translate="SMS.HELP.DELIVERYREPORTURL"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container notification md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.NOTIFICATION">NOTIFICATION</div>\n </div>\n <form name="notificationForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationSound" aria-label="notificationSound" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSOUND">notificationSound</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.notificationShake" aria-label="notificationShake" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.NOTIFICATIONSHAKE">notificationShake</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="SMS.NOTIFICATIONTEMPLATE">notificationTemplate</label>\n <textarea aria-label="notificationTemplate notificationTemplate" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.smsAccount.notificationTemplate"></textarea>\n </div>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container transfer md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.TRANSFER">TRANSFER</div>\n </div>\n <form name="transferForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.queueTransfer" aria-label="queueTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.QUEUETRANSFER">queueTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.queueTransfer == true" class="md-block">\n <label translate="SMS.QUEUETRANSFERTIMEOUT">queueTransferTimeout</label>\n <input type="number" name="queueTransferTimeout" ng-model="vm.smsAccount.queueTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'queueTransferTimeout\'].$error" ng-show="transferForm[\'queueTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_REQUIRED">queueTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">queueTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.agentTransfer" aria-label="agentTransfer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.AGENTTRANSFER">agentTransfer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.agentTransfer == true" class="md-block">\n <label translate="SMS.AGENTTRANSFERTIMEOUT">agentTransferTimeout</label>\n <input type="number" name="agentTransferTimeout" ng-model="vm.smsAccount.agentTransferTimeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="transferForm[\'agentTransferTimeout\'].$error" ng-show="transferForm[\'agentTransferTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_REQUIRED">agentTransferTimeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">agentTransferTimeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container proxy md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.PROXY">PROXY</div>\n </div>\n <form name="proxyForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.TOKEN">token</label>\n <input type="text" name="token" ng-model="vm.smsAccount.token" autofocus disabled>\n\n <div ng-messages="proxyForm[\'token\'].$error" ng-show="proxyForm[\'token\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.TOKEN_REQUIRED">token field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.MOTIONPROXY">MotionProxy</label>\n <input type="url" name="remote" ng-model="vm.smsAccount.remote" md-maxlength="255" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="SMS.HELP.MOTIONPROXY"></span></div>\n <div ng-messages="proxyForm[\'remote\'].$error" ng-show="proxyForm[\'remote\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MOTIONPROXY_REQUIRED">MotionProxy field is required</span>\n </div>\n <div ng-message="url">\n <span translate="SMS.ERRORS.MOTIONPROXY_MUST_VALID_URL">MotionProxy must be a valid url http://www.xcally.com</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="SMS.ERRORS.MOTIONPROXY_MAX_LENGTH" translate-values=\'{max: 255}\'>MotionProxy must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="smsAccount-detail-form-container disposition md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.DISPOSITION">DISPOSITION</div>\n </div>\n <form name="dispositionForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.smsAccount.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="SMS.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.smsAccount.mandatoryDisposition" class="md-block">\n <label translate="SMS.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.smsAccount.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="SMS.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="dispositionForm[\'mandatoryDispositionPauseId\'].$error" ng-show="dispositionForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.DISPOSITIONS">DISPOSITIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smsdispositions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsDispositionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSDISPOSITIONS">SmsDispositions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event)" aria-label="add smsDisposition" translate translate-attr-label="SMS.ADD_SMSDISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsDispositions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsDispositions.length}} {{vm_dc.selectedSmsAccountSmsDispositions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsDispositions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsDispositions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsDispositions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsDispositions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsDisposition" md-select-id="id" ng-repeat="smsDisposition in vm_dc.smsAccountSmsDispositions.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.name}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" md-cell>{{smsDisposition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsDisposition($event, smsDisposition)" translate="SMS.EDIT_SMSDISPOSITION">\n Edit SmsDisposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsDisposition, $event)" translate="SMS.DELETE_SMSDISPOSITION">\n Delete SmsDisposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsDispositions.rows.length">\n <td md-cell colspan="5">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSDISPOSITION_AVAILABLE">No smsdisposition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsDispositions.count}}" md-on-paginate="vm_dc.getSmsAccountSmsDispositions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.CANNEDANSWERS">CANNEDANSWERS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container smscannedanswers md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountSmsCannedAnswersController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.SMSCANNEDANSWERS">SmsCannedAnswers</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event)" aria-label="add smsCannedAnswer" translate translate-attr-label="SMS.ADD_SMSCANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountSmsCannedAnswers.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountSmsCannedAnswers.length}} {{vm_dc.selectedSmsAccountSmsCannedAnswers.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountSmsCannedAnswers" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountSmsCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountSmsCannedAnswers" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountSmsCannedAnswers">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'SMS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="smsCannedAnswer" md-select-id="id" ng-repeat="smsCannedAnswer in vm_dc.smsAccountSmsCannedAnswers.rows">\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.id}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.key}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.value}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.description}}</td>\n <td ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" md-cell>{{smsCannedAnswer.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditSmsAccountSmsCannedAnswer($event, smsCannedAnswer)" translate="SMS.EDIT_SMSCANNEDANSWER">\n Edit SmsCannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(smsCannedAnswer, $event)" translate="SMS.DELETE_SMSCANNEDANSWER">\n Delete SmsCannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountSmsCannedAnswers.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="SMS.NO_SMSCANNEDANSWER_AVAILABLE">No smscannedanswer available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountSmsCannedAnswers.count}}" md-on-paginate="vm_dc.getSmsAccountSmsCannedAnswers" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountActionsController as vm_ac" ng-init="vm_ac.init(vm.smsAccount, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="SMS.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedSmsAccountApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedSmsAccountApps.length}} {{vm_ac.selectedSmsAccountApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedSmsAccountApps($event)" aria-label="delete selected" translate translate-attr-label="SMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedSmsAccountApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column width="10px">\n <span translate="VOICE.PRIORITY">Priority</span>\n </th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.smsAccountApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span>{{app.priority}}</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editSmsAccountApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editSmsAccountApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.smsAccountApps.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.INTERACTIONS">INTERACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsAccount-detail-form-container interactions md-background-bg md-whiteframe-1dp">\n <div ng-controller="SmsAccountInteractionsController as vm_dc" ng-init="vm_dc.init(vm.smsAccount, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="SMS.INTERACTIONS">Interactions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button class="md-icon-button" ng-click="vm_dc.getSmsAccountInteractions()" aria-label="refresh Interactions" translate translate-attr-label="SMS.REFRESH_INTERACTIONS">\n <md-icon md-font-icon="icon-refresh"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedSmsAccountInteractions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedSmsAccountInteractions.length}} {{vm_dc.selectedSmsAccountInteractions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedSmsAccountInteractions" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedSmsAccountInteractions($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedSmsAccountInteractions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getSmsAccountInteractions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'SMS.STARTEDAT\' | translate }}</th>\n <th md-column>{{ \'SMS.CONTACT\' | translate }}</th>\n <th md-column>{{ \'SMS.AGENT\' | translate }}</th>\n <th md-column md-order-by="closedAt">{{ \'SMS.CLOSEDAT\' | translate }}</th>\n <th md-column md-order-by="disposition">{{ \'SMS.DISPOSITION\' | translate }}</th>\n <th md-column md-order-by="note">{{ \'SMS.NOTES\' | translate }}</th>\n <th md-column md-order-by="tag">{{ \'SMS.TAGS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="interaction" md-select-id="id" ng-repeat="interaction in vm_dc.smsAccountInteractions.rows">\n <td md-cell>{{interaction.id}}</td>\n <td md-cell>{{interaction.createdAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.Contact.firstName}}</td>\n <td md-cell>{{interaction.Owner.name}}</td>\n <td md-cell>{{interaction.closedAt | date:\'medium\'}}</td>\n <td md-cell>{{interaction.disposition}}</td>\n <td md-cell>{{interaction.note}}</td>\n <td md-cell>\n <div ng-if="interaction.Tags.length">\n <md-tooltip md-direction="left" layout="row">\n <span ng-repeat="tag in interaction.Tags">{{tag.name}}<span ng-if="!$last">, </span></span>\n </md-tooltip>\n <md-icon md-font-icon="icon-tag"></md-icon>\n </div>\n </td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm_dc.spysmsInteraction($event, interaction)" translate="SMS.SPYINTERACTION">\n Spy Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.smsInteractionDownload(interaction, $event)" translate="SMS.DOWNLOAD_INTERACTION">\n Download Interaction\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interaction, $event)" translate="SMS.DELETE_INTERACTION">\n Delete Interaction\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.smsAccountInteractions.rows.length">\n <td md-cell colspan="13">\n <span class="text-boxed-ligth" translate="SMS.NO_INTERACTION_AVAILABLE">No interaction available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.smsAccountInteractions.count}}" md-on-paginate="vm_dc.getSmsAccountInteractions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsAccounts/smsAccounts.html",'<div id="smsAccounts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSACCOUNTS">SmsAccounts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsAccounts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsAccounts-count">\n <span>{{vm.selectedSmsAccounts.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSACCOUNTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsAccounts()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsAccounts()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsAccounts" csv-label="true" filename="smsAccounts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsAccounts($event)" aria-label="delete selected" translate translate-attr-label="SMSACCOUNTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SMSACCOUNT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsAccounts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsAccounts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'SMS.KEY\' | translate }}</th>\n <th md-column md-order-by="ListId">{{ \'SMS.LIST\' | translate }}</th>\n <th md-column md-order-by="type">{{ \'SMS.TYPE\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'SMS.PHONE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'SMS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsAccounts.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsAccount" md-select-id="id" ng-repeat="smsAccount in vm.smsAccounts.rows">\n <td md-cell ng-if="smsAccount.userpic"><img class="avatar" alt="{{smsAccount.name}}" ng-src="api/users/{{smsAccount.id}}/avatar" /></td>\n <td md-cell ng-if="!smsAccount.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsAccount.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="id ">{{smsAccount.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="name ">{{smsAccount.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="key ">{{smsAccount.key}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="ListId ">{{ (vm.lists | filter : {\'id\':smsAccount.ListId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="type ">{{ vm.arraytype[smsAccount.type].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="phone ">{{smsAccount.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsAccount, ev) : vm.createOrEditSmsAccount($event, smsAccount)" md-cell class="description ">{{smsAccount.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(smsAccount, $event)" translate="SMS.EDIT_SMSACCOUNT">\n Edit SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.interactionsgoto(smsAccount, $event)" translate="SMS.INTERACTIONS_SMSACCOUNT">\n Interactions SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsAccount, $event)" translate="SMS.AGENTADD_SMSACCOUNT">\n AgentAdd SmsAccount\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(smsAccount, $event)" translate="SMS.DELETE_SMSACCOUNT">\n Delete SmsAccount\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsAccounts.count}}" md-on-paginate="vm.getSmsAccounts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSACCOUNT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSACCOUNT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsAccount-button" ng-click="vm.createOrEditSmsAccount($event)" aria-label="add smsAccount" translate translate-attr-aria-label="SMS.ADD_SMSACCOUNT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSACCOUNT BUTTON --\x3e\n</div>'),e.put("app/main/apps/sms/views/smsQueues/create/dialog.html",'<md-dialog class="smsQueue-dialog" aria-label="New SmsQueue">\n <form name="smsQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newSmsQueue">\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="smsQueueForm[\'name\'].$error" ng-show="smsQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required>\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="smsQueueForm[\'strategy\'].$error" ng-show="smsQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true">\n\n <div ng-messages="smsQueueForm[\'timeout\'].$error" ng-show="smsQueueForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description">\n\n <div ng-messages="smsQueueForm[\'description\'].$error" ng-show="smsQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSmsQueue" ng-click="vm.saveSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid || smsQueueForm.$pristine" aria-label="SAVE" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSmsQueue" ng-click="vm.addNewSmsQueue()" class="send-button md-accent md-raised" ng-disabled="smsQueueForm.$invalid" aria-label="ADD" translate="SMS.ADD_SMSQUEUE" translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n ADD SMSQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSmsQueue" ng-click="vm.deleteSmsQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="SMS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="SMS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/agentadd/agentadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.AGENTADD_SMSQUEUE">Add Agent to smsQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/teamadd/teamadd.html",'<md-dialog class="smsQueue-dialog" aria-label="smsQueue" ng-init="vm.onInit()">\n <form name="smsQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="SMS.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/sms/views/smsQueues/edit/view.html",'<div id="sms-smsQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-smsQueues-button md-icon-button" aria-label="Go to smsQueues" ng-click="vm.gotoSmsQueues()" translate translate-attr-aria-label="SMS.GO_TO_SMSQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="smsQueue-image" hide-xs>\n <img ng-src="assets/images/business/smsQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.smsQueue.id}}\n <span ng-if="vm.smsQueue.name">{{vm.smsQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="SMS.CREATED_AT"></span> <span>{{vm.smsQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.smsQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="SMS.TEAMADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.smsQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="SMS.AGENTADD_SMSQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveSmsQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid)" translate="SMS.SAVE" translate-attr-aria-label="SMS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="SMS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="smsQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="SMS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="SMS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.smsQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="SMS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="SMS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.smsQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'beepall\'">Beepall</md-option>\n <md-option ng-value="\'rrmemory\'">RR Memory</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.AGENT_TIMEOUT">Agent_Timeout</label>\n <input type="number" name="timeout" ng-model="vm.smsQueue.timeout" min="1" max="2147483" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_REQUIRED">Agent_Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>1</span>\n </div>\n <div ng-message="max">\n <span translate="SMS.ERRORS.AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO">Agent_Timeout must be a valid greater or equal than</span> <span>2147483</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="SMS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.smsQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="SMS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/sms/views/smsQueues/smsQueues.html",'<div id="smsQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-message-text" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="SMS.SMSQUEUES">SmsQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="SMS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSmsQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSmsQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="SMS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-smsQueues-count">\n <span>{{vm.selectedSmsQueues.length}}</span>\n <span translate="SMS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SMSQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSmsQueues()" translate="SMS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSmsQueues()" translate="SMS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSmsQueues" csv-label="true" filename="smsQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSmsQueues($event)" aria-label="delete selected" translate translate-attr-label="SMSQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SMSQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSmsQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSmsQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'SMS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'SMS.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'SMS.STRATEGY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.smsQueues.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="SMS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="smsQueue" md-select-id="id" ng-repeat="smsQueue in vm.smsQueues.rows">\n <td md-cell ng-if="smsQueue.userpic"><img class="avatar" alt="{{smsQueue.name}}" ng-src="api/users/{{smsQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!smsQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{smsQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="id ">{{smsQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="name ">{{smsQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(smsQueue, ev) : vm.createOrEditSmsQueue($event, smsQueue)" md-cell class="strategy ">{{ vm.arraystrategy[smsQueue.strategy].option }}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="SMS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(smsQueue, $event)" translate="SMS.EDIT_SMSQUEUE">\n Edit SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(smsQueue, $event)" translate="SMS.TEAMADD_SMSQUEUE">\n teamadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(smsQueue, $event)" translate="SMS.AGENTADD_SMSQUEUE">\n agentadd SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(smsQueue, $event)" translate="SMS.DELETE_SMSQUEUE">\n Delete SmsQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(smsQueue, $event)" translate="SMS.GOTOREALTIME_SMSQUEUE">\n goToRealtime SmsQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'SMS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'SMS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'SMS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.smsQueues.count}}" md-on-paginate="vm.getSmsQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SMSQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SMSQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-smsQueue-button" ng-click="vm.createOrEditSmsQueue($event)" aria-label="add smsQueue" translate translate-attr-aria-label="SMS.ADD_SMSQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SMSQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/agents.html",'<div id="agents" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.AGENTS">Agents</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedAgents.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedAgents =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-agents-count">\n <span>{{vm.selectedAgents.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="AGENTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllAgents()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectAgents()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedAgents" csv-label="true" filename="agents.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedAgents($event)" aria-label="delete selected" translate translate-attr-label="AGENTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- AGENT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedAgents" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getAgents">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="showWebBar">{{ \'STAFF.SHOWWEBCONTROL\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.agents.rows.length">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="agent" md-select-id="id" ng-repeat="agent in vm.agents.rows">\n <td md-cell ng-if="agent.userpic"><img class="avatar" alt="{{agent.name}}" ng-src="api/users/{{agent.id}}/avatar" /></td>\n <td md-cell ng-if="!agent.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{agent.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="fullname font-weight-600">{{agent.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="name ">{{agent.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="showWebBar ">{{ vm.arrayshowWebBar[agent.showWebBar].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="email ">{{agent.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="phone ">{{agent.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="mobile ">{{agent.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(agent, ev) : vm.createOrEditAgent($event, agent)" md-cell class="internal ">{{agent.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(agent, $event)" translate="STAFF.EDIT_AGENT">\n Edit Agent\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(agent, $event)" translate="STAFF.TEAMADD_AGENT">\n teamadd Agent\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(agent, $event)" translate="STAFF.DELETE_AGENT">\n Delete Agent\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.agents.count}}" md-on-paginate="vm.getAgents" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / AGENT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD AGENT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-agent-button" ng-click="vm.createOrEditAgent($event)" aria-label="add agent" translate translate-attr-aria-label="STAFF.ADD_AGENT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD AGENT BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/agents/create/dialog.html",'<md-dialog class="agent-dialog" aria-label="New Agent">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus>\n\n <div ng-messages="agentForm[\'fullname\'].$error" ng-show="agentForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="agentForm[\'name\'].$error" ng-show="agentForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias">\n\n <div ng-messages="agentForm[\'alias\'].$error" ng-show="agentForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="agentForm[\'showWebBar\'].$error" ng-show="agentForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true">\n\n <div ng-messages="agentForm[\'email\'].$error" ng-show="agentForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newAgent">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.agent.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="agentForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newAgent && (vm.newAgent)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" ng-disabled="!vm.newAgent">\n\n <div ng-messages="agentForm[\'internal\'].$error" ng-show="agentForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description">\n\n <div ng-messages="agentForm[\'description\'].$error" ng-show="agentForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newAgent" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true">\n\n <div ng-messages="agentForm[\'phoneBarRemoteControlPort\'].$error" ng-show="agentForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.agent.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAgent" ng-click="vm.saveAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAgent" ng-click="vm.addNewAgent()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid" aria-label="ADD" translate="STAFF.ADD_AGENT" translate-attr-aria-label="STAFF.ADD_AGENT">\n ADD AGENT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAgent" ng-click="vm.deleteAgent($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/changepassword/changepassword.html",'<md-dialog class="agent-dialog" aria-label="{{vm.name}}">\n <form name="agentForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.agent.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="agentForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="agentForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="agentForm.$invalid || agentForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/queueadd/queueadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin" ng-if="vm.agent.role === \'agent\' && vm.channel === \'voice\'">\n <label translate="STAFF.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="agentForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveQueues()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/teamadd/teamadd.html",'<md-dialog class="agent-dialog" aria-label="agent" ng-init="vm.onInit()">\n <form name="agentForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/agents/edit/view.html",'<div id="staff-agent" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-agents-button md-icon-button" aria-label="Go to agents" ng-click="vm.gotoAgents()" translate translate-attr-aria-label="STAFF.GO_TO_AGENTS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="agent-image" hide-xs>\n <img ng-src="assets/images/business/agents.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.agent.id}}\n <span ng-if="vm.agent.name">{{vm.agent.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.agent.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div ng-cloak>\n <md-fab-speed-dial md-direction="left" class="md-scale md-fab">\n <md-fab-trigger>\n <md-button aria-label="menu" class="md-fab md-primary md-icon-button">\n <md-tooltip md-direction="top" md-visible="false"><span translate="STAFF.CHANNELS">Channels</span></md-tooltip>\n <md-icon md-font-icon="icon-stackoverflow" aria-label="queueadd"></md-icon>\n </md-button>\n </md-fab-trigger>\n <md-fab-actions>\n <md-button aria-label="voice" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'inbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="VOICE.VOICE">Voice</span></md-tooltip>\n <md-icon md-font-icon="icon-phone" aria-label="voice"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.dialer" aria-label="motion bull" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'voice\', $event, \'outbound\')">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MOTIONDIALER.MOTIONDIALER">Motion Bull</span></md-tooltip>\n <md-icon md-font-icon="icon-fire" aria-label="motion bull"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.chat" aria-label="chat" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'chat\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="CHAT.CHAT">Chat</span></md-tooltip>\n <md-icon md-font-icon="icon-hangouts" aria-label="chat"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.mail" aria-label="mail" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'mail\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="MAIL.MAIL">Email</span></md-tooltip>\n <md-icon md-font-icon="icon-email" aria-label="mail"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.messaging" aria-label="sms" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'sms\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="SMS.SMS">Sms</span></md-tooltip>\n <md-icon md-font-icon="icon-message-text" aria-label="sms"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.openchannel" aria-label="openchannel" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'openchannel\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="OPENCHANNEL.OPENCHANNEL">Openchannel</span></md-tooltip>\n <md-icon md-font-icon="icon-google-earth" aria-label="openchannel"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.fax" aria-label="fax" class="md-fab md-raised md-icon-button md-mini" ng-click="vm.queueaddchannel(vm.agent, \'fax\', $event)">\n <md-tooltip md-direction="bottom" md-visible="false"><span translate="FAX.FAX">Fax</span></md-tooltip>\n <md-icon md-font-icon="icon-deskphone" aria-label="fax"></md-icon>\n </md-button>\n </md-fab-actions>\n </md-fab-speed-dial>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.agent, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="STAFF.TEAMADD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.agent, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_AGENT"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveAgent()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid) || (capacityForm.$invalid) || (settingsForm.$invalid) || (remote_controlForm.$invalid) || (sipForm.$invalid) || (callforwardingForm.$invalid) || (settings_webrtcForm.$invalid) || (sip_webrtcForm.$invalid) || (general_permissionsForm.$invalid) || (permissionsForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.agent.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.agent.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALIAS">Alias</label>\n <input type="text" name="alias" ng-model="vm.agent.alias" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'alias\'].$error" ng-show="personal_infoForm[\'alias\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALIAS_REQUIRED">Alias field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SHOWWEBCONTROL">ShowWebControl</label>\n <md-select name="showWebBar" ng-model="vm.agent.showWebBar" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="0">Phonebar</md-option>\n <md-option ng-value="1">External</md-option>\n <md-option ng-value="2">WebRTC</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'showWebBar\'].$error" ng-show="personal_infoForm[\'showWebBar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SHOWWEBCONTROL_REQUIRED">ShowWebControl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.agent.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.agent.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.agent.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 1" class="md-block">\n <md-switch ng-model="vm.agent.hotdesk" aria-label="Hotdesk" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.HOTDESK">Hotdesk</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.loginInPause" aria-label="LoginInPause" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.LOGININPAUSE">LoginInPause</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.agent.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.agent.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" autofocus disabled>\n\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.agent.passwordResetAt" disabled>\n\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Agentchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="agent-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.agent.images" ng-switch="change_avatarimage.type">\n <div class="agent-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="agent-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.agent.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.agent.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar != 2" class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.agent.transport" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'" ng-if="vm.agent.showWebBar == 1">ws</md-option>\n <md-option ng-value="\'wss\'" ng-if="vm.agent.showWebBar == 1">wss</md-option>\n <md-option ng-value="\'tls\'" ng-if="vm.agent.showWebBar == 1">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.HOST">Host</label>\n <input type="text" name="host" ng-model="vm.agent.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.HOST_REQUIRED">Host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.agent.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TYPE">Type</label>\n <md-select name="type" ng-model="vm.agent.type" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.agent.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.agent.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.agent.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.agent.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.agent.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.chanspy" aria-label="chanSpy" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.CHANSPY">chanSpy</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.agent.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MONITOREXTENSION">MonitorExtension</label>\n <md-select name="extensionMonitor" ng-model="vm.agent.extensionMonitor" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div ng-messages="generalForm[\'extensionMonitor\'].$error" ng-show="generalForm[\'extensionMonitor\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MONITOREXTENSION_REQUIRED">MonitorExtension field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.OTHER_CHANNELS">OTHER_CHANNELS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container capacity md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CAPACITY">CAPACITY</div>\n </div>\n <form name="capacityForm" novalidate>\n <md-input-container ng-if="vm.license.chat" class="md-block">\n <label translate="STAFF.CHATCAPACITY">ChatCapacity</label>\n <input type="number" name="chatCapacity" ng-model="vm.agent.chatCapacity" min="0" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CHATCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'chatCapacity\'].$error" ng-show="capacityForm[\'chatCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CHATCAPACITY_REQUIRED">ChatCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">ChatCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.mail" class="md-block">\n <label translate="STAFF.MAILCAPACITY">MailCapacity</label>\n <input type="number" name="mailCapacity" ng-model="vm.agent.mailCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.MAILCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'mailCapacity\'].$error" ng-show="capacityForm[\'mailCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MAILCAPACITY_REQUIRED">MailCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MailCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.fax" class="md-block">\n <label translate="STAFF.FAXCAPACITY">FaxCapacity</label>\n <input type="number" name="faxCapacity" ng-model="vm.agent.faxCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.FAXCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'faxCapacity\'].$error" ng-show="capacityForm[\'faxCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FAXCAPACITY_REQUIRED">FaxCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FaxCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.messaging" class="md-block">\n <label translate="STAFF.SMSCAPACITY">SMSCapacity</label>\n <input type="number" name="smsCapacity" ng-model="vm.agent.smsCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SMSCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'smsCapacity\'].$error" ng-show="capacityForm[\'smsCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SMSCAPACITY_REQUIRED">SMSCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.SMSCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">SMSCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.license.openchannel" class="md-block">\n <label translate="STAFF.OPENCHANNELCAPACITY">OpenchannelCapacity</label>\n <input type="number" name="openchannelCapacity" ng-model="vm.agent.openchannelCapacity" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.OPENCHANNELCAPACITY"></span></div>\n <div ng-messages="capacityForm[\'openchannelCapacity\'].$error" ng-show="capacityForm[\'openchannelCapacity\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_REQUIRED">OpenchannelCapacity field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">OpenchannelCapacity must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 0">\n <md-tab-label>\n <span translate="STAFF.MOTIONBAR">MOTIONBAR</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="settingsForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settingsForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRingInUse" aria-label="RingInUse" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.RINGINUSE">RingInUse</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarDnd" aria-label="Dnd" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.DND">Dnd</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnansweredCallBadge" aria-label="UnansweredCallBadge" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNANSWEREDCALLBADGE">UnansweredCallBadge</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableJaws" aria-label="EnableJawsIntegration" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEJAWSINTEGRATION">EnableJawsIntegration</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableVideoRecording" aria-label="EnableVideoRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEVIDEORECORDING">EnableVideoRecording</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container remote_control md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.REMOTE_CONTROL">REMOTE_CONTROL</div>\n </div>\n <form name="remote_controlForm" novalidate>\n <md-input-container ng-if="vm.agent.showWebBar == 0" class="md-block">\n <md-switch ng-model="vm.agent.phoneBarRemoteControl" aria-label="RemoteControl" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.REMOTECONTROL">RemoteControl</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarRemoteControl && vm.agent.showWebBar == 0" class="md-block">\n <label translate="STAFF.REMOTECONTROLPORT">RemoteControlPort</label>\n <input type="number" name="phoneBarRemoteControlPort" ng-model="vm.agent.phoneBarRemoteControlPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="remote_controlForm[\'phoneBarRemoteControlPort\'].$error" ng-show="remote_controlForm[\'phoneBarRemoteControlPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.REMOTECONTROLPORT_REQUIRED">RemoteControlPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP">SIP</div>\n </div>\n <form name="sipForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sipForm[\'phoneBarExpires\'].$error" ng-show="sipForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPPORT">SipPort</label>\n <input type="number" name="phoneBarListenPort" ng-model="vm.agent.phoneBarListenPort" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPPORT"></span></div>\n <div ng-messages="sipForm[\'phoneBarListenPort\'].$error" ng-show="sipForm[\'phoneBarListenPort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPPORT_REQUIRED">SipPort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container callforwarding md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CALLFORWARDING">CALLFORWARDING</div>\n </div>\n <form name="callforwardingForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarUnconditional" aria-label="Unconditional" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.UNCONDITIONAL">Unconditional</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarUnconditional" class="md-block">\n <label translate="STAFF.UNCONDITIONALNUMBER">UnconditionalNumber</label>\n <input type="text" name="phoneBarUnconditionalNumber" ng-model="vm.agent.phoneBarUnconditionalNumber" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="callforwardingForm[\'phoneBarUnconditionalNumber\'].$error" ng-show="callforwardingForm[\'phoneBarUnconditionalNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.UNCONDITIONALNUMBER_REQUIRED">UnconditionalNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.agent.showWebBar == 2">\n <md-tab-label>\n <span translate="STAFF.WEBRTC">WEBRTC</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container settings_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SETTINGS_WEBRTC">SETTINGS_WEBRTC</div>\n </div>\n <form name="settings_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSCERTFILE">dtlscertfile</label>\n <input type="text" name="dtlscertfile" ng-model="vm.agent.dtlscertfile" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.DTLSCERTFILE"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlscertfile\'].$error" ng-show="settings_webrtcForm[\'dtlscertfile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSCERTFILE_REQUIRED">dtlscertfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DTLSPRIVATEKEY">dtlsprivatekey</label>\n <input type="text" name="dtlsprivatekey" ng-model="vm.agent.dtlsprivatekey" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.DTLSPRIVATEKEY"></span></div>\n <div ng-messages="settings_webrtcForm[\'dtlsprivatekey\'].$error" ng-show="settings_webrtcForm[\'dtlsprivatekey\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DTLSPRIVATEKEY_REQUIRED">dtlsprivatekey field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableSettings" aria-label="EnableSettings" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLESETTINGS">EnableSettings</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarAutoAnswer" aria-label="AutoAnswer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.AUTOANSWER">AutoAnswer</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.agent.phoneBarAutoAnswer" class="md-block">\n <label translate="STAFF.AUTOANSWERDELAY">AutoAnswerDelay</label>\n <input type="number" name="phoneBarAutoAnswerDelay" ng-model="vm.agent.phoneBarAutoAnswerDelay" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$error" ng-show="settings_webrtcForm[\'phoneBarAutoAnswerDelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_REQUIRED">AutoAnswerDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="STAFF.ERRORS.AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AutoAnswerDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableRecording" aria-label="EnableRecording" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLERECORDING">EnableRecording</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarEnableDtmfTone" aria-label="EnableDtmfTone" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEDTMFTONE">EnableDtmfTone</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container sip_webrtc md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SIP_WEBRTC">SIP_WEBRTC</div>\n </div>\n <form name="sip_webrtcForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.SIPEXPIRES">SipExpires</label>\n <input type="number" name="phoneBarExpires" ng-model="vm.agent.phoneBarExpires" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.SIPEXPIRES"></span></div>\n <div ng-messages="sip_webrtcForm[\'phoneBarExpires\'].$error" ng-show="sip_webrtcForm[\'phoneBarExpires\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.SIPEXPIRES_REQUIRED">SipExpires field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="agent-detail-form-container general_permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL_PERMISSIONS">GENERAL_PERMISSIONS</div>\n </div>\n <form name="general_permissionsForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.allowmessenger" aria-label="EnableMessenger" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.ENABLEMESSENGER">EnableMessenger</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.agent.phoneBarPrefixRequired" aria-label="PrefixRequired" ng-disabled="!vm.crudPermissions.canEdit"><span translate="STAFF.PREFIXREQUIRED">PrefixRequired</span></md-switch>\n </md-input-container>\n\n </form>\n </div>\n <div class="agent-detail-form-container permissions md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERMISSIONS">PERMISSIONS</div>\n </div>\n <div ng-controller="AgentPermissionsController as vm_pc" ng-init="vm_pc.init(vm.agent, vm.crudPermissions)" class="agent-detail-form-container">\n <md-list ng-repeat="father in vm_pc.navigation[0].children" ng-include="\'permission-nested.html\'" ng-if="vm_pc.agent.role !== \'admin\' && !father.hidden()"></md-list>\n\n \x3c!-- Nested navigation template --\x3e\n <script type="text/ng-template" id="permission-nested.html">\n <md-list-item>\n <md-icon md-font-icon="{{father.icon}}"></md-icon>\n <p translate="{{father.translate}}">{{ father.title }}</p>\n <md-switch class="md-secondary" ng-model="father.enabled" ng-change="vm_pc.onChange(father)" ng-init="father.enabled = vm_pc.agent.permissions.includes(father.id)" \n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n\n <md-divider></md-divider>\n\n <md-list>\n <md-list-item ng-repeat="child in father.children" ng-if="child.id !== 201">\n <md-icon ng-if="child.icon" md-font-icon="{{child.icon}}"></md-icon>\n <p translate="{{child.translate}}">{{ child.title }}</p>\n <md-switch ng-model="child.enabled" ng-change="vm_pc.onChange(father, child)" ng-init="child.enabled = vm_pc.agent.permissions.includes(child.id)"\n ng-disabled="!vm_pc.crudPermissions.canEdit"></md-switch>\n </md-list-item>\n </md-list>\n <\/script>\n \x3c!-- / Nested navigation template --\x3e\n\n <span ng-if="vm_pc.agent.role === \'admin\'" class="md-headline" translate="STAFF.ALL_MODULES_AVAILABLE">All modules are already available.</span>\n\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/teams/create/dialog.html",'<md-dialog class="team-dialog" aria-label="New Team">\n <form name="teamForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.team.name" ng-required="true" autofocus>\n\n <div ng-messages="teamForm[\'name\'].$error" ng-show="teamForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.team.description">\n\n <div ng-messages="teamForm[\'description\'].$error" ng-show="teamForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTeam" ng-click="vm.saveTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid || teamForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTeam" ng-click="vm.addNewTeam()" class="send-button md-accent md-raised" ng-disabled="teamForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TEAM" translate-attr-aria-label="STAFF.ADD_TEAM">\n ADD TEAM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTeam" ng-click="vm.deleteTeam($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/edit/agentadd/agentadd.html",'<md-dialog class="team-dialog" aria-label="team" ng-init="vm.onInit()">\n <form name="teamForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="STAFF.AGENTADD_TEAM">Add Agent to team</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/teams/teams.html",'<div id="teams" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TEAMS">Teams</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTeams.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTeams =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-teams-count">\n <span>{{vm.selectedTeams.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEAMS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTeams()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTeams()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTeams" csv-label="true" filename="teams.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTeams($event)" aria-label="delete selected" translate translate-attr-label="TEAMS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TEAM TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTeams" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTeams">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.teams.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="team" md-select-id="id" ng-repeat="team in vm.teams.rows">\n <td md-cell ng-if="team.userpic"><img class="avatar" alt="{{team.name}}" ng-src="api/users/{{team.id}}/avatar" /></td>\n <td md-cell ng-if="!team.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{team.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="id ">{{team.id}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="name ">{{team.name}}</td>\n <td ng-click="vm.createOrEditTeam($event, team)" md-cell class="description ">{{team.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(team, $event)" translate="STAFF.EDIT_TEAM">\n Edit Team\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(team, $event)" translate="STAFF.AGENTADD_TEAM">\n AgentAdd Team\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(team, $event)" translate="STAFF.DELETE_TEAM">\n Delete Team\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.teams.count}}" md-on-paginate="vm.getTeams" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEAM TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEAM BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-team-button" ng-click="vm.createOrEditTeam($event)" aria-label="add team" translate translate-attr-aria-label="STAFF.ADD_TEAM">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEAM BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/telephones/create/dialog.html",'<md-dialog class="telephone-dialog" aria-label="New Telephone">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus>\n\n <div ng-messages="telephoneForm[\'fullname\'].$error" ng-show="telephoneForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="telephoneForm[\'name\'].$error" ng-show="telephoneForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true">\n\n <div ng-messages="telephoneForm[\'email\'].$error" ng-show="telephoneForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newTelephone">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.telephone.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="telephoneForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newTelephone && (vm.newTelephone)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description">\n\n <div ng-messages="telephoneForm[\'description\'].$error" ng-show="telephoneForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" ng-disabled="!vm.newTelephone">\n\n <div ng-messages="telephoneForm[\'internal\'].$error" ng-show="telephoneForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newTelephone" class="md-block">\n <md-switch ng-model="vm.telephone.voicemail" aria-label="Voicemail"><span translate="STAFF.VOICEMAIL">Voicemail</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTelephone" ng-click="vm.saveTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTelephone" ng-click="vm.addNewTelephone()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid" aria-label="ADD" translate="STAFF.ADD_TELEPHONE" translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n ADD TELEPHONE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTelephone" ng-click="vm.deleteTelephone($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/changepassword/changepassword.html",'<md-dialog class="telephone-dialog" aria-label="{{vm.name}}">\n <form name="telephoneForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.telephone.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="telephoneForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="telephoneForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="telephoneForm.$invalid || telephoneForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/telephones/edit/view.html",'<div id="staff-telephone" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-telephones-button md-icon-button" aria-label="Go to telephones" ng-click="vm.gotoTelephones()" translate translate-attr-aria-label="STAFF.GO_TO_TELEPHONES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="telephone-image" hide-xs>\n <img ng-src="assets/images/business/telephones.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.telephone.id}}\n <span ng-if="vm.telephone.name">{{vm.telephone.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.telephone.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.telephone, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_TELEPHONE"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTelephone()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(accountForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container account md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.ACCOUNT">ACCOUNT</div>\n </div>\n <form name="accountForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ACCOUNTNAME">Accountname</label>\n <input type="text" name="fullname" ng-model="vm.telephone.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'fullname\'].$error" ng-show="accountForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ACCOUNTNAME_REQUIRED">Accountname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.telephone.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="accountForm[\'name\'].$error" ng-show="accountForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.telephone.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'email\'].$error" ng-show="accountForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.telephone.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'description\'].$error" ng-show="accountForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.telephone.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'phone\'].$error" ng-show="accountForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.telephone.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="accountForm[\'mobile\'].$error" ng-show="accountForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="telephone-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.telephone.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.telephone.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.telephone.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.TRANSPORT"></span></div>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.telephone.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.telephone.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLERID">CallerId</label>\n <input type="text" name="callerid" ng-model="vm.telephone.callerid" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLERID_REQUIRED">CallerId field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.telephone.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.telephone.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.telephone.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.telephone.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ENCRYPTION">Encryption</label>\n <md-select name="encryption" ng-model="vm.telephone.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ENCRYPTION"></span></div>\n <div ng-messages="generalForm[\'encryption\'].$error" ng-show="generalForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ENCRYPTION_REQUIRED">Encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/telephones/telephones.html",'<div id="telephones" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.TELEPHONES">Telephones</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTelephones.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTelephones =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-telephones-count">\n <span>{{vm.selectedTelephones.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TELEPHONES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTelephones()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTelephones()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTelephones" csv-label="true" filename="telephones.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTelephones($event)" aria-label="delete selected" translate translate-attr-label="TELEPHONES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TELEPHONE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTelephones" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="fullname">{{ \'STAFF.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="telephone in vm.telephones.rows">\n <td md-cell ng-if="telephone.userpic"><img class="avatar" alt="{{telephone.name}}" ng-src="api/users/{{telephone.id}}/avatar" /></td>\n <td md-cell ng-if="!telephone.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{telephone.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="fullname font-weight-600">{{telephone.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="name ">{{telephone.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="email ">{{telephone.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(telephone, ev) : vm.createOrEditTelephone($event, telephone)" md-cell class="internal ">{{telephone.internal}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(telephone, $event)" translate="STAFF.EDIT_TELEPHONE">\n Edit Telephone\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(telephone, $event)" translate="STAFF.DELETE_TELEPHONE">\n Delete Telephone\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.telephones.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TELEPHONE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TELEPHONE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-telephone-button" ng-click="vm.createOrEditTelephone($event)" aria-label="add telephone" translate translate-attr-aria-label="STAFF.ADD_TELEPHONE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TELEPHONE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/userProfiles/create/dialog.html",'<md-dialog class="userProfile-dialog" aria-label="New UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUserProfile" ng-click="vm.saveUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid || userProfileForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUserProfile" ng-click="vm.addNewUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USERPROFILE" translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n ADD USERPROFILE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUserProfile" ng-click="vm.deleteUserProfile($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/clone/clone.html",'<md-dialog class="userProfile-dialog" aria-label="Clone UserProfile">\n <form name="userProfileForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus ng-disabled="!vm.newUserProfile">\n\n <div ng-messages="userProfileForm[\'name\'].$error" ng-show="userProfileForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description">\n\n <div ng-messages="userProfileForm[\'description\'].$error" ng-show="userProfileForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required>\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="userProfileForm[\'crudPermissions\'].$error" ng-show="userProfileForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneUserProfile()" class="send-button md-accent md-raised" ng-disabled="userProfileForm.$invalid" aria-label="CLONE" translate="STAFF.CLONE_USERPROFILE" translate-attr-aria-label="STAFF.CLONE_USERPROFILE">\n CLONE USERPROFILE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/permissionsmanage/permissionsmanage.html",'<md-dialog class="userProfile-dialog" aria-label="userProfile">\n <form name="userProfileForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>{{vm.title}}</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog($event)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <div layout="column" class="padding-bottom-10">\n <div layout="row" class="padding-bottom-10">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.SECTIONS">Sections</label>\n <md-select name="sections" ng-model="vm.selectedSection" placeholder="{{\'STAFF.PERMISSIONS_SELECT_SECTION\' | translate}}" ng-change="vm.onChangeSection()" required>\n <md-option ng-value="subsection" ng-repeat="subsection in vm.subsections" ng-selected="{{vm.subsections.length === 1 ? \'true\' : \'false\'}}">{{subsection.translate | translate}}</md-option>\n </md-select>\n </md-input-container>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10">\n <md-button ng-switch="vm.selectedSection.enabled" class="md-icon-button md-fab md-mini size-8 padding-10" ng-class="vm.selectedSection.enabled ? \'blue-500-bg\' : \'grey-A400-bg\'" ng-click="vm.onChangeVisibility()" aria-label="Visibility">\n <md-icon ng-switch-when="true" md-font-icon="icon-eye" aria-label="Visible section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_HIDE\' | translate}}</md-tooltip>\n </md-icon>\n <md-icon ng-switch-when="false" md-font-icon="icon-eye-off" aria-label="Hidden section">\n <md-tooltip>{{\'STAFF.PERMISSIONS_SECTION_SHOW\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <div>\n <md-button class="md-icon-button md-fab md-mini size-8 green-A700-bg no-margin" ng-disabled="true">\n <md-icon md-font-icon="icon-monitor" class="md-background-fg" aria-label="Read permission">\n <md-tooltip>{{\'STAFF.READ_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowEdit ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'edit\')">\n <md-icon md-font-icon="icon-pencil" aria-label="Edit permission">\n <md-tooltip>{{\'STAFF.EDIT_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n <md-button class="md-icon-button md-fab md-mini size-8 no-margin" ng-class="vm.selectedSection.allowDelete ? \'green-A700-bg\' : \'grey-A400-bg\'" ng-click="vm.setPermission(\'delete\')">\n <md-icon md-font-icon="icon-delete" aria-label="Delete permission">\n <md-tooltip>{{\'STAFF.DELETE_PERMISSION\' | translate}}</md-tooltip>\n </md-icon>\n </md-button>\n </div>\n </div>\n </div>\n <div layout="row" ng-show="vm.selectedSection" class="margin-left-10" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-switch ng-model="vm.selectedSection.autoAssociation" class="no-margin padding-right-10" aria-label="Auto association" ng-change="vm.onChangeAutoAssociation()">\n </md-switch>\n <p class="no-margin font-size-12 line-height-30">{{\'STAFF.PERMISSIONS_AUTO_ASSOCIATION_INFO\' | translate}}</p>\n </div>\n <div layout="row" ng-show="vm.selectedSection && vm.selectedSection.title === \'Reports\' && !vm.selectedSection.autoAssociation" class="margin-bottom-10 margin-top-30" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association">\n <md-input-container flex class="no-margin">\n <label translate="STAFF.REPORT_TYPE">Report Type</label>\n <md-select name="type" ng-model="vm.selectedSection.reportType" placeholder="{{\'STAFF.PERMISSIONS_SELECT_REPORT_TYPE\' | translate}}" ng-change="vm.onChangeReportType()" required>\n <md-option ng-value="\'default\'">Default</md-option>\n <md-option ng-value="\'custom\'">Custom</md-option>\n </md-select>\n </md-input-container>\n </div>\n <div ng-show="vm.selectedSection && vm.selectedSection.title === \'Dashboards\'" class="user-profile-section-help margin-bottom-10 margin-top-20">\n <md-icon md-font-icon="icon-help" aria-label="Dashboards help"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.CUSTOM_DASHBOARDS_PERMISSIONS"></span>\n </div>\n </div>\n <ms-dual-multiselect options="vm.dualMultiselectOptions" ng-if="!vm.selectedSection.permissions || vm.selectedSection.permissions.association" ng-hide="vm.selectedSection.autoAssociation"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center">\n <div>\n <md-icon md-font-icon="icon-information-outline" aria-label="Delete permission"></md-icon>\n <span class="no-margin font-size-12 line-height-30" translate="STAFF.HELP.SAVE_PERMISSIONS"></span>\n </div>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveSection()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/userProfiles/edit/view.html",'<div id="staff-userProfile" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-userProfiles-button md-icon-button" aria-label="Go to userProfiles" ng-click="vm.gotoUserProfiles()" translate translate-attr-aria-label="STAFF.GO_TO_USERPROFILES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="userProfile-image" hide-xs>\n <img ng-src="assets/images/business/userProfiles.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.userProfile.id}}\n <span ng-if="vm.userProfile.name">{{vm.userProfile.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.userProfile.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.userProfile, $event)" class="md-fab md-amber-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="STAFF.CLONE_USERPROFILE"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUserProfile()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (modulesForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.userProfile.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.userProfile.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CRUDPERMISSIONS">CrudPermissions</label>\n <md-select name="crudPermissions" ng-model="vm.userProfile.crudPermissions" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'r\'" disabled> {{ \'STAFF.READ_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'e\'"> {{ \'STAFF.EDIT_PERMISSION\' | translate }} </md-option>\n\n <md-option ng-value="\'d\'"> {{ \'STAFF.DELETE_PERMISSION\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'crudPermissions\'].$error" ng-show="generalForm[\'crudPermissions\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CRUDPERMISSIONS_REQUIRED">CrudPermissions field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.PERMISSIONS">PERMISSIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="userProfile-detail-form-container modules md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.MODULES">MODULES</div>\n </div>\n <div ng-controller="UserProfilePermissionsController as vm_pc" ng-init="vm_pc.init(vm.userProfile, vm.license)" class="userProfile-detail-form-container">\n <md-grid-list flex md-cols-gt-xs="2" md-cols-gt-sm="2" md-cols-gt-md="4" md-cols-gt-lg="6" md-row-height-gt-xs="2:1" md-row-height-gt-sm="2:1" md-row-height-gt-md="3:1" gt-xs-gutter="4px" gt-sm-gutter="8px" gt-md-gutter="8px" gt-lg-gutter="16px">\n <md-grid-tile ng-repeat="father in vm_pc.modules" ng-if="vm_pc.userProfile.role !== \'admin\' && !father.permissions.hidden" md-colspan="2">\n <md-card flex-xs flex-gt-xs="90" layout="column" no-padding no-margin>\n <md-card-header>\n <md-card-avatar>\n <md-icon class="md-avatar-icon auto-size" md-font-icon="{{father.icon}}" ng-class="{ true: father.status.color }[true]">\n </md-icon>\n <md-tooltip>{{ father.status.info }}</md-tooltip>\n </md-icon>\n </md-card-avatar>\n <md-card-header-text layout-align="center start">\n <span class="md-title" translate="{{father.translate}}">{{ father.title }}</span>\n </md-card-header-text>\n <md-card-actions class="no-margin" layout="row" ng-init="vm_pc.checkSectionResources(father)" ng-if="father.status.tag != \'unlicensed\'">\n <md-switch class="auto-height no-margin" ng-model="father.allResourcesEnabled" ng-change="vm_pc.onChangeEnableAllResources(father)" aria-label="Enable all"></md-switch>\n <md-button class="md-mini auto-width" aria-label="Manage" ng-click="vm_pc.manageResources(father)" ng-hide="father.permissions && !father.permissions.association">\n <md-tooltip>{{\'STAFF.PERMISSIONS_MANAGE\' | translate}}\n </md-tooltip>\n <md-icon md-font-icon="icon-cog"></md-icon>\n </md-button>\n </md-card-actions>\n <md-card-header-text ng-if="father.status.tag === \'unlicensed\'" layout-align="center end">\n <span class="md-subhead red-A700-fg">{{ father.status.name }}</span>\n </md-card-header-text>\n </md-card-header>\n </md-card>\n </md-grid-tile>\n </md-grid-list>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/userProfiles/userProfiles.html",'<div id="userProfiles" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERPROFILES">UserProfiles</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUserProfiles.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUserProfiles =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-userProfiles-count">\n <span>{{vm.selectedUserProfiles.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERPROFILES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUserProfiles()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUserProfiles()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUserProfiles" csv-label="true" filename="userProfiles.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedUserProfiles($event)" aria-label="delete selected" translate translate-attr-label="USERPROFILES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- USERPROFILE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUserProfiles" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUserProfiles">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'STAFF.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'STAFF.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="crudPermissions">{{ \'STAFF.CRUDPERMISSIONS\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.userProfiles.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="userProfile" md-select-id="id" ng-repeat="userProfile in vm.userProfiles.rows">\n <td md-cell ng-if="userProfile.userpic"><img class="avatar" alt="{{userProfile.name}}" ng-src="api/users/{{userProfile.id}}/avatar" /></td>\n <td md-cell ng-if="!userProfile.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{userProfile.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="id ">{{userProfile.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="name ">{{userProfile.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="description ">{{userProfile.description}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(userProfile, ev) : vm.createOrEditUserProfile($event, userProfile)" md-cell class="crudPermissions ">{{userProfile.selectedcrudPermissions}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(userProfile, $event)" translate="STAFF.EDIT_USERPROFILE">\n Edit UserProfile\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(userProfile, $event)" translate="STAFF.CLONE_USERPROFILE">\n clone UserProfile\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(userProfile, $event)" translate="STAFF.DELETE_USERPROFILE">\n Delete UserProfile\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.userProfiles.count}}" md-on-paginate="vm.getUserProfiles" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USERPROFILE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USERPROFILE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-userProfile-button" ng-click="vm.createOrEditUserProfile($event)" aria-label="add userProfile" translate translate-attr-aria-label="STAFF.ADD_USERPROFILE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USERPROFILE BUTTON --\x3e\n</div>'),e.put("app/main/apps/staff/views/users/create/dialog.html",'<md-dialog class="user-dialog" aria-label="New User">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required ng-disabled="!vm.newUser">\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="userForm[\'role\'].$error" ng-show="userForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required>\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="userForm[\'userProfileId\'].$error" ng-show="userForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true">\n\n <div ng-messages="userForm[\'fullname\'].$error" ng-show="userForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" ng-disabled="!vm.newUser">\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="userForm[\'name\'].$error" ng-show="userForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true">\n\n <div ng-messages="userForm[\'email\'].$error" ng-show="userForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.newUser">\n <label translate="STAFF.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.user.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="STAFF.PASSWORD" required>\n <div ng-messages="userForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newUser && (vm.newUser)">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description">\n\n <div ng-messages="userForm[\'description\'].$error" ng-show="userForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.newUser" class="md-block">\n <md-switch ng-model="vm.user.autointernal" aria-label="AutoInternal"><span translate="STAFF.AUTOINTERNAL">AutoInternal</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" ng-disabled="!vm.newUser">\n\n <div ng-messages="userForm[\'internal\'].$error" ng-show="userForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newUser" ng-click="vm.saveUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newUser" ng-click="vm.addNewUser()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid" aria-label="ADD" translate="STAFF.ADD_USER" translate-attr-aria-label="STAFF.ADD_USER">\n ADD USER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newUser" ng-click="vm.deleteUser($event)" aria-label="DELETE" translate translate-attr-aria-label="STAFF.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="STAFF.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/apikeymanager/apikeymanager.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.MANAGE_API_KEY\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.generateApiKey()" class="send-button md-accent md-raised" aria-label="Generate" translate="STAFF.GENERATE" translate-attr-aria-label="STAFF.GENERATE">\n Generate\n </md-button>\n <md-button type="submit" ng-click="vm.removeApiKey()" class="send-button md-accent md-raised" aria-label="Remove" translate="STAFF.REMOVE" translate-attr-aria-label="STAFF.DELETE">\n Delete\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="userForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ \'\n STAFF.CHANGE_PASSWORD\' | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block" ng-if="vm.currentUser.id == vm.user.id">\n <label translate="STAFF.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="STAFF.OLD_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" translate ng-pattern="vm.passwordPattern" translate-attr-placeholder="STAFF.NEW_PASSWORD" required>\n <div ng-messages="userForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PASSWORD_REQUIRED">Password field is\n required</span>\n </div>\n\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.SECURE_PASSWORD_PATTERN">Must contain\n at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric\n character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="userForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONFIRM_REQUIRED">Confirm field is\n required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="STAFF.ERRORS.CONFIRM_NOT_MATCH">Your password did\n not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="userForm.$invalid || userForm.$pristine" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/staff/views/users/edit/view.html",'<div id="staff-user" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-users-button md-icon-button" aria-label="Go to users" ng-click="vm.gotoUsers()" translate translate-attr-aria-label="STAFF.GO_TO_USERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="user-image" hide-xs>\n <img ng-src="assets/images/business/users.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.user.id}}\n <span ng-if="vm.user.name">{{vm.user.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="STAFF.CREATED_AT"></span> <span>{{vm.user.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.apikeymanagerdialog(vm.user, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="apikeymanager">\n <md-tooltip><span translate="STAFF.APIKEYMANAGER_USER"></span></md-tooltip>\n <md-icon md-font-icon="fab fa-hubspot"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.changepassworddialog(vm.user, $event)" class="md-fab md-warn md-icon-button" aria-label="changepassword">\n <md-tooltip><span translate="STAFF.CHANGEPASSWORD_USER"></span></md-tooltip>\n <md-icon md-font-icon="icon-key-variant"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveUser()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(personal_infoForm.$invalid) || (security_suiteForm.$invalid) || (change_avatarForm.$invalid) || (generalForm.$invalid)" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.ACCOUNT">ACCOUNT</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container personal_info md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.PERSONAL_INFO">PERSONAL_INFO</div>\n </div>\n <form name="personal_infoForm" novalidate>\n <md-input-container class="md-block">\n <label translate="STAFF.ROLE">Role</label>\n <md-select name="role" ng-model="vm.user.role" autofocus required disabled>\n <md-option ng-value="\'admin\'">Admin</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'role\'].$error" ng-show="personal_infoForm[\'role\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ROLE_REQUIRED">Role field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.role === \'user\'" class="md-block">\n <label translate="STAFF.USERPROFILE">UserProfile</label>\n <md-select name="userProfileId" ng-model="vm.user.userProfileId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="userProfileId.id" ng-repeat="userProfileId in vm.userProfiles" ng-disabled="userProfileId.canSelect === false">{{ userProfileId.name }}</md-option>\n </md-select>\n <div ng-messages="personal_infoForm[\'userProfileId\'].$error" ng-show="personal_infoForm[\'userProfileId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERPROFILE_REQUIRED">UserProfile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.FULLNAME">Fullname</label>\n <input type="text" name="fullname" ng-model="vm.user.fullname" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'fullname\'].$error" ng-show="personal_infoForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.FULLNAME_REQUIRED">Fullname field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.USERNAME">Username</label>\n <input type="text" name="name" ng-model="vm.user.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" disabled>\n\n <div class="hint"><span translate="STAFF.HELP.USERNAME"></span></div>\n <div ng-messages="personal_infoForm[\'name\'].$error" ng-show="personal_infoForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.USERNAME_REQUIRED">Username field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="STAFF.ERRORS.USERNAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Username must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.user.email" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'email\'].$error" ng-show="personal_infoForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="STAFF.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.user.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'phone\'].$error" ng-show="personal_infoForm[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.MOBILE">Mobile</label>\n <input type="text" name="mobile" ng-model="vm.user.mobile" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'mobile\'].$error" ng-show="personal_infoForm[\'mobile\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.MOBILE_REQUIRED">Mobile field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.user.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="personal_infoForm[\'description\'].$error" ng-show="personal_infoForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container security_suite md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.SECURITY_SUITE">SECURITY_SUITE</div>\n </div>\n <form name="security_suiteForm" novalidate>\n <md-input-container ng-if="vm.user.passwordResetAt != null" class="md-block">\n <label translate="STAFF.LAST_PASSWORD_RESET_AT">Last_Password_Reset_At</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" autofocus disabled>\n\n <div class="hint"><span translate="STAFF.HELP.LAST_PASSWORD_RESET_AT"></span></div>\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.LAST_PASSWORD_RESET_AT_REQUIRED">Last_Password_Reset_At field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.user.passwordResetAt == null" class="md-block">\n <label translate="STAFF.NO_PASSWORD_CHANGE">No_Password_Change</label>\n <input type="text" name="passwordResetAt" ng-model="vm.user.passwordResetAt" disabled>\n\n <div ng-messages="security_suiteForm[\'passwordResetAt\'].$error" ng-show="security_suiteForm[\'passwordResetAt\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NO_PASSWORD_CHANGE_REQUIRED">No_Password_Change field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n\n </form>\n </div>\n <div class="user-detail-form-container change_avatar md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.CHANGE_AVATAR">CHANGE_AVATAR</div>\n </div>\n <div ng-controller="Userchange_avatarController as vm_ca" ng-init="vm_ca.init(vm.user, vm.crudPermissions)" class="user-detail-form-container md-background-bg md-whiteframe-1dp">\n\n <div id="user-image-uploader" flow-init="vm_ca.ngFlowOptions" flow-name="vm_ca.ngFlow.flow" flow-files-submitted="vm_ca.upload()" flow-file-added="vm_ca.fileAdded($file)" flow-file-success="vm_ca.fileSuccess($file, $message)" flow-complete="vm_ca.uploadComplete()" flow-drop flow-drag-enter="vm_ca.dropping=true" flow-drag-leave="vm_ca.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="EC.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn ng-disabled="!vm_ca.crudPermissions.canEdit">\n Upload\n </md-button>\n <span class="secondary-text mt-8">You can also drop images here to upload. Only PNG, JPG - Max. 8MB</span>\n </div>\n\n <div layout="row" layout-align="start start" layout-wrap>\n <div ng-repeat="change_avatarimage in vm_ca.user.images" ng-switch="change_avatarimage.type">\n <div class="user-image uploading" ng-switch-when="uploading" layout="row" layout-align="center center">\n <div class="overlay" layout="column" layout-align="center center">\n <md-progress-linear md-mode="determinate" value="{{change_avatarimage.file.progress() * 100}}">\n </md-progress-linear>\n </div>\n <img class="media" flow-img="change_avatarimage.file">\n </div>\n\n <div class="user-image" ng-switch-when="image" layout="row" layout-align="center center">\n <img class="media" ng-src="{{change_avatarimage.url}}">\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="STAFF.VOICE">VOICE</span>\n </md-tab-label>\n <md-tab-body>\n <div class="user-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="STAFF.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container ng-if="!vm.user.autointernal" class="md-block">\n <label translate="STAFF.INTERNAL">Internal</label>\n <input type="text" name="internal" ng-model="vm.user.internal" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'internal\'].$error" ng-show="generalForm[\'internal\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.INTERNAL_REQUIRED">Internal field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.user.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div ng-messages="generalForm[\'transport\'].$error" ng-show="generalForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.NAT">NAT</label>\n <md-select name="nat" ng-model="vm.user.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.NAT_REQUIRED">NAT field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.user.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="STAFF.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.user.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.CALLGROUP">Callgroup</label>\n <input type="text" name="callgroup" ng-model="vm.user.callgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.CALLGROUP"></span></div>\n <div ng-messages="generalForm[\'callgroup\'].$error" ng-show="generalForm[\'callgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.CALLGROUP_REQUIRED">Callgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.PICKUPGROUP">Pickupgroup</label>\n <input type="text" name="pickupgroup" ng-model="vm.user.pickupgroup" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="STAFF.HELP.PICKUPGROUP"></span></div>\n <div ng-messages="generalForm[\'pickupgroup\'].$error" ng-show="generalForm[\'pickupgroup\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.PICKUPGROUP_REQUIRED">Pickupgroup field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.APIKEY">ApiKey</label>\n <div layout="row" layout-align="center center">\n <button class="md-button md-fab md-mini md-primary" ngclipboard data-clipboard-target="#copytoclipboard-apiKey" ngclipboard-success="vm.alert({title: \'copied to clipboard\', msg: e.text});" ngclipboard-error="vm.alert({title: \'error\', msg: \'copy to clipboard failed\'});">\n <md-icon md-font-icon="icon-clipboard-text"></md-icon>\n </button>\n <input class="md-input" type="text" id="copytoclipboard-apiKey" name="apiKey" ng-model="vm.user.apiKey" ng-readonly="true">\n </div>\n <div class="hint"><span translate="STAFF.HELP.APIKEY"></span></div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="STAFF.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.user.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="generalForm[\'videosupport\'].$error" ng-show="generalForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="STAFF.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/staff/views/users/users.html",'<div id="users" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-account-multiple" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="STAFF.USERS">Users</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="STAFF.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedUsers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedUsers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="STAFF.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-users-count">\n <span>{{vm.selectedUsers.length}}</span>\n <span translate="STAFF.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="USERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllUsers()" translate="STAFF.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectUsers()" translate="STAFF.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedUsers" csv-label="true" filename="users.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- USER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedUsers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getUsers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="role">{{ \'STAFF.ROLE\' | translate }}</th>\n <th md-column md-order-by="userProfileId">{{ \'STAFF.USERPROFILE\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'STAFF.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'STAFF.USERNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'STAFF.EMAIL\' | translate }}</th>\n <th md-column md-order-by="phone">{{ \'STAFF.PHONE\' | translate }}</th>\n <th md-column md-order-by="mobile">{{ \'STAFF.MOBILE\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'STAFF.INTERNAL\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.users.rows.length">\n <td md-cell colspan="9">\n <div layout="row" layout-align="center center">\n <span translate="STAFF.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="user" md-select-id="id" ng-repeat="user in vm.users.rows">\n <td md-cell ng-if="user.userpic"><img class="avatar" alt="{{user.name}}" ng-src="api/users/{{user.id}}/avatar" /></td>\n <td md-cell ng-if="!user.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{user.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="role ">{{ vm.arrayrole[user.role].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="userProfileId font-weight-600">{{ (vm.userProfiles | filter : {\'id\':user.userProfileId})[0].name }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="fullname font-weight-600">{{user.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="name ">{{user.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="email ">{{user.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="phone ">{{user.phone}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="mobile ">{{user.mobile}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(user, ev) : vm.createOrEditUser($event, user)" md-cell class="internal ">{{user.internal}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(user, $event)" translate="STAFF.EDIT_USER">\n Edit User\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deleteconfirm(user, $event)" translate="STAFF.DELETE_USER">\n Delete User\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'STAFF.PAGE\' | translate}}:\', rowsPerPage: \'{{\'STAFF.ROWSPERPAGE\' | translate}}:\', of: \'{{\'STAFF.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.users.count}}" md-on-paginate="vm.getUsers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / USER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD USER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-user-button" ng-click="vm.createOrEditUser($event)" aria-label="add user" translate translate-attr-aria-label="STAFF.ADD_USER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD USER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/cannedAnswers.html",'<div id="cannedAnswers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CANNEDANSWERS">CannedAnswers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCannedAnswers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCannedAnswers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-cannedAnswers-count">\n <span>{{vm.selectedCannedAnswers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CANNEDANSWERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCannedAnswers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCannedAnswers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCannedAnswers" csv-label="true" filename="cannedAnswers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCannedAnswers($event)" aria-label="delete selected" translate translate-attr-label="CANNEDANSWERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CANNEDANSWER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCannedAnswers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCannedAnswers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="key">{{ \'TOOLS.KEY\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.cannedAnswers.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="cannedAnswer" md-select-id="id" ng-repeat="cannedAnswer in vm.cannedAnswers.rows">\n <td md-cell ng-if="cannedAnswer.userpic"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="api/users/{{cannedAnswer.id}}/avatar" /></td>\n <td md-cell ng-if="!cannedAnswer.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{cannedAnswer.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="id ">{{cannedAnswer.id}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="key ">{{cannedAnswer.key}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="value ">{{cannedAnswer.value}}</td>\n <td ng-click="vm.createOrEditCannedAnswer($event, cannedAnswer)" md-cell class="description ">{{cannedAnswer.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(cannedAnswer, $event)" translate="TOOLS.EDIT_CANNEDANSWER">\n Edit CannedAnswer\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(cannedAnswer, $event)" translate="TOOLS.DELETE_CANNEDANSWER">\n Delete CannedAnswer\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.cannedAnswers.count}}" md-on-paginate="vm.getCannedAnswers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CANNEDANSWER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CANNEDANSWER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-cannedAnswer-button" ng-click="vm.createOrEditCannedAnswer($event)" aria-label="add cannedAnswer" translate translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CANNEDANSWER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/cannedAnswers/create/dialog.html",'<md-dialog class="cannedAnswer-dialog" aria-label="New CannedAnswer">\n <form name="cannedAnswerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.KEY">Key</label>\n <input type="text" name="key" ng-model="vm.cannedAnswer.key" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="cannedAnswerForm[\'key\'].$error" ng-show="cannedAnswerForm[\'key\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.KEY_REQUIRED">Key field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.KEY_MAX_LENGTH" translate-values=\'{max: 255}\'>Key must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <textarea name="value" ng-model="vm.cannedAnswer.value" required></textarea>\n\n <div ng-messages="cannedAnswerForm[\'value\'].$error" ng-show="cannedAnswerForm[\'value\'].$touched" role="alert">\n\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n\n\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.cannedAnswer.description">\n\n <div ng-messages="cannedAnswerForm[\'description\'].$error" ng-show="cannedAnswerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCannedAnswer" ng-click="vm.saveCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid || cannedAnswerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCannedAnswer" ng-click="vm.addNewCannedAnswer()" class="send-button md-accent md-raised" ng-disabled="cannedAnswerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CANNEDANSWER" translate-attr-aria-label="TOOLS.ADD_CANNEDANSWER">\n ADD CANNEDANSWER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCannedAnswer" ng-click="vm.deleteCannedAnswer($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/create/dialog.html",'<md-dialog class="customDashboard-dialog" aria-label="New CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description">\n\n <div ng-messages="customDashboardForm[\'description\'].$error" ng-show="customDashboardForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newCustomDashboard" ng-click="vm.saveCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid || customDashboardForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newCustomDashboard" ng-click="vm.addNewCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n ADD CUSTOMDASHBOARD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newCustomDashboard" ng-click="vm.deleteCustomDashboard($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/customDashboards.html",'<div id="customDashboards" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.CUSTOMDASHBOARDS">CustomDashboards</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedCustomDashboards.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedCustomDashboards =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-customDashboards-count">\n <span>{{vm.selectedCustomDashboards.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CUSTOMDASHBOARDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllCustomDashboards()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectCustomDashboards()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedCustomDashboards" csv-label="true" filename="customDashboards.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedCustomDashboards($event)" aria-label="delete selected" translate translate-attr-label="CUSTOMDASHBOARDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CUSTOMDASHBOARD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedCustomDashboards" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getCustomDashboards">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.customDashboards.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="customDashboard" md-select-id="id" ng-repeat="customDashboard in vm.customDashboards.rows">\n <td md-cell ng-if="customDashboard.userpic"><img class="avatar" alt="{{customDashboard.name}}" ng-src="api/users/{{customDashboard.id}}/avatar" /></td>\n <td md-cell ng-if="!customDashboard.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{customDashboard.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="id ">{{customDashboard.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="name ">{{customDashboard.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(customDashboard, ev) : vm.createOrEditCustomDashboard($event, customDashboard)" md-cell class="description ">{{customDashboard.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(customDashboard, $event)" translate="TOOLS.EDIT_CUSTOMDASHBOARD">\n Edit CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(customDashboard, $event)" translate="TOOLS.CLONE_CUSTOMDASHBOARD">\n clone CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotodashboardgoto(customDashboard, $event)" translate="TOOLS.GOTODASHBOARD_CUSTOMDASHBOARD">\n goToDashboard CustomDashboard\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(customDashboard, $event)" translate="TOOLS.DELETE_CUSTOMDASHBOARD">\n Delete CustomDashboard\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.customDashboards.count}}" md-on-paginate="vm.getCustomDashboards" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CUSTOMDASHBOARD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CUSTOMDASHBOARD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-customDashboard-button" ng-click="vm.createOrEditCustomDashboard($event)" aria-label="add customDashboard" translate translate-attr-aria-label="TOOLS.ADD_CUSTOMDASHBOARD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CUSTOMDASHBOARD BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/customDashboards/edit/clone/clone.html",'<md-dialog class="customDashboard-dialog" aria-label="Clone CustomDashboard">\n <form name="customDashboardForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus>\n\n <div ng-messages="customDashboardForm[\'name\'].$error" ng-show="customDashboardForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneCustomDashboard()" class="send-button md-accent md-raised" ng-disabled="customDashboardForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_CUSTOMDASHBOARD" translate-attr-aria-label="TOOLS.CLONE_CUSTOMDASHBOARD">\n CLONE CUSTOMDASHBOARD\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/dashboard/dialog.html",'<md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">\n <form name="dashboarditemForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.dashboarditem.type" autofocus ng-disabled="!vm.newDashboardItem">\n\n <md-option ng-value="\'counter\'"> {{ \'TOOLS.COUNTER\' | translate }} </md-option>\n\n <md-option ng-value="\'multibar-chart\'"> {{ \'TOOLS.MULTIBARCHART\' | translate }} </md-option>\n\n <md-option ng-value="\'pie-chart\'"> {{ \'TOOLS.PIECHART\' | translate }} </md-option>\n\n <md-option ng-value="\'web-report\'"> {{ \'TOOLS.WEBREPORT\' | translate }} </md-option>\n\n <md-option ng-value="\'iframe\'"> {{ \'TOOLS.IFRAME\' | translate }} </md-option>\n\n <md-option ng-value="\'clock\'"> {{ \'TOOLS.CLOCK\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'TOOLS.CUSTOMTYPE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'type\'].$error" ng-show="dashboarditemForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TITLE">Title</label>\n <input type="text" name="title" ng-model="vm.dashboarditem.title" md-maxlength="255" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'title\'].$error" ng-show="dashboarditemForm[\'title\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TITLE_REQUIRED">Title field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.TITLE_MAX_LENGTH" translate-values=\'{max: 255}\'>Title must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'iframe\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="attrUrl" ng-model="vm.dashboarditem.attrUrl" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrUrl\'].$error" ng-show="dashboarditemForm[\'attrUrl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'custom\'" class="md-block">\n <label translate="TOOLS.PATH">Path</label>\n <input type="text" name="attrPath" ng-model="vm.dashboarditem.attrPath" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrPath\'].$error" ng-show="dashboarditemForm[\'attrPath\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PATH_REQUIRED">Path field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.FORMAT">Format</label>\n <input type="text" name="attrHourFormat" ng-model="vm.dashboarditem.attrHourFormat" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrHourFormat\'].$error" ng-show="dashboarditemForm[\'attrHourFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FORMAT_REQUIRED">Format field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'clock\'" class="md-block">\n <label translate="TOOLS.TIMEZONE">Timezone</label>\n <md-select name="attrTimezone" ng-model="vm.dashboarditem.attrTimezone" required>\n <md-option ng-value="\'-12.00\'">GMT-12.00</md-option>\n <md-option ng-value="\'-11.00\'">GMT-11.00</md-option>\n <md-option ng-value="\'-10.00\'">GMT-10.00</md-option>\n <md-option ng-value="\'-9.00\'">GMT-9.00</md-option>\n <md-option ng-value="\'-8.00\'">GMT-8.00</md-option>\n <md-option ng-value="\'-7.00\'">GMT-7.00</md-option>\n <md-option ng-value="\'-6.00\'">GMT-6.00</md-option>\n <md-option ng-value="\'-5.00\'">GMT-5.00</md-option>\n <md-option ng-value="\'-4.00\'">GMT-4.00</md-option>\n <md-option ng-value="\'-3.30\'">GMT-3.30</md-option>\n <md-option ng-value="\'-3.00\'">GMT-3.00</md-option>\n <md-option ng-value="\'-2.00\'">GMT-2.00</md-option>\n <md-option ng-value="\'-1.00\'">GMT-1.00</md-option>\n <md-option ng-value="\'0.00\'">GMT 0.00</md-option>\n <md-option ng-value="\'1.00\'">GMT+1.00</md-option>\n <md-option ng-value="\'2.00\'">GMT+2.00</md-option>\n <md-option ng-value="\'3.00\'">GMT+3.00</md-option>\n <md-option ng-value="\'3.30\'">GMT+3.30</md-option>\n <md-option ng-value="\'4.00\'">GMT+4.00</md-option>\n <md-option ng-value="\'4.30\'">GMT+4.30</md-option>\n <md-option ng-value="\'5.00\'">GMT+5.00</md-option>\n <md-option ng-value="\'5.30\'">GMT+5.30</md-option>\n <md-option ng-value="\'5.45\'">GMT+5.45</md-option>\n <md-option ng-value="\'6.00\'">GMT+6.00</md-option>\n <md-option ng-value="\'6.30\'">GMT+6.30</md-option>\n <md-option ng-value="\'7.00\'">GMT+7.00</md-option>\n <md-option ng-value="\'8.00\'">GMT+8.00</md-option>\n <md-option ng-value="\'9.00\'">GMT+9.00</md-option>\n <md-option ng-value="\'9.30\'">GMT+9.30</md-option>\n <md-option ng-value="\'10.00\'">GMT+10.00</md-option>\n <md-option ng-value="\'11.00\'">GMT+11.00</md-option>\n <md-option ng-value="\'12.00\'">GMT+12.00</md-option>\n <md-option ng-value="\'13.00\'">GMT+13.00</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrTimezone\'].$error" ng-show="dashboarditemForm[\'attrTimezone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED">Timezone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'counter\'" class="md-block">\n <label translate="TOOLS.METRIC">Metric</label>\n <md-select name="attrMetric" ng-model="vm.dashboarditem.attrMetric" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrMetric\'].$error" ng-show="dashboarditemForm[\'attrMetric\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.METRIC_REQUIRED">Metric field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE1">Serie1</label>\n <md-select name="attrSerie1" ng-model="vm.dashboarditem.attrSerie1" required>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie1\'].$error" ng-show="dashboarditemForm[\'attrSerie1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE1_REQUIRED">Serie1 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE2">Serie2</label>\n <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie2\'].$error" ng-show="dashboarditemForm[\'attrSerie2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE2_REQUIRED">Serie2 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.SERIE3">Serie3</label>\n <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">\n\n <md-option ng-value="\'null\'"> {{ \'TOOLS.NONE\' | translate }} </md-option>\n\n <md-option ng-value="\'total\'"> {{ \'TOOLS.TOTAL\' | translate }} </md-option>\n\n <md-option ng-value="\'abandoned\'"> {{ \'TOOLS.ABANDONED\' | translate }} </md-option>\n\n <md-option ng-value="\'waiting\'"> {{ \'TOOLS.WAITING\' | translate }} </md-option>\n\n <md-option ng-value="\'talking\'"> {{ \'TOOLS.TALKING\' | translate }} </md-option>\n\n <md-option ng-value="\'answered\'"> {{ \'TOOLS.ANSWERED\' | translate }} </md-option>\n\n <md-option ng-value="\'unmanaged\'"> {{ \'TOOLS.UNMANAGED\' | translate }} </md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrSerie3\'].$error" ng-show="dashboarditemForm[\'attrSerie3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SERIE3_REQUIRED">Serie3 field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.dashboarditem.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="dashboarditemForm[\'report\'].$error" ng-show="dashboarditemForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.dashboarditem.type == \'web-report\'" class="md-block">\n <label translate="TOOLS.REFRESH">Refresh</label>\n <input type="number" name="attrRefresh" ng-model="vm.dashboarditem.attrRefresh" min="5" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrRefresh\'].$error" ng-show="dashboarditemForm[\'attrRefresh\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REFRESH_REQUIRED">Refresh field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Refresh must be a valid greater or equal than</span> <span>5</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'multibar-chart\', \'pie-chart\', \'counter\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>\n <md-select name="attrVoiceQueues" ng-model="vm.dashboarditem.attrVoiceQueues" multiple>\n <md-option ng-value="attrVoiceQueues.id" ng-repeat="attrVoiceQueues in vm.voiceQueues" ng-disabled="attrVoiceQueues.canSelect === false">{{ attrVoiceQueues.name }}</md-option>\n </md-select>\n <div ng-messages="dashboarditemForm[\'attrVoiceQueues\'].$error" ng-show="dashboarditemForm[\'attrVoiceQueues\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED">FilterVoiceQueues field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="[\'counter\', \'clock\'].includes(vm.dashboarditem.type)" class="md-block">\n <label translate="TOOLS.FONTSIZE">FontSize</label>\n <input type="number" name="attrFontSize" ng-model="vm.dashboarditem.attrFontSize" min="12" max="40" ng-required="true">\n\n <div ng-messages="dashboarditemForm[\'attrFontSize\'].$error" ng-show="dashboarditemForm[\'attrFontSize\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED">FontSize field is required</span>\n </div>\n <div ng-message="min">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>12</span>\n </div>\n <div ng-message="max">\n <span translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO">FontSize must be a valid greater or equal than</span> <span>40</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.dashboarditem.foreground" label="{{\'TOOLS.FOREGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <div flex md-color-picker ng-model="vm.dashboarditem.background" label="{{\'TOOLS.BACKGROUND\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LINK">link</label>\n <input type="url" name="link" ng-model="vm.dashboarditem.link">\n\n <div ng-messages="dashboarditemForm[\'link\'].$error" ng-show="dashboarditemForm[\'link\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LINK_REQUIRED">link field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL">link must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem" ng-click="vm.saveDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem" ng-click="vm.addNewDashboardItem()" class="send-button md-accent md-raised" ng-disabled="dashboarditemForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DASHBOARDITEM" translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM">\n ADD DASHBOARDITEM\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem" ng-click="vm.deleteDashboardItem($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/customDashboards/edit/view.html",'<div id="tools-customDashboard" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-customDashboards-button md-icon-button" aria-label="Go to customDashboards" ng-click="vm.gotoCustomDashboards()" translate translate-attr-aria-label="TOOLS.GO_TO_CUSTOMDASHBOARDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="customDashboard-image" hide-xs>\n <img ng-src="assets/images/business/customDashboards.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.customDashboard.id}}\n <span ng-if="vm.customDashboard.name">{{vm.customDashboard.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.customDashboard.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.customDashboard, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.customDashboard, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_CUSTOMDASHBOARD"></span></md-tooltip>\n <md-icon md-font-icon="icon-forward"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveCustomDashboard()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (dashboardForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.customDashboard.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.customDashboard.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.DASHBOARD">DASHBOARD</span>\n </md-tab-label>\n <md-tab-body>\n <div class="customDashboard-detail-form-container dashboard md-background-bg md-whiteframe-1dp">\n <div ng-controller="CustomDashboardItemsController as vm_cd" ng-init="vm_cd.init(vm.customDashboard, vm.crudPermissions)" class="customDashboard-detail-form-container no-padding no-margin" layout="column">\n <div ng-if="vm_cd.customDashboard.widgets.length">\n <md-button class="md-fab md-mini md-accent" ng-click="vm_cd.createOrEditWidget()" ng-if="vm_cd.crudPermissions.canEdit" aria-label="add item">\n <md-tooltip>{{ \'TOOLS.ADD_WIDGET\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n <md-content flex>\n <ms-widget-engine config="vm_cd.customDashboard" on-edit="vm_cd.createOrEditWidget(widget)" on-delete="vm_cd.deleteWidget(widget)"></ms-widget-engine>\n </md-content>\n </div>\n <div ng-if="!vm_cd.customDashboard.widgets.length" layout="row" layout-align="center center" flex>\n <md-button class="width-130 height-130 md-accent md-raised" ng-click="vm_cd.createOrEditWidget()" aria-label="add item" layout="column">\n <md-icon md-font-icon="icon-plus-circle" class="s50"></md-icon>\n <span layout-wrap translate="TOOLS.ADD_WIDGET"></span>\n </md-button>\n </div>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/customDashboards/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/create/dialog.html",'<md-dialog class="disposition-dialog" aria-label="New Disposition">\n <form name="dispositionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.disposition.name" md-maxlength="255" ng-required="true" autofocus>\n\n <div ng-messages="dispositionForm[\'name\'].$error" ng-show="dispositionForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="md-maxlength">\n <span translate="TOOLS.ERRORS.NAME_MAX_LENGTH" translate-values=\'{max: 255}\'>Name must have a maximum length equal to 255</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newDisposition" ng-click="vm.saveDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid || dispositionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newDisposition" ng-click="vm.addNewDisposition()" class="send-button md-accent md-raised" ng-disabled="dispositionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_DISPOSITION" translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n ADD DISPOSITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newDisposition" ng-click="vm.deleteDisposition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/dispositions/dispositions.html",'<div id="dispositions" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.DISPOSITIONS">Dispositions</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedDispositions.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedDispositions =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-dispositions-count">\n <span>{{vm.selectedDispositions.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="DISPOSITIONS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllDispositions()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectDispositions()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedDispositions" csv-label="true" filename="dispositions.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedDispositions($event)" aria-label="delete selected" translate translate-attr-label="DISPOSITIONS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- DISPOSITION TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedDispositions" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getDispositions">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.dispositions.rows.length">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="disposition" md-select-id="id" ng-repeat="disposition in vm.dispositions.rows">\n <td md-cell ng-if="disposition.userpic"><img class="avatar" alt="{{disposition.name}}" ng-src="api/users/{{disposition.id}}/avatar" /></td>\n <td md-cell ng-if="!disposition.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{disposition.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="id ">{{disposition.id}}</td>\n <td ng-click="vm.createOrEditDisposition($event, disposition)" md-cell class="name ">{{disposition.name}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(disposition, $event)" translate="TOOLS.EDIT_DISPOSITION">\n Edit Disposition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(disposition, $event)" translate="TOOLS.DELETE_DISPOSITION">\n Delete Disposition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.dispositions.count}}" md-on-paginate="vm.getDispositions" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / DISPOSITION TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD DISPOSITION BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-disposition-button" ng-click="vm.createOrEditDisposition($event)" aria-label="add disposition" translate translate-attr-aria-label="TOOLS.ADD_DISPOSITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD DISPOSITION BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/intervals/create/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description">\n\n <div ng-messages="intervalForm[\'description\'].$error" ng-show="intervalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input ng-model="vm.interval.name" type="text" name="name" placeholder="{{\'TOOLS.NAME\' | translate}}" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" md-autofocus required>\n <div ng-messages="intervalForm.name.$error" ng-show="intervalForm.name.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/intervals/dialog.html",'<md-dialog class="interval-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="" name="name" ng-model="vm.interval.name" ng-required="true" autofocus>\n\n <div ng-messages="intervalForm[\'name\'].$error" ng-show="intervalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInterval" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInterval" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInterval" ng-click="vm.deleteInterval($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/intervals/edit/view.html",'<div id="tools-interval" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-intervals-button md-icon-button" aria-label="Go to intervals" ng-click="vm.gotoIntervals()" translate translate-attr-aria-label="TOOLS.GO_TO_INTERVALS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="interval-image" hide-xs>\n <img ng-src="assets/images/business/intervals.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.interval.id}}\n <span ng-if="vm.interval.name">{{vm.interval.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.interval.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInterval()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (intervalsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.interval.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.interval.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.INTERVALS">INTERVALS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="interval-detail-form-container intervals md-background-bg md-whiteframe-1dp">\n <div ng-controller="IntervalIntervalsController as vm_dc" ng-init="vm_dc.init(vm.interval, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.INTERVALS">Intervals</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditIntervalInterval($event)" aria-label="add interval" translate translate-attr-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedIntervalIntervals.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedIntervalIntervals.length}} {{vm_dc.selectedIntervalIntervals.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedIntervalIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedIntervalIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedIntervalIntervals" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getIntervalIntervals">\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="interval">{{ \'TOOLS.INTERVAL\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_dc.sortableTable">\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm_dc.intervalIntervals.rows">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.id}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.name}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.interval}}</td>\n <td ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" md-cell>{{interval.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditIntervalInterval($event, interval)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.intervalIntervals.rows.length">\n <td md-cell colspan="7">\n <span class="text-boxed-ligth" translate="TOOLS.NO_INTERVALS_AVAILABLE">No intervals available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/intervals/intervals.html",'<div id="intervals" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.INTERVALS">Intervals</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedIntervals.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedIntervals =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-intervals-count">\n <span>{{vm.selectedIntervals.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERVALS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllIntervals()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectIntervals()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedIntervals" csv-label="true" filename="intervals.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedIntervals($event)" aria-label="delete selected" translate translate-attr-label="INTERVALS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INTERVAL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedIntervals" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getIntervals">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.intervals.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="interval" md-select-id="id" ng-repeat="interval in vm.intervals.rows">\n <td md-cell ng-if="interval.userpic"><img class="avatar" alt="{{interval.name}}" ng-src="api/users/{{interval.id}}/avatar" /></td>\n <td md-cell ng-if="!interval.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{interval.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="id ">{{interval.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="name ">{{interval.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(interval, ev) : vm.createOrEditInterval($event, interval)" md-cell class="description ">{{interval.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(interval, $event)" translate="TOOLS.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(interval, $event)" translate="TOOLS.DELETE_INTERVAL">\n Delete Interval\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.intervals.count}}" md-on-paginate="vm.getIntervals" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERVAL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERVAL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-interval-button" ng-click="vm.createOrEditInterval($event)" aria-label="add interval" translate translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERVAL BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/pauses/create/dialog.html",'<md-dialog class="pause-dialog" aria-label="New Pause">\n <form name="pauseForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.pause.name" ng-required="true" autofocus>\n\n <div ng-messages="pauseForm[\'name\'].$error" ng-show="pauseForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.pause.description">\n\n <div ng-messages="pauseForm[\'description\'].$error" ng-show="pauseForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newPause" ng-click="vm.savePause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid || pauseForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newPause" ng-click="vm.addNewPause()" class="send-button md-accent md-raised" ng-disabled="pauseForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_PAUSE" translate-attr-aria-label="TOOLS.ADD_PAUSE">\n ADD PAUSE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newPause" ng-click="vm.deletePause($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/pauses/pauses.html",'<div id="pauses" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.PAUSES">Pauses</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedPauses.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedPauses =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-pauses-count">\n <span>{{vm.selectedPauses.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="PAUSES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllPauses()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectPauses()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedPauses" csv-label="true" filename="pauses.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedPauses($event)" aria-label="delete selected" translate translate-attr-label="PAUSES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- PAUSE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedPauses" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getPauses">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.pauses.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="pause" md-select-id="id" ng-repeat="pause in vm.pauses.rows">\n <td md-cell ng-if="pause.userpic"><img class="avatar" alt="{{pause.name}}" ng-src="api/users/{{pause.id}}/avatar" /></td>\n <td md-cell ng-if="!pause.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{pause.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="id ">{{pause.id}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="name ">{{pause.name}}</td>\n <td ng-click="vm.createOrEditPause($event, pause)" md-cell class="description ">{{pause.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(pause, $event)" translate="TOOLS.EDIT_PAUSE">\n Edit Pause\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(pause, $event)" translate="TOOLS.DELETE_PAUSE">\n Delete Pause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.pauses.count}}" md-on-paginate="vm.getPauses" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / PAUSE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD PAUSE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-pause-button" ng-click="vm.createOrEditPause($event)" aria-label="add pause" translate translate-attr-aria-label="TOOLS.ADD_PAUSE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD PAUSE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/schedules/create/dialog.html",'<md-dialog class="schedule-dialog" aria-label="New Schedule">\n <form name="scheduleForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.schedule.name" ng-required="true" autofocus>\n\n <div ng-messages="scheduleForm[\'name\'].$error" ng-show="scheduleForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REPORT">Report</label>\n <input type="search" name="report" ng-model="vm.schedule.report" ng-required="true" autocomplete="off" ng-click="vm.searchReport()">\n <md-icon md-font-icon="icon-magnify" ng-click="vm.searchReport()" aria-label="Search Report"></md-icon>\n <div ng-messages="scheduleForm[\'report\'].$error" ng-show="scheduleForm[\'report\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTPUT">Output</label>\n <md-select name="output" ng-model="vm.schedule.output" required>\n <md-option ng-value="\'csv\'">CSV</md-option>\n <md-option ng-value="\'pdf\'">PDF</md-option>\n <md-option ng-value="\'xlsx\'">Excel</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'output\'].$error" ng-show="scheduleForm[\'output\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>\n </md-input-container>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="startAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="startAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.startAt" ng-init="vm.schedule.startAt = vm.getDateFromString(vm.schedule.startAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div class="md-block">\n <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>\n <md-content layout="row" class="md-padding">\n <div flex class="md-block">\n <mdp-date-picker mdp-open-on-click required name="endAtDate" mdp-placeholder="Date" mdp-format="YYYY-MM-DD" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.dateRangeFrom.$error" ng-show="scheduleForm.dateRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DATE_REQUIRED">Date is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.DATE_INVALID">Date is invalid</span>\n </div>\n </div>\n </mdp-date-picker>\n </div>\n <div flex class="md-block">\n <mdp-time-picker mdp-open-on-click required name="endAtTime" mdp-placeholder="Time" mdp-format="HH:mm:ss" mdp-auto-switch="true" ng-model="vm.schedule.endAt" ng-init="vm.schedule.endAt = vm.getDateFromString(vm.schedule.endAt)">\n <div ng-messages="scheduleForm.timeRangeFrom.$error" ng-show="scheduleForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_REQUIRED">Time is required</span>\n </div>\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_INVALID">Time is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </md-content>\n </div>\n <div flex class="md-block">\n <label> {{ \'TOOLS.CRON\' | translate }} ({{vm.schedule.cron}})</label>\n <cron-selection name="cron" ng-model="vm.schedule.cron" template="assets/angular-cron-jobs/template.html" required></cron-selection>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.LAST">Last</label>\n <input type="number" name="subtractNumber" ng-model="vm.schedule.subtractNumber" ng-required="true">\n\n <div ng-messages="scheduleForm[\'subtractNumber\'].$error" ng-show="scheduleForm[\'subtractNumber\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LAST_REQUIRED">Last field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.LASTUNIT">LastUnit</label>\n <md-select name="subtractUnit" ng-model="vm.schedule.subtractUnit" required>\n <md-option ng-value="\'minutes\'">Minutes</md-option>\n <md-option ng-value="\'hours\'">Hours</md-option>\n <md-option ng-value="\'days\'">Days</md-option>\n <md-option ng-value="\'weeks\'">Weeks</md-option>\n <md-option ng-value="\'months\'">Months</md-option>\n <md-option ng-value="\'quarters\'">Quarters</md-option>\n <md-option ng-value="\'years\'">Years</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'subtractUnit\'].$error" ng-show="scheduleForm[\'subtractUnit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LASTUNIT_REQUIRED">LastUnit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.MAILACCOUNT">MailAccount</label>\n <md-select name="MailAccountId" ng-model="vm.schedule.MailAccountId" required>\n <md-option ng-value="MailAccountId.id" ng-repeat="MailAccountId in vm.mailAccounts" ng-disabled="MailAccountId.canSelect === false">{{ MailAccountId.name }}</md-option>\n </md-select>\n <div ng-messages="scheduleForm[\'MailAccountId\'].$error" ng-show="scheduleForm[\'MailAccountId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.MAILACCOUNT_REQUIRED">MailAccount field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>\n <input type="text" name="email" ng-model="vm.schedule.email" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'email\'].$error" ng-show="scheduleForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILCCADDRESS">EmailCcAddress</label>\n <input type="text" name="cc" ng-model="vm.schedule.cc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'cc\'].$error" ng-show="scheduleForm[\'cc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILCCADDRESS_REQUIRED">EmailCcAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <label translate="TOOLS.EMAILBCCADDRESS">EmailBccAddress</label>\n <input type="text" name="bcc" ng-model="vm.schedule.bcc">\n\n <div class="hint"><span translate="TOOLS.HELP.EMAILBCCADDRESS"></span></div>\n <div ng-messages="scheduleForm[\'bcc\'].$error" ng-show="scheduleForm[\'bcc\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EMAILBCCADDRESS_REQUIRED">EmailBccAddress field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.schedule.sendMail" class="md-block">\n <md-switch ng-model="vm.schedule.sendIfEmpty" aria-label="SendIfEmpty"><span translate="TOOLS.SENDIFEMPTY">SendIfEmpty</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="" name="description" ng-model="vm.schedule.description">\n\n <div ng-messages="scheduleForm[\'description\'].$error" ng-show="scheduleForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n ADD SCHEDULE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/partialViews/reports/treeReports.html",'<md-dialog class="report-selection-dialog" aria-label="Report Selection" flex="60">\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2>Select Report</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeReportDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content>\n <div class="content" md-background-bg layout="row" layout-align="start start">\n <div layout="column" flex="30">\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeDefaultEvents" ng-model="vm.treeDefaultData" tree="vm.treeDefaultInstance"></div>\n </md-card>\n <md-card class="padding-10 scrollable" ms-scroll>\n <div js-tree="vm.treeConfig" tree-events-obj="vm.treeCustomEvents" ng-model="vm.treeCustomData" tree="vm.treeCustomInstance"></div>\n </md-card>\n </div>\n <md-card flex="70">\n <md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="h2 secondary-text">{{vm.currentNode.text}}</span>\n <p ng-if="vm.currentPath">\n <span class="text-boxed">{{vm.currentPath}}</span>\n </p>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select ng-model="vm.selectedReport" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getReports">\n <tr md-row>\n <th md-column md-order-by="id" width="10px">{{ "ANALYTICS.ID" | translate }}</th>\n <th md-column md-order-by="name">{{ "ANALYTICS.NAME" | translate }}</th>\n <th md-column md-order-by="description">{{ "ANALYTICS.DESCRIPTION" | translate }}</th>\n <th md-column md-order-by="createdAt">{{ "ANALYTICS.CREATED_AT" | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.reports.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span tranlsate="ANALYTICS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="report" md-select-id="id" ng-repeat="report in vm.reports.rows">\n <td md-cell class="id">{{ report.id }}</td>\n <td md-cell class="name">{{ report.name }}</td>\n <td md-cell class="description">{{ report.description }}</td>\n <td md-cell class="createdAt">{{ report.createdAt | date: "medium" }}</td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{ \'ANALYTICS.PAGE\' | translate }}:\', rowsPerPage: \'{{ \'ANALYTICS.ROWSPERPAGE\' | translate }}:\', of: \'{{ \'ANALYTICS.OF\' | translate }}\'}" md-limit="vm.query.limit" md-limit-options="[10]" md-page="vm.query.page" md-total="{{ vm.reports.count }}" md-on-paginate="vm.getReports" md-page-select></md-table-pagination>\n </md-card>\n </div>\n </md-dialog-content>\n <md-dialog-actions layout="row">\n <span flex></span>\n <md-button class="md-raised" ng-click="vm.closeReportDialog()">CANCEL</md-button>\n <md-button class="md-accent md-raised" ng-click="vm.selectReport()">CONFIRM</md-button>\n </md-dialog-actions>\n</md-dialog>'),e.put("app/main/apps/tools/views/schedules/schedules.html",'<div id="schedules" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SCHEDULER">Scheduler</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedScheduler.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedScheduler =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-schedules-count">\n <span>{{vm.selectedScheduler.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SCHEDULER.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllScheduler()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectScheduler()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedScheduler" csv-label="true" filename="schedules.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedScheduler($event)" aria-label="delete selected" translate translate-attr-label="SCHEDULER.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SCHEDULE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedScheduler" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getScheduler">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="startAt">{{ \'TOOLS.VALIDITYSTART\' | translate }}</th>\n <th md-column md-order-by="endAt">{{ \'TOOLS.VALIDITYEND\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.schedules.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="schedule" md-select-id="id" ng-repeat="schedule in vm.schedules.rows">\n <td md-cell ng-if="schedule.userpic"><img class="avatar" alt="{{schedule.name}}" ng-src="api/users/{{schedule.id}}/avatar" /></td>\n <td md-cell ng-if="!schedule.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{schedule.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="id ">{{schedule.id}}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="name ">{{schedule.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(schedule, ev) : vm.createOrEditSchedule($event, schedule)" md-cell class="active ">\n <md-icon md-colors="{color: {{schedule.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{schedule.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="startAt ">{{schedule.startAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="endAt ">{{schedule.endAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditSchedule($event, schedule)" md-cell class="description ">{{schedule.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(schedule, $event)" translate="TOOLS.EDIT_SCHEDULE">\n Edit Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.runconfirm(schedule, $event)" translate="TOOLS.RUN_SCHEDULE">\n Run Schedule\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(schedule, $event)" translate="TOOLS.DELETE_SCHEDULE">\n Delete Schedule\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.schedules.count}}" md-on-paginate="vm.getScheduler" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SCHEDULE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD SCHEDULE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-schedule-button" ng-click="vm.createOrEditSchedule($event)" aria-label="add schedule" translate translate-attr-aria-label="TOOLS.ADD_SCHEDULE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD SCHEDULE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/create/dialog.html",'<md-dialog class="sound-dialog" aria-label="New Sound">\n <form name="soundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.sound.name" ng-required="true" autofocus>\n\n <div ng-messages="soundForm[\'name\'].$error" ng-show="soundForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.sound.description">\n\n <div ng-messages="soundForm[\'description\'].$error" ng-show="soundForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newSound" ng-click="vm.saveSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid || soundForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newSound" ng-click="vm.addNewSound()" class="send-button md-accent md-raised" ng-disabled="soundForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SOUND" translate-attr-aria-label="TOOLS.ADD_SOUND">\n ADD SOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newSound" ng-click="vm.deleteSound($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/sounds/sounds.html",'<div id="sounds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.SOUNDS">Sounds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedSounds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedSounds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-sounds-count">\n <span>{{vm.selectedSounds.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="SOUNDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllSounds()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectSounds()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedSounds" csv-label="true" filename="sounds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedSounds($event)" aria-label="delete selected" translate translate-attr-label="SOUNDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- SOUND TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedSounds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getSounds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'TOOLS.AUDIO\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.sounds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="sound" md-select-id="id" ng-repeat="sound in vm.sounds.rows">\n <td md-cell ng-if="sound.userpic"><img class="avatar" alt="{{sound.name}}" ng-src="api/users/{{sound.id}}/avatar" /></td>\n <td md-cell ng-if="!sound.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{sound.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="id ">{{sound.id}}</td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="name ">{{sound.name}}</td>\n <td md-cell class="audio ">\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="sound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td ng-click="vm.createOrEditSound($event, sound)" md-cell class="description ">{{sound.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(sound, $event)" translate="TOOLS.EDIT_SOUND">\n Edit Sound\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(sound, $event)" translate="TOOLS.DOWNLOAD_SOUND">\n Download Sound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(sound, $event)" translate="TOOLS.DELETE_SOUND">\n Delete Sound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.sounds.count}}" md-on-paginate="vm.getSounds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / SOUND TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- UPLOAD SOUND BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="upload-sound-button" ng-click="vm.uploadSound($event)" aria-label="upload sound" translate translate-attr-aria-label="TOOLS.UPLOAD_SOUND">\n <md-icon md-font-icon="icon-upload"></md-icon>\n </md-button>\n \x3c!-- / UPLOAD SOUND BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/sounds/upload/dialog.html",'<md-dialog class="upload-dialog" aria-label="Upload ">\n <form name="uploadForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <div id="sound-uploader" ng-hide="vm.uploadState == \'uploading\'" flow-init="vm.ngFlowOptions" flow-name="vm.ngFlow.flow" flow-files-submitted="vm.upload()" flow-file-added="vm.fileAdded($file)" flow-file-success="vm.fileSuccess($file, $message)" flow-error="vm.uploadError($file, $message)" flow-complete="vm.uploadComplete()" flow-drop flow-drag-enter="vm.dropping=true" flow-drag-leave="vm.dropping=false" ng-class="{\'dropping\':vm.dropping}">\n\n <div class="drop-text hint-text" layout="row" layout-align="center center">\n <span translate="TOOLS.DROP_TO_UPLOAD">Drop to upload</span>\n </div>\n\n <div class="upload-button" layout="column" layout-align="center center">\n <md-button class="md-accent md-raised" flow-btn>\n Upload\n </md-button>\n <span class="secondary-text mt-8" translate="TOOLS.DROP_TO_UPLOAD_MESSAGE">You can also drop your file here to upload.</span>\n </div>\n </div>\n\n <div layout="column" layout-align="space-between center" ng-show="vm.uploadState == \'uploading\'">\n <div>\n <span translate="TOOLS.UPLOADING">Uploading</span>\n <span>{{vm.sound.file.name}}</span>\n </div>\n <md-progress-linear md-mode="indeterminate"></md-progress-linear>\n </div>\n\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center"></div>\n <div layout="row">\n <md-button ng-click="vm.closeDialog()" ng-hide="vm.uploadState == \'uploading\'" class="md-accent md-raised" aria-label="FINISH" translate="TOOLS.FINISH" translate-attr-aria-label="TOOLS.FINISH">\n FINISH\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/create/dialog.html",'<md-dialog class="tag-dialog" aria-label="New Tag">\n <form name="tagForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.tag.name" ng-required="true" autofocus>\n\n <div ng-messages="tagForm[\'name\'].$error" ng-show="tagForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.tag.description">\n\n <div ng-messages="tagForm[\'description\'].$error" ng-show="tagForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n <div flex md-color-picker ng-model="vm.tag.color" label="{{\'TOOLS.COLOR\' | translate}}" md-color-hex="true" md-color-rgb="false" md-color-hsl="false" md-color-history="false" md-color-material-palette="false" md-color-alpha-channel="false" open-on-input="true"></div>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTag" ng-click="vm.saveTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid || tagForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTag" ng-click="vm.addNewTag()" class="send-button md-accent md-raised" ng-disabled="tagForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TAG" translate-attr-aria-label="TOOLS.ADD_TAG">\n ADD TAG\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTag" ng-click="vm.deleteTag($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/tags/tags.html",'<div id="tags" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TAGS">Tags</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTags.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTags =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-tags-count">\n <span>{{vm.selectedTags.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TAGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTags()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTags()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTags" csv-label="true" filename="tags.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTags($event)" aria-label="delete selected" translate translate-attr-label="TAGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TAG TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTags" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTags">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column md-order-by="color">{{ \'TOOLS.COLOR\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.tags.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="tag" md-select-id="id" ng-repeat="tag in vm.tags.rows">\n <td md-cell ng-if="tag.userpic"><img class="avatar" alt="{{tag.name}}" ng-src="api/users/{{tag.id}}/avatar" /></td>\n <td md-cell ng-if="!tag.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{tag.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="id ">{{tag.id}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="name ">{{tag.name}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="description ">{{tag.description}}</td>\n <td ng-click="vm.createOrEditTag($event, tag)" md-cell class="color ">{{tag.color}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(tag, $event)" translate="TOOLS.EDIT_TAG">\n Edit Tag\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(tag, $event)" translate="TOOLS.DELETE_TAG">\n Delete Tag\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.tags.count}}" md-on-paginate="vm.getTags" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TAG TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TAG BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-tag-button" ng-click="vm.createOrEditTag($event)" aria-label="add tag" translate translate-attr-aria-label="TOOLS.ADD_TAG">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TAG BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/templates/create/dialog.html",'<md-dialog class="template-dialog" aria-label="New Template">\n <form name="templateForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.template.name" ng-required="true" autofocus>\n\n <div ng-messages="templateForm[\'name\'].$error" ng-show="templateForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <div class="md-block">\n <label class="md-caption grey-fg" translate="TOOLS.CONTENT">Content</label>\n <textarea aria-label="Content html" ckeditor="{ skin: \'office2013\', language: \'en\', allowedContent: true, extraPlugins: \'font,colorbutton,autoembed,autocorrect,googlethisterm,pastebase64\', toolbarGroups: [{ name: \'styles\', groups: [\'styles\'] }, { name: \'clipboard\', groups: [\'undo\'] }, { name: \'colors\', groups: [\'colors\'] }, { name: \'basicstyles\', groups: [\'basicstyles\'] }, { name: \'paragraph\', groups: [\'list\', \'indent\', \'align\'] }, { name: \'mode\' }], autocorrect_enabled: true, disableNativeSpellChecker: false, removePlugins: \'magicline\' }" ng-model="vm.template.html"></textarea>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.template.description">\n\n <div ng-messages="templateForm[\'description\'].$error" ng-show="templateForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTemplate" ng-click="vm.saveTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid || templateForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTemplate" ng-click="vm.addNewTemplate()" class="send-button md-accent md-raised" ng-disabled="templateForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TEMPLATE" translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n ADD TEMPLATE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTemplate" ng-click="vm.deleteTemplate($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/templates/templates.html",'<div id="templates" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TEMPLATES">Templates</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTemplates.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTemplates =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-templates-count">\n <span>{{vm.selectedTemplates.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TEMPLATES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTemplates()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTemplates()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTemplates" csv-label="true" filename="templates.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTemplates($event)" aria-label="delete selected" translate translate-attr-label="TEMPLATES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TEMPLATE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTemplates" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTemplates">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.templates.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="template" md-select-id="id" ng-repeat="template in vm.templates.rows">\n <td md-cell ng-if="template.userpic"><img class="avatar" alt="{{template.name}}" ng-src="api/users/{{template.id}}/avatar" /></td>\n <td md-cell ng-if="!template.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{template.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="id ">{{template.id}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="name ">{{template.name}}</td>\n <td ng-click="vm.createOrEditTemplate($event, template)" md-cell class="description ">{{template.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(template, $event)" translate="TOOLS.EDIT_TEMPLATE">\n Edit Template\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(template, $event)" translate="TOOLS.DELETE_TEMPLATE">\n Delete Template\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.templates.count}}" md-on-paginate="vm.getTemplates" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TEMPLATE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TEMPLATE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-template-button" ng-click="vm.createOrEditTemplate($event)" aria-label="add template" translate translate-attr-aria-label="TOOLS.ADD_TEMPLATE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TEMPLATE BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/triggers/create/dialog.html",'<md-dialog class="trigger-dialog" aria-label="New Trigger">\n <form name="triggerForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus>\n\n <div ng-messages="triggerForm[\'name\'].$error" ng-show="triggerForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required ng-disabled="!vm.newTrigger">\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n </md-select>\n <div ng-messages="triggerForm[\'channel\'].$error" ng-show="triggerForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description">\n\n <div ng-messages="triggerForm[\'description\'].$error" ng-show="triggerForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrigger" ng-click="vm.saveTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid || triggerForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrigger" ng-click="vm.addNewTrigger()" class="send-button md-accent md-raised" ng-disabled="triggerForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRIGGER" translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n ADD TRIGGER\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrigger" ng-click="vm.deleteTrigger($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/actions/dialog.html",'<md-dialog class="action-dialog" aria-label="New Action">\n <form name="actionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.ACTION">Action</label>\n <md-select name="action" ng-model="vm.action.action" ng-init="vm.onActionInit()" autofocus required ng-disabled="!vm.newAction">\n\n <md-option ng-value="\'contactManager\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CONTACT_MANAGER\' | translate }} </md-option>\n\n <md-option ng-value="\'integration\'" ng-if="vm.trigger.channel == \'voice\' && ((vm.newAction && vm.hasModulePermissions.Integrations) || !vm.newAction)"> {{ \'TOOLS.INTEGRATIONS\' | translate }} </md-option>\n\n <md-option ng-value="\'motionbar\'"> {{ \'TOOLS.MOTION_BAR\' | translate }} </md-option>\n\n <md-option ng-value="\'jscripty\'"> {{ \'TOOLS.JSCRIPTY\' | translate }} </md-option>\n\n <md-option ng-value="\'urlForward\'"> {{ \'TOOLS.URL_FORWARD\' | translate }} </md-option>\n\n <md-option ng-value="\'browser\'"> {{ \'TOOLS.BROWSER\' | translate }} </md-option>\n\n <md-option ng-value="\'bot\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.BOT\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'action\'].$error" ng-show="actionForm[\'action\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACTION_REQUIRED">Action field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'jscripty\'" class="md-block">\n <label translate="TOOLS.PROJECT">Project</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.projects" ng-disabled="data1.canSelect === false">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.LIST">List</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'\'+data1.id" ng-repeat="data1 in vm.lists" ng-disabled="data1.canSelect === false">{{ data1.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LIST_REQUIRED">List field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'contactManager\'" class="md-block">\n <label translate="TOOLS.AUTOCREATECONTACT">AutoCreateContact</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED">AutoCreateContact field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'GET\'">GET</md-option>\n <md-option ng-value="\'POST\'">POST</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'urlForward\' && vm.action.data1 == \'POST\'" class="md-block">\n <label translate="TOOLS.BODY">Body</label>\n <textarea name="data7" ng-model="vm.action.data7"></textarea>\n <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\'" class="md-block">\n <label translate="TOOLS.INTEGRATION">Integration</label>\n <md-select name="data1" ng-model="vm.action.data1" ng-init="vm.onIntegrationInit()" required>\n <md-option ng-value="\'zendesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])">Zendesk</md-option>\n <md-option ng-value="\'salesforce\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])">Salesforce</md-option>\n <md-option ng-value="\'sugarcrm\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])">SugarCRM</md-option>\n <md-option ng-value="\'freshdesk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])">Freshdesk</md-option>\n <md-option ng-value="\'desk\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])">Desk</md-option>\n <md-option ng-value="\'zoho\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])">Zoho</md-option>\n <md-option ng-value="\'vtiger\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])">vTiger</md-option>\n <md-option ng-value="\'dynamics365\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])">Dynamics365</md-option>\n <md-option ng-value="\'servicenow\'" ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction" ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])">ServiceNow</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED">Integration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1301])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zendeskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1306])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.deskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1307])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.zohoAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1302])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.salesforceAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1305])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.sugarcrmAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1303])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.freshdeskAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'vtiger\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1308])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.vtigerAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'dynamics365\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1309])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.dynamics365Accounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'servicenow\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="data2" ng-model="vm.action.data2" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1310])">\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.servicenowAccounts" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zendesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1301])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zendeskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'desk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1306])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.deskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'zoho\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1307])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.zohoConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'salesforce\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1302])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.salesforceConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'sugarcrm\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1305])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.sugarcrmConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'freshdesk\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1303])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.freshdeskConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'vtiger\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1308])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.vtigerConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'dynamics365\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1309])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.dynamics365Configurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'integration\' && vm.action.data1 == \'servicenow\' && vm.action.data2" class="md-block">\n <label translate="TOOLS.CONFIGURATION">Configuration</label>\n <md-select name="data3" ng-model="vm.action.data3" required ng-disabled="!vm.newAction && (!vm.newAction && !vm.hasSectionPermissions[1310])">\n <md-option ng-value="\'\'+data3.id" ng-repeat="data3 in vm.servicenowConfigurations | filter:{AccountId:vm.action.data2}" ng-disabled="data3.canSelect === false">{{ data3.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED">Configuration field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\'" class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="data1" ng-model="vm.action.data1" required>\n <md-option ng-value="\'0\'">Popup</md-option>\n <md-option ng-value="\'1\'">CTI URL</md-option>\n <md-option ng-value="\'2\'">Windows App</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data1\'].$error" ng-show="actionForm[\'data1\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.APPLICATION">Application</label>\n <input type="text" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'2\'" class="md-block">\n <label translate="TOOLS.ARGUMENTS">Arguments</label>\n <input type="text" name="data3" ng-model="vm.action.data3">\n\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'motionbar\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'0\'" class="md-block">\n <label translate="TOOLS.TEMPLATE">Template</label>\n <md-select name="data2" ng-model="vm.action.data2" required>\n <md-option ng-value="\'\'+data2.id" ng-repeat="data2 in vm.templates" ng-disabled="data2.canSelect === false">{{ data2.name }}</md-option>\n </md-select>\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED">Template field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.URL">Url</label>\n <input type="url" name="data2" ng-model="vm.action.data2" ng-required="true">\n\n <div ng-messages="actionForm[\'data2\'].$error" ng-show="actionForm[\'data2\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n <div ng-message="url">\n <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL">Url must be a valid url http://www.xcally.com</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="(vm.action.action == \'motionbar\' || vm.action.action == \'browser\') && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>\n <md-select name="data3" ng-model="vm.action.data3" required>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.EVENTVARIABLES"></span></div>\n <div ng-messages="actionForm[\'data3\'].$error" ng-show="actionForm[\'data3\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED">EventVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data1 == \'1\'" class="md-block">\n <label translate="TOOLS.LOCATION">Location</label>\n <md-select name="data4" ng-model="vm.action.data4" required>\n\n <md-option ng-value="\'0\'"> {{ \'TOOLS.NEW_TAB\' | translate }} </md-option>\n\n <md-option ng-value="\'1\'"> {{ \'TOOLS.NEW_WINDOW\' | translate }} </md-option>\n </md-select>\n <div ng-messages="actionForm[\'data4\'].$error" ng-show="actionForm[\'data4\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.LOCATION_REQUIRED">Location field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>\n <input type="text" name="data5" ng-model="vm.action.data5">\n\n <div ng-messages="actionForm[\'data5\'].$error" ng-show="actionForm[\'data5\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED">WindowWidth field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.action.action == \'browser\' && vm.action.data4 == \'1\'" class="md-block">\n <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>\n <input type="text" name="data6" ng-model="vm.action.data6">\n\n <div ng-messages="actionForm[\'data6\'].$error" ng-show="actionForm[\'data6\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED">WindowHeight field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAction" ng-click="vm.saveAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid || actionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAction" ng-click="vm.addNewAction()" class="send-button md-accent md-raised" ng-disabled="actionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ACTION" translate-attr-aria-label="TOOLS.ADD_ACTION">\n ADD ACTION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAction" ng-click="vm.deleteAction($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/allconditions/dialog.html",'<md-dialog class="allCondition-dialog" aria-label="New AllCondition">\n <form name="allConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.allCondition.field" autofocus required>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }} </md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }} </md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }} </md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'field\'].$error" ng-show="allConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.allCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'operator\'].$error" ng-show="allConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.allCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.allCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="allConditionForm[\'value\'].$error" ng-show="allConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition" ng-click="vm.saveAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAllCondition" ng-click="vm.addNewAllCondition()" class="send-button md-accent md-raised" ng-disabled="allConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ALLCONDITION" translate-attr-aria-label="TOOLS.ADD_ALLCONDITION">\n ADD ALLCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition" ng-click="vm.deleteAllCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/anyconditions/dialog.html",'<md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">\n <form name="anyConditionForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.FIELD">Field</label>\n <md-select name="field" ng-model="vm.anyCondition.field" autofocus required>\n\n <md-option ng-value="\'queue\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.QUEUE\' | translate }} </md-option>\n\n <md-option ng-value="\'lastevent\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.CALL_STATUS\' | translate }} </md-option>\n\n <md-option ng-value="\'routeId\'" ng-if="vm.trigger.channel == \'voice\'"> {{ \'TOOLS.OUTBOUNDROUTE\' | translate }} </md-option>\n\n <md-option ng-value="\'account\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.ACCOUNT\' | translate }} </md-option>\n\n <md-option ng-value="\'interaction\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.INTERACTION\' | translate }} </md-option>\n\n <md-option ng-value="\'message\'" ng-if="vm.trigger.channel != \'voice\'"> {{ \'TOOLS.MESSAGE\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'field\'].$error" ng-show="anyConditionForm[\'field\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FIELD_REQUIRED">Field field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OPERATOR">Operator</label>\n <md-select name="operator" ng-model="vm.anyCondition.operator" required>\n\n <md-option ng-value="\'equals\'"> {{ \'TOOLS.EQUALS\' | translate }} </md-option>\n\n <md-option ng-value="\'not_equals\'"> {{ \'TOOLS.NOT_EQUALS\' | translate }} </md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'operator\'].$error" ng-show="anyConditionForm[\'operator\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED">Operator field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'chat\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.chatAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'mail\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.mailAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'sms\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.smsAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'fax\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.faxAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'account\' && vm.trigger.channel == \'openchannel\'" class="md-block">\n <label translate="TOOLS.ACCOUNT">Account</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.openchannelAccounts" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'queue\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.QUEUE">Queue</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.name" ng-repeat="value in vm.queues" ng-disabled="value.canSelect === false">{{ value.name }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'routeId\' && vm.trigger.channel == \'voice\'" class="md-block">\n <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="value.id" ng-repeat="value in vm.outboundRoutes" ng-disabled="value.canSelect === false">{{ value.exten }}</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'lastevent\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'abandoned\'">Abandon</md-option>\n <md-option ng-value="\'complete\'">Hangup</md-option>\n <md-option ng-value="\'rejected\'">Reject</md-option>\n <md-option ng-value="\'called\'">Ring</md-option>\n <md-option ng-value="\'connect\'">Answer</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'interaction\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'opened\'">Opened</md-option>\n <md-option ng-value="\'closed\'">Closed</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.anyCondition.field == \'message\' && vm.trigger.channel != \'voice\'" class="md-block">\n <label translate="TOOLS.VALUE">Value</label>\n <md-select name="value" ng-model="vm.anyCondition.value" required>\n <md-option ng-value="\'in\'">Incoming</md-option>\n <md-option ng-value="\'out\'">Outgoing</md-option>\n <md-option ng-value="\'accept\'">Accepted</md-option>\n <md-option ng-value="\'reject\'">Rejected</md-option>\n </md-select>\n <div ng-messages="anyConditionForm[\'value\'].$error" ng-show="anyConditionForm[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition" ng-click="vm.saveAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition" ng-click="vm.addNewAnyCondition()" class="send-button md-accent md-raised" ng-disabled="anyConditionForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_ANYCONDITION" translate-attr-aria-label="TOOLS.ADD_ANYCONDITION">\n ADD ANYCONDITION\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition" ng-click="vm.deleteAnyCondition($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/triggers/edit/view.html",'<div id="tools-trigger" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-triggers-button md-icon-button" aria-label="Go to triggers" ng-click="vm.gotoTriggers()" translate translate-attr-aria-label="TOOLS.GO_TO_TRIGGERS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trigger-image" hide-xs>\n <img ng-src="assets/images/business/triggers.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trigger.id}}\n <span ng-if="vm.trigger.name">{{vm.trigger.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trigger.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrigger()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (allconditionsForm.$invalid) || (anyconditionsForm.$invalid) || (actionsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trigger.name" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CHANNEL">Channel</label>\n <md-select name="channel" ng-model="vm.trigger.channel" required disabled>\n\n <md-option ng-value="\'voice\'"> {{ \'TOOLS.VOICE\' | translate }} </md-option>\n\n <md-option ng-value="\'openchannel\'" ng-if="vm.license.openchannel"> {{ \'TOOLS.OPENCHANNEL\' | translate }} </md-option>\n\n <md-option ng-value="\'chat\'" ng-if="vm.license.chat"> {{ \'TOOLS.CHAT\' | translate }} </md-option>\n\n <md-option ng-value="\'mail\'" ng-if="vm.license.mail"> {{ \'TOOLS.MAIL\' | translate }} </md-option>\n\n <md-option ng-value="\'sms\'" ng-if="vm.license.messaging"> {{ \'TOOLS.SMS\' | translate }} </md-option>\n\n <md-option ng-value="\'fax\'" ng-if="vm.license.fax"> {{ \'TOOLS.FAX\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'channel\'].$error" ng-show="generalForm[\'channel\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CHANNEL_REQUIRED">Channel field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trigger.status" aria-label="Status" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.STATUS">Status</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trigger.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.CONDITIONS&ACTIONS">CONDITIONS&ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trigger-detail-form-container allconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAllConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ALLCONDITIONS">AllConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAllCondition($event)" aria-label="add allCondition" translate translate-attr-label="TOOLS.ADD_ALLCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAllConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAllConditions.length}} {{vm_dc.selectedTriggerAllConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAllConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAllConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAllConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAllConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="allCondition" md-select-id="id" ng-repeat="allCondition in vm_dc.triggerAllConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[allCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[allCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="!allCondition.value" md-cell>{{allCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'chat\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.chatAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'mail\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.mailAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'sms\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.smsAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'fax\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.faxAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'openchannel\' && allCondition.field == \'account\'" md-cell>{{ (vm_dc.openchannelAccounts | filter : {\'id\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'queue\'" md-cell>{{ (vm_dc.queues | filter : {\'name\':allCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'routeId\'" md-cell>{{ (vm_dc.outboundRoutes | filter : {\'id\':allCondition.value})[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel == \'voice\' && allCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" ng-if="vm.trigger.channel != \'voice\' && allCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[allCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" md-cell>{{allCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAllCondition($event, allCondition)" translate="TOOLS.EDIT_ALLCONDITION">\n Edit AllCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(allCondition, $event)" translate="TOOLS.DELETE_ALLCONDITION">\n Delete AllCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAllConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ALLCONDITION_AVAILABLE">No allcondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerAllConditions.count}}" md-on-paginate="vm_dc.getTriggerAllConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container anyconditions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerAnyConditionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ANYCONDITIONS">AnyConditions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAnyCondition($event)" aria-label="add anyCondition" translate translate-attr-label="TOOLS.ADD_ANYCONDITION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerAnyConditions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerAnyConditions.length}} {{vm_dc.selectedTriggerAnyConditions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerAnyConditions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerAnyConditions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerAnyConditions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerAnyConditions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="field">{{ \'TOOLS.FIELD\' | translate }}</th>\n <th md-column md-order-by="operator">{{ \'TOOLS.OPERATOR\' | translate }}</th>\n <th md-column md-order-by="value">{{ \'TOOLS.VALUE\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="anyCondition" md-select-id="id" ng-repeat="anyCondition in vm_dc.triggerAnyConditions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayfield[anyCondition.field].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayoperator[anyCondition.operator].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="!anyCondition.value" md-cell>{{anyCondition.value}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'chat\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.chatAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'mail\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.mailAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'sms\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.smsAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'fax\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.faxAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'openchannel\' && anyCondition.field == \'account\'" md-cell>{{ (vm_dc.openchannelAccounts | filter : {\'id\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'queue\'" md-cell>{{ (vm_dc.queues | filter : {\'name\':anyCondition.value})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'routeId\'" md-cell>{{ (vm_dc.outboundRoutes | filter : {\'id\':anyCondition.value})[0].exten }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel == \'voice\' && anyCondition.field == \'lastevent\'" md-cell>{{ vm_dc.callStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'interaction\'" md-cell>{{ vm_dc.interactionStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" ng-if="vm.trigger.channel != \'voice\' && anyCondition.field == \'message\'" md-cell>{{ vm_dc.messageStatusValues[anyCondition.value].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" md-cell>{{anyCondition.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAnyCondition($event, anyCondition)" translate="TOOLS.EDIT_ANYCONDITION">\n Edit AnyCondition\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(anyCondition, $event)" translate="TOOLS.DELETE_ANYCONDITION">\n Delete AnyCondition\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerAnyConditions.rows.length">\n <td md-cell colspan="17">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ANYCONDITION_AVAILABLE">No anycondition available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerAnyConditions.count}}" md-on-paginate="vm_dc.getTriggerAnyConditions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n <div class="trigger-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="TriggerActionsController as vm_dc" ng-init="vm_dc.init(vm.trigger, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="TOOLS.ACTIONS">Actions</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditTriggerAction($event)" aria-label="add action" translate translate-attr-label="TOOLS.ADD_ACTION">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedTriggerActions.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedTriggerActions.length}} {{vm_dc.selectedTriggerActions.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedTriggerActions" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedTriggerActions($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedTriggerActions" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getTriggerActions">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="action">{{ \'TOOLS.ACTION\' | translate }}</th>\n <th md-column md-order-by="data1">{{ \'TOOLS.TYPE\' | translate }}</th>\n <th md-column md-order-by="data2">{{ \'TOOLS.INFO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'TOOLS.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="action" md-select-id="id" ng-repeat="action in vm_dc.triggerActions.rows">\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.id}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{ \'TOOLS.\' + vm_dc.arrayaction[action.action].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'jscripty\'" md-cell>{{ (vm_dc.projects | filter : {\'id\':action.data1})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\'" md-cell>{{ vm_dc.browserValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ (vm_dc.lists | filter : {\'id\':action.data1})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'contactManager\'" md-cell>{{ \'TOOLS.\' + vm_dc.autoCreateContact[action.data2].option | uppercase | translate }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{ vm_dc.urlForwardValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data1" md-cell>{{action.data1}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="!action.data2" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'urlForward\' && action.data1 == \'POST\'" md-cell>{{action.data7}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\'" md-cell>{{ vm_dc.integrationValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zendesk\'" md-cell>{{ (vm_dc.zendeskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'desk\'" md-cell>{{ (vm_dc.deskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'zoho\'" md-cell>{{ (vm_dc.zohoAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'salesforce\'" md-cell>{{ (vm_dc.salesforceAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'sugarcrm\'" md-cell>{{ (vm_dc.sugarcrmAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'freshdesk\'" md-cell>{{ (vm_dc.freshdeskAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'vtiger\'" md-cell>{{ (vm_dc.vtigerAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'dynamics365\'" md-cell>{{ (vm_dc.dynamics365Accounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'integration\' && action.data1 == \'servicenow\'" md-cell>{{ (vm_dc.servicenowAccounts | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\'" md-cell>{{ vm_dc.motionbarValues[action.data1].option }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'2\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'motionbar\' && action.data1 == \'0\'" md-cell>{{ (vm_dc.templates | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'0\'" md-cell>{{ (vm_dc.templates | filter : {\'id\':action.data2})[0].name }}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" ng-if="action.action == \'browser\' && action.data1 == \'1\'" md-cell>{{action.data2}}</td>\n <td ng-click="vm_dc.createOrEditTriggerAction($event, action)" md-cell>{{action.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions" ng-if="!vm_dc.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_dc.crudPermissions.canEdit">\n <md-button ng-click="vm_dc.createOrEditTriggerAction($event, action)" translate="TOOLS.EDIT_ACTION">\n Edit Action\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(action, $event)" translate="TOOLS.DELETE_ACTION">\n Delete Action\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.triggerActions.rows.length">\n <td md-cell colspan="44">\n <span class="text-boxed-ligth" translate="TOOLS.NO_ACTION_AVAILABLE">No action available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.triggerActions.count}}" md-on-paginate="vm_dc.getTriggerActions" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/triggers/triggers.html",'<div id="triggers" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRIGGERS">Triggers</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTriggers.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTriggers =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-triggers-count">\n <span>{{vm.selectedTriggers.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRIGGERS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTriggers()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTriggers()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTriggers" csv-label="true" filename="triggers.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTriggers($event)" aria-label="delete selected" translate translate-attr-label="TRIGGERS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TRIGGER TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTriggers" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTriggers">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="channel">{{ \'TOOLS.CHANNEL\' | translate }}</th>\n <th md-column md-order-by="status">{{ \'TOOLS.STATUS\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.triggers.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trigger" md-select-id="id" ng-repeat="trigger in vm.triggers.rows">\n <td md-cell ng-if="trigger.userpic"><img class="avatar" alt="{{trigger.name}}" ng-src="api/users/{{trigger.id}}/avatar" /></td>\n <td md-cell ng-if="!trigger.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trigger.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="id ">{{trigger.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="name ">{{trigger.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="channel ">{{ \'TOOLS.\' + vm.arraychannel[trigger.channel].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="status ">\n <md-icon md-colors="{color: {{trigger.status ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trigger.status ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trigger, ev) : vm.createOrEditTrigger($event, trigger)" md-cell class="description ">{{trigger.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(trigger, $event)" translate="TOOLS.EDIT_TRIGGER">\n Edit Trigger\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trigger, $event)" translate="TOOLS.DELETE_TRIGGER">\n Delete Trigger\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.triggers.count}}" md-on-paginate="vm.getTriggers" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRIGGER TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRIGGER BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trigger-button" ng-click="vm.createOrEditTrigger($event)" aria-label="add trigger" translate translate-attr-aria-label="TOOLS.ADD_TRIGGER">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRIGGER BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/trunks/create/dialog.html",'<md-dialog class="trunk-dialog" aria-label="New Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="trunkForm[\'host\'].$error" ng-show="trunkForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="trunkForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="trunkForm[\'defaultuser\'].$error" ng-show="trunkForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="trunkForm[\'registry\'].$error" ng-show="trunkForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description">\n\n <div ng-messages="trunkForm[\'description\'].$error" ng-show="trunkForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newTrunk" ng-click="vm.saveTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid || trunkForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newTrunk" ng-click="vm.addNewTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_TRUNK" translate-attr-aria-label="TOOLS.ADD_TRUNK">\n ADD TRUNK\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newTrunk" ng-click="vm.deleteTrunk($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/clone/clone.html",'<md-dialog class="trunk-dialog" aria-label="Clone Trunk">\n <form name="trunkForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newTrunk">\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="trunkForm[\'name\'].$error" ng-show="trunkForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <md-button type="submit" ng-click="vm.cloneTrunk()" class="send-button md-accent md-raised" ng-disabled="trunkForm.$invalid" aria-label="CLONE" translate="TOOLS.CLONE_TRUNK" translate-attr-aria-label="TOOLS.CLONE_TRUNK">\n CLONE TRUNK\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/trunks/edit/view.html",'<div id="tools-trunk" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-trunks-button md-icon-button" aria-label="Go to trunks" ng-click="vm.gotoTrunks()" translate translate-attr-aria-label="TOOLS.GO_TO_TRUNKS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="trunk-image" hide-xs>\n <img ng-src="assets/images/business/trunks.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.trunk.id}}\n <span ng-if="vm.trunk.name">{{vm.trunk.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="TOOLS.CREATED_AT"></span> <span>{{vm.trunk.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.trunk, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="TOOLS.GOTO_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(vm.trunk, $event)" class="md-fab md-green-500-bg md-icon-button" aria-label="clone">\n <md-tooltip><span translate="TOOLS.CLONE_TRUNK"></span></md-tooltip>\n <md-icon md-font-icon="icon-content-duplicate"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveTrunk()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (otherFieldsForm.$invalid)" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.trunk.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="TOOLS.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.trunk.active" aria-label="active" ng-disabled="!vm.crudPermissions.canEdit"><span translate="TOOLS.ACTIVE">active</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.HOST">host</label>\n <input type="text" name="host" ng-model="vm.trunk.host" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.HOST"></span></div>\n <div ng-messages="generalForm[\'host\'].$error" ng-show="generalForm[\'host\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.HOST_REQUIRED">host field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SECRET">secret</label>\n <input type="password" name="secret" ng-model="vm.trunk.secret" placeholder="Password" translate translate-attr-placeholder="TOOLS.PASSWORD">\n <div class="hint"><span translate="TOOLS.HELP.SECRET"></span></div>\n <div ng-messages="generalForm[\'secret\'].$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLS.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="TOOLS.DEFAULTUSER">defaultuser</label>\n <input type="text" name="defaultuser" ng-model="vm.trunk.defaultuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.DEFAULTUSER"></span></div>\n <div ng-messages="generalForm[\'defaultuser\'].$error" ng-show="generalForm[\'defaultuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DEFAULTUSER_REQUIRED">defaultuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CONTEXT">context</label>\n <md-select name="context" ng-model="vm.trunk.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CONTEXT_REQUIRED">context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLERID">callerid</label>\n <input type="text" name="callerid" ng-model="vm.trunk.callerid" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALLERID"></span></div>\n <div ng-messages="generalForm[\'callerid\'].$error" ng-show="generalForm[\'callerid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLERID_REQUIRED">callerid field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select name="type" ng-model="vm.trunk.type" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'friend\'">Friend</md-option>\n <md-option ng-value="\'user\'">User</md-option>\n <md-option ng-value="\'peer\'">Peer</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TYPE"></span></div>\n <div ng-messages="generalForm[\'type\'].$error" ng-show="generalForm[\'type\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DTMFMODE">dtmfmode</label>\n <md-select name="dtmfmode" ng-model="vm.trunk.dtmfmode" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'rfc2833\'">rfc2833</md-option>\n <md-option ng-value="\'info\'">info</md-option>\n <md-option ng-value="\'shortinfo\'">shortinfo</md-option>\n <md-option ng-value="\'inband\'">inband</md-option>\n <md-option ng-value="\'auto\'">auto</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DTMFMODE"></span></div>\n <div ng-messages="generalForm[\'dtmfmode\'].$error" ng-show="generalForm[\'dtmfmode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DTMFMODE_REQUIRED">dtmfmode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAT">nat</label>\n <md-select name="nat" ng-model="vm.trunk.nat" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'force_rport\'">force_rport</md-option>\n <md-option ng-value="\'comedia\'">comedia</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'never\'">never</md-option>\n <md-option ng-value="\'route\'">route</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.NAT"></span></div>\n <div ng-messages="generalForm[\'nat\'].$error" ng-show="generalForm[\'nat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAT_REQUIRED">nat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.QUALIFY">qualify</label>\n <md-select name="qualify" ng-model="vm.trunk.qualify" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.QUALIFY"></span></div>\n <div ng-messages="generalForm[\'qualify\'].$error" ng-show="generalForm[\'qualify\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.QUALIFY_REQUIRED">qualify field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ALLOWCODECS">AllowCodecs</label>\n <md-select name="allow" ng-model="vm.trunk.allow" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ulaw\'">ulaw</md-option>\n <md-option ng-value="\'alaw\'">alaw</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'g723\'">g723</md-option>\n <md-option ng-value="\'g726\'">g726</md-option>\n <md-option ng-value="\'g722\'">g722</md-option>\n <md-option ng-value="\'g729\'">g729</md-option>\n <md-option ng-value="\'ilbc\'">ilbc</md-option>\n <md-option ng-value="\'opus\'">opus</md-option>\n <md-option ng-value="\'h264\'">h264</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ALLOWCODECS"></span></div>\n <div ng-messages="generalForm[\'allow\'].$error" ng-show="generalForm[\'allow\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ALLOWCODECS_REQUIRED">AllowCodecs field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.INSECURE">insecure</label>\n <md-select name="insecure" ng-model="vm.trunk.insecure" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'port\'">port</md-option>\n <md-option ng-value="\'invite\'">invite</md-option>\n <md-option ng-value="\'very\'">very</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.INSECURE"></span></div>\n <div ng-messages="generalForm[\'insecure\'].$error" ng-show="generalForm[\'insecure\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.INSECURE_REQUIRED">insecure field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALL_LIMIT">call_limit</label>\n <input type="number" name="call_limit" ng-model="vm.trunk.call_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.CALL_LIMIT"></span></div>\n <div ng-messages="generalForm[\'call_limit\'].$error" ng-show="generalForm[\'call_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALL_LIMIT_REQUIRED">call_limit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.trunk.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.REGISTRY">registry</label>\n <input type="text" name="registry" ng-model="vm.trunk.registry" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.REGISTRY"></span></div>\n <div ng-messages="advancedForm[\'registry\'].$error" ng-show="advancedForm[\'registry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.REGISTRY_REQUIRED">registry field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DIRECTMEDIA">directmedia</label>\n <md-select name="directmedia" ng-model="vm.trunk.directmedia" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'nonat\'">nonat</md-option>\n <md-option ng-value="\'update\'">update</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.DIRECTMEDIA"></span></div>\n <div ng-messages="advancedForm[\'directmedia\'].$error" ng-show="advancedForm[\'directmedia\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DIRECTMEDIA_REQUIRED">directmedia field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.CALLCOUNTER">callcounter</label>\n <md-select name="callcounter" ng-model="vm.trunk.callcounter" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.CALLCOUNTER"></span></div>\n <div ng-messages="advancedForm[\'callcounter\'].$error" ng-show="advancedForm[\'callcounter\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.CALLCOUNTER_REQUIRED">callcounter field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMDOMAIN">fromdomain</label>\n <input type="text" name="fromdomain" ng-model="vm.trunk.fromdomain" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMDOMAIN"></span></div>\n <div ng-messages="advancedForm[\'fromdomain\'].$error" ng-show="advancedForm[\'fromdomain\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMDOMAIN_REQUIRED">fromdomain field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.FROMUSER">fromuser</label>\n <input type="text" name="fromuser" ng-model="vm.trunk.fromuser" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.FROMUSER"></span></div>\n <div ng-messages="advancedForm[\'fromuser\'].$error" ng-show="advancedForm[\'fromuser\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.FROMUSER_REQUIRED">fromuser field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.OUTBOUNDPROXY">outboundproxy</label>\n <input type="text" name="outboundproxy" ng-model="vm.trunk.outboundproxy" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.OUTBOUNDPROXY"></span></div>\n <div ng-messages="advancedForm[\'outboundproxy\'].$error" ng-show="advancedForm[\'outboundproxy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.OUTBOUNDPROXY_REQUIRED">outboundproxy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ADD_PHONE_TO_URI">Add_phone_to_URI</label>\n <md-select name="usereqphone" ng-model="vm.trunk.usereqphone" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ADD_PHONE_TO_URI"></span></div>\n <div ng-messages="advancedForm[\'usereqphone\'].$error" ng-show="advancedForm[\'usereqphone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ADD_PHONE_TO_URI_REQUIRED">Add_phone_to_URI field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRUST_REMOTE_PARTY_ID">Trust_Remote_Party_ID</label>\n <md-select name="trustrpid" ng-model="vm.trunk.trustrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRUST_REMOTE_PARTY_ID"></span></div>\n <div ng-messages="advancedForm[\'trustrpid\'].$error" ng-show="advancedForm[\'trustrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRUST_REMOTE_PARTY_ID_REQUIRED">Trust_Remote_Party_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.SEND_REMOTE_PARTY_ID_HEADER">Send_Remote_Party_ID_header</label>\n <md-select name="sendrpid" ng-model="vm.trunk.sendrpid" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n\n <md-option ng-value="\'pai\'"> {{ \'TOOLS.PAI\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.SEND_REMOTE_PARTY_ID_HEADER"></span></div>\n <div ng-messages="advancedForm[\'sendrpid\'].$error" ng-show="advancedForm[\'sendrpid\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.SEND_REMOTE_PARTY_ID_HEADER_REQUIRED">Send_Remote_Party_ID_header field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.ENCRYPTION">encryption</label>\n <md-select name="encryption" ng-model="vm.trunk.encryption" required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'TOOLS.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'TOOLS.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.ENCRYPTION"></span></div>\n <div ng-messages="advancedForm[\'encryption\'].$error" ng-show="advancedForm[\'encryption\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.ENCRYPTION_REQUIRED">encryption field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.PORT">port</label>\n <input type="number" name="port" ng-model="vm.trunk.port" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.PORT"></span></div>\n <div ng-messages="advancedForm[\'port\'].$error" ng-show="advancedForm[\'port\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.PORT_REQUIRED">port field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.TRANSPORT">Transport</label>\n <md-select name="transport" ng-model="vm.trunk.transport" multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'udp\'">udp</md-option>\n <md-option ng-value="\'tcp\'">tcp</md-option>\n <md-option ng-value="\'ws\'">ws</md-option>\n <md-option ng-value="\'wss\'">wss</md-option>\n <md-option ng-value="\'tls\'">tls</md-option>\n </md-select>\n <div class="hint"><span translate="TOOLS.HELP.TRANSPORT"></span></div>\n <div ng-messages="advancedForm[\'transport\'].$error" ng-show="advancedForm[\'transport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TRANSPORT_REQUIRED">Transport field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.T38PT_UDPTL">t38pt_udptl</label>\n <input type="string" name="t38pt_udptl" ng-model="vm.trunk.t38pt_udptl" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="TOOLS.HELP.T38PT_UDPTL"></span></div>\n <div ng-messages="advancedForm[\'t38pt_udptl\'].$error" ng-show="advancedForm[\'t38pt_udptl\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.T38PT_UDPTL_REQUIRED">t38pt_udptl field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.VIDEOSUPPORT">Videosupport</label>\n <md-select name="videosupport" ng-model="vm.trunk.videosupport" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'always\'">Always</md-option>\n </md-select>\n <div ng-messages="advancedForm[\'videosupport\'].$error" ng-show="advancedForm[\'videosupport\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.VIDEOSUPPORT_REQUIRED">Videosupport field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="TOOLS.OTHERFIELDS">OTHERFIELDS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="trunk-detail-form-container otherfields md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="TOOLS.OTHERFIELDS">OTHERFIELDS</div>\n </div>\n <form name="otherFieldsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="TOOLS.OTHERFIELDS">otherFields</label>\n <textarea name="otherFields" ng-model="vm.trunk.otherFields" autofocus></textarea>\n <div class="hint"><span translate="TOOLS.HELP.OTHERFIELDS"></span></div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/tools/views/trunks/trunks.html",'<div id="trunks" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.TRUNKS">Trunks</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedTrunks.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedTrunks =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-trunks-count">\n <span>{{vm.selectedTrunks.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="TRUNKS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllTrunks()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectTrunks()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedTrunks" csv-label="true" filename="trunks.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedTrunks($event)" aria-label="delete selected" translate translate-attr-label="TRUNKS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- TRUNK TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedTrunks" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="active">{{ \'TOOLS.ACTIVE\' | translate }}</th>\n <th md-column md-order-by="host">{{ \'TOOLS.HOST\' | translate }}</th>\n <th md-column md-order-by="registry">{{ \'TOOLS.REGISTRY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="trunk" md-select-id="id" ng-repeat="trunk in vm.trunks.rows">\n <td md-cell ng-if="trunk.userpic"><img class="avatar" alt="{{trunk.name}}" ng-src="api/users/{{trunk.id}}/avatar" /></td>\n <td md-cell ng-if="!trunk.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{trunk.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="id ">{{trunk.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="name ">{{trunk.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="active ">\n <md-icon md-colors="{color: {{trunk.active ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{trunk.active ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="host ">{{trunk.host}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="registry ">{{trunk.registry}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(trunk, ev) : vm.createOrEditTrunk($event, trunk)" md-cell class="description ">{{trunk.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(trunk, $event)" translate="TOOLS.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.clonedialog(trunk, $event)" translate="TOOLS.CLONE_TRUNK">\n clone Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(trunk, $event)" translate="TOOLS.GOTOREALTIME_TRUNK">\n goToRealtime Trunk\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(trunk, $event)" translate="TOOLS.DELETE_TRUNK">\n Delete Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.trunks.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / TRUNK TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD TRUNK BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-trunk-button" ng-click="vm.createOrEditTrunk($event)" aria-label="add trunk" translate translate-attr-aria-label="TOOLS.ADD_TRUNK">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD TRUNK BUTTON --\x3e\n</div>'),e.put("app/main/apps/tools/views/variables/create/dialog.html",'<md-dialog class="variable-dialog" aria-label="New Variable">\n <form name="variableForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLS.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.variable.name" ng-required="true" autofocus>\n\n <div ng-messages="variableForm[\'name\'].$error" ng-show="variableForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLS.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.variable.description">\n\n <div ng-messages="variableForm[\'description\'].$error" ng-show="variableForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVariable" ng-click="vm.saveVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid || variableForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVariable" ng-click="vm.addNewVariable()" class="send-button md-accent md-raised" ng-disabled="variableForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_VARIABLE" translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n ADD VARIABLE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVariable" ng-click="vm.deleteVariable($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/tools/views/variables/variables.html",'<div id="variables" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-auto-fix" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="TOOLS.VARIABLES">Variables</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="TOOLS.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVariables.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVariables =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="TOOLS.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-variables-count">\n <span>{{vm.selectedVariables.length}}</span>\n <span translate="TOOLS.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VARIABLES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVariables()" translate="TOOLS.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVariables()" translate="TOOLS.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVariables" csv-label="true" filename="variables.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVariables($event)" aria-label="delete selected" translate translate-attr-label="VARIABLES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VARIABLE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVariables" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVariables">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'TOOLS.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'TOOLS.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'TOOLS.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.variables.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="TOOLS.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="variable" md-select-id="id" ng-repeat="variable in vm.variables.rows">\n <td md-cell ng-if="variable.userpic"><img class="avatar" alt="{{variable.name}}" ng-src="api/users/{{variable.id}}/avatar" /></td>\n <td md-cell ng-if="!variable.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{variable.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="id ">{{variable.id}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="name ">{{variable.name}}</td>\n <td ng-click="vm.createOrEditVariable($event, variable)" md-cell class="description ">{{variable.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="TOOLS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(variable, $event)" translate="TOOLS.EDIT_VARIABLE">\n Edit Variable\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(variable, $event)" translate="TOOLS.DELETE_VARIABLE">\n Delete Variable\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'TOOLS.PAGE\' | translate}}:\', rowsPerPage: \'{{\'TOOLS.ROWSPERPAGE\' | translate}}:\', of: \'{{\'TOOLS.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.variables.count}}" md-on-paginate="vm.getVariables" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VARIABLE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VARIABLE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-variable-button" ng-click="vm.createOrEditVariable($event)" aria-label="add variable" translate translate-attr-aria-label="TOOLS.ADD_VARIABLE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VARIABLE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/chanSpies.html",'<div id="chanSpies" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CHANSPIES">ChanSpies</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedChanSpies.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedChanSpies =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-chanSpies-count">\n <span>{{vm.selectedChanSpies.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CHANSPIES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllChanSpies()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectChanSpies()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedChanSpies" csv-label="true" filename="chanSpies.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedChanSpies($event)" aria-label="delete selected" translate translate-attr-label="CHANSPIES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CHANSPY TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedChanSpies" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getChanSpies">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="prefix">{{ \'VOICE.PREFIX\' | translate }}</th>\n <th md-column md-order-by="auth">{{ \'VOICE.AUTH\' | translate }}</th>\n <th md-column md-order-by="record">{{ \'VOICE.RECORD\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.chanSpies.rows.length">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="chanSpy" md-select-id="id" ng-repeat="chanSpy in vm.chanSpies.rows">\n <td md-cell ng-if="chanSpy.userpic"><img class="avatar" alt="{{chanSpy.name}}" ng-src="api/users/{{chanSpy.id}}/avatar" /></td>\n <td md-cell ng-if="!chanSpy.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{chanSpy.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="id ">{{chanSpy.id}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="name ">{{chanSpy.name}}</td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="prefix ">{{chanSpy.prefix}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="auth ">\n <md-icon md-colors="{color: {{chanSpy.auth ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.auth ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chanSpy, ev) : vm.createOrEditchanSpy($event, chanSpy)" md-cell class="record ">\n <md-icon md-colors="{color: {{chanSpy.record ? \'\\\'green\\\'\' : \'\\\'grey\\\'\'}}}" md-font-icon="{{chanSpy.record ? \'icon-check\' : \'icon-close\'}}"></md-icon>\n </td>\n <td ng-click="vm.createOrEditchanSpy($event, chanSpy)" md-cell class="description ">{{chanSpy.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(chanSpy, $event)" translate="VOICE.EDIT_CHANSPY">\n Edit chanSpy\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(chanSpy, $event)" translate="VOICE.DELETE_CHANSPY">\n Delete chanSpy\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.chanSpies.count}}" md-on-paginate="vm.getChanSpies" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CHANSPY TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CHANSPY BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-chanSpy-button" ng-click="vm.createOrEditchanSpy($event)" aria-label="add chanSpy" translate translate-attr-aria-label="VOICE.ADD_CHANSPY">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CHANSPY BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/chanSpies/create/dialog.html",'<md-dialog class="chanSpy-dialog" aria-label="New chanSpy">\n <form name="chanSpyForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.chanSpy.name" ng-required="true" autofocus>\n\n <div ng-messages="chanSpyForm[\'name\'].$error" ng-show="chanSpyForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.chanSpy.prefix" ng-required="true">\n\n <div ng-messages="chanSpyForm[\'prefix\'].$error" ng-show="chanSpyForm[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <md-select name="options" ng-model="vm.chanSpy.options" multiple required>\n <md-option ng-value="\'b\'">b: Only spy on channels involved in a bridged call.</md-option>\n <md-option ng-value="\'B\'">B: Instead of whispering on a single channel barge in on both channels involved in the call.</md-option>\n <md-option ng-value="\'E\'">E: Exit when the spied-on channel hangs up.</md-option>\n <md-option ng-value="\'o\'">o: Only listen to audio coming from this channel.</md-option>\n <md-option ng-value="\'q\'">q: Don\'t play a beep when beginning to spy on a channel, or speak the selected channel name.</md-option>\n <md-option ng-value="\'s\'">s: Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.</md-option>\n <md-option ng-value="\'S\'">S: Stop when no more channels are left to spy on.</md-option>\n <md-option ng-value="\'w\'">w: Enable whisper mode, so the spying channel can talk to the spied-on channel.</md-option>\n <md-option ng-value="\'W\'">W: Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'options\'].$error" ng-show="chanSpyForm[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.auth" aria-label="Auth"><span translate="VOICE.AUTH">Auth</span></md-switch>\n </md-input-container>\n <md-input-container class="md-block" ng-if="vm.chanSpy.auth">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.chanSpy.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="chanSpyForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <md-switch ng-model="vm.chanSpy.record" aria-label="Record"><span translate="VOICE.RECORD">Record</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.chanSpy.record" class="md-block">\n <label translate="VOICE.RECORDINGFORMAT">recordingFormat</label>\n <md-select name="recordingFormat" ng-model="vm.chanSpy.recordingFormat" required>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n </md-select>\n <div ng-messages="chanSpyForm[\'recordingFormat\'].$error" ng-show="chanSpyForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDINGFORMAT_REQUIRED">recordingFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.chanSpy.description">\n\n <div ng-messages="chanSpyForm[\'description\'].$error" ng-show="chanSpyForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newchanSpy" ng-click="vm.savechanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid || chanSpyForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newchanSpy" ng-click="vm.addNewchanSpy()" class="send-button md-accent md-raised" ng-disabled="chanSpyForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CHANSPY" translate-attr-aria-label="VOICE.ADD_CHANSPY">\n ADD CHANSPY\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newchanSpy" ng-click="vm.deletechanSpy($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/contexts/contexts.html",'<div id="contexts" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.CONTEXTS">Contexts</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedContexts.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedContexts =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-contexts-count">\n <span>{{vm.selectedContexts.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="CONTEXTS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllContexts()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectContexts()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedContexts" csv-label="true" filename="contexts.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedContexts($event)" aria-label="delete selected" translate translate-attr-label="CONTEXTS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- CONTEXT TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedContexts" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContexts">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contexts.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="context" md-select-id="id" ng-repeat="context in vm.contexts.rows">\n <td md-cell ng-if="context.userpic"><img class="avatar" alt="{{context.name}}" ng-src="api/users/{{context.id}}/avatar" /></td>\n <td md-cell ng-if="!context.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{context.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="id ">{{context.id}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="name ">{{context.name}}</td>\n <td ng-click="vm.createOrEditContext($event, context)" md-cell class="description ">{{context.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(context, $event)" translate="VOICE.EDIT_CONTEXT">\n Edit Context\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(context, $event)" translate="VOICE.DELETE_CONTEXT">\n Delete Context\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contexts.count}}" md-on-paginate="vm.getContexts" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / CONTEXT TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD CONTEXT BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-context-button" ng-click="vm.createOrEditContext($event)" aria-label="add context" translate translate-attr-aria-label="VOICE.ADD_CONTEXT">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD CONTEXT BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/contexts/create/dialog.html",'<md-dialog class="context-dialog" aria-label="New Context">\n <form name="contextForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.context.name" ng-required="true" autofocus>\n\n <div ng-messages="contextForm[\'name\'].$error" ng-show="contextForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.context.description">\n\n <div ng-messages="contextForm[\'description\'].$error" ng-show="contextForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newContext" ng-click="vm.saveContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid || contextForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newContext" ng-click="vm.addNewContext()" class="send-button md-accent md-raised" ng-disabled="contextForm.$invalid" aria-label="ADD" translate="VOICE.ADD_CONTEXT" translate-attr-aria-label="VOICE.ADD_CONTEXT">\n ADD CONTEXT\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newContext" ng-click="vm.deleteContext($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/create/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="inboundrouteForm[\'exten\'].$error" ng-show="inboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteForm[\'context\'].$error" ng-show="inboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description">\n\n <div ng-messages="inboundrouteForm[\'description\'].$error" ng-show="inboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInboundRoute" ng-click="vm.saveInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid || inboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInboundRoute" ng-click="vm.addNewInboundRoute()" class="send-button md-accent md-raised" ng-disabled="inboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n ADD INBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInboundRoute" ng-click="vm.deleteInboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/agi/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'project\'].$error" ng-show="inboundrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'app\'].$error" ng-show="inboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/dial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'tech\'].$error" ng-show="inboundrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'trunk\'].$error" ng-show="inboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'phone\'].$error" ng-show="inboundrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/goto/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'context\'].$error" ng-show="inboundrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'extension\'].$error" ng-show="inboundrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'priority\'].$error" ng-show="inboundrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/hangup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }} </md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }} </md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }} </md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }} </md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }} </md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }} </md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }} </md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }} </md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }} </md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users" ng-disabled="user.canSelect === false">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'user\'].$error" ng-show="inboundrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/playback/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds" ng-disabled="appdata.canSelect === false">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'appdata\'].$error" ng-show="inboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/queue/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'queue\'].$error" ng-show="inboundrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'URL\'].$error" ng-show="inboundrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'sound\'].$error" ng-show="inboundrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'agi\'].$error" ng-show="inboundrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'macro\'].$error" ng-show="inboundrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'gosub\'].$error" ng-show="inboundrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'rule\'].$error" ng-show="inboundrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'position\'].$error" ng-show="inboundrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users" ng-disabled="multipleUsers.canSelect === false">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'multipleUsers\'].$error" ng-show="inboundrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'timeout\'].$error" ng-show="inboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'url\'].$error" ng-show="inboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/set/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="name.name" ng-repeat="name in vm.variables" ng-disabled="name.canSelect === false">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'name\'].$error" ng-show="inboundrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'value\'].$error" ng-show="inboundrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">\n <form name="inboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="inboundrouteFormApp[\'voiceMail\'].$error" ng-show="inboundrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="inboundrouteFormApp[\'options\'].$error" ng-show="inboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/inboundroutes/edit/view.html",'<div id="voice-inboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-inboundroutes-button md-icon-button" aria-label="Go to inboundroutes" ng-click="vm.gotoInboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="inboundroute-image" hide-xs>\n <img ng-src="assets/images/business/inboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.inboundroute.id}}\n <span ng-if="vm.inboundroute.name">{{vm.inboundroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.inboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.inboundroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.inboundroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.inboundroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="inboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.inboundroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInboundRouteApps.length}} {{vm_ac.selectedInboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedInboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.inboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.inboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/inboundroutes/inboundroutes.html",'<div id="inboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INBOUNDROUTES">InboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-inboundroutes-count">\n <span>{{vm.selectedInboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInboundRoutes" csv-label="true" filename="inboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="INBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.inboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="inboundroute" md-select-id="id" ng-repeat="inboundroute in vm.inboundroutes.rows">\n <td md-cell ng-if="inboundroute.userpic"><img class="avatar" alt="{{inboundroute.name}}" ng-src="api/users/{{inboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!inboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{inboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="id ">{{inboundroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="exten ">{{inboundroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(inboundroute, ev) : vm.createOrEditInboundRoute($event, inboundroute)" md-cell class="description ">{{inboundroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(inboundroute, $event)" translate="VOICE.EDIT_INBOUNDROUTE">\n Edit InboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(inboundroute, $event)" translate="VOICE.DELETE_INBOUNDROUTE">\n Delete InboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.inboundroutes.count}}" md-on-paginate="vm.getInboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INBOUNDROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-inboundroute-button" ng-click="vm.createOrEditInboundRoute($event)" aria-label="add inboundroute" translate translate-attr-aria-label="VOICE.ADD_INBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/internalroutes/create/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="internalrouteForm[\'exten\'].$error" ng-show="internalrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteForm[\'context\'].$error" ng-show="internalrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description">\n\n <div ng-messages="internalrouteForm[\'description\'].$error" ng-show="internalrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute" ng-click="vm.saveInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute" ng-click="vm.addNewInternalRoute()" class="send-button md-accent md-raised" ng-disabled="internalrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_INTERNALROUTE" translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n ADD INTERNALROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute" ng-click="vm.deleteInternalRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/agi/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PROJECT">Project</label>\n <md-select name="project" ng-model="vm.agi.project" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'agi://127.0.0.1/square,{{project.name}}\'" ng-repeat="project in vm.projects" ng-disabled="project.canSelect === false">{{ project.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'project\'].$error" ng-show="internalrouteFormApp[\'project\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PROJECT_REQUIRED">Project field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/custom/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'app\'].$error" ng-show="internalrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/dial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TECHNOLOGY/RESOURCE">Technology/Resource</label>\n <input type="text" name="tech" ng-model="vm.dial.tech" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'tech\'].$error" ng-show="internalrouteFormApp[\'tech\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TECHNOLOGY/RESOURCE_REQUIRED">Technology/Resource field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.dial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.dial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.dial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/externaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.externaldial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'trunk\'].$error" ng-show="internalrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONE">Phone</label>\n <input type="text" name="phone" ng-model="vm.externaldial.phone" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'phone\'].$error" ng-show="internalrouteFormApp[\'phone\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONE_REQUIRED">Phone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.externaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.externaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.externaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/goto/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.goto.context" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'context\'].$error" ng-show="internalrouteFormApp[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EXTENSION">Extension</label>\n <input type="text" name="extension" ng-model="vm.goto.extension" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'extension\'].$error" ng-show="internalrouteFormApp[\'extension\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EXTENSION_REQUIRED">Extension field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PRIORITY">Priority</label>\n <input type="text" name="priority" ng-model="vm.goto.priority" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'priority\'].$error" ng-show="internalrouteFormApp[\'priority\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PRIORITY_REQUIRED">Priority field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/hangup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.HANGUP_CAUSE">Hangup_Cause</label>\n <md-select name="appdata" ng-model="vm.hangup.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'1\'"> {{ \'VOICE.HANGUPCAUSE_1\' | translate }} </md-option>\n\n <md-option ng-value="\'16\'"> {{ \'VOICE.HANGUPCAUSE_16\' | translate }} </md-option>\n\n <md-option ng-value="\'17\'"> {{ \'VOICE.HANGUPCAUSE_17\' | translate }} </md-option>\n\n <md-option ng-value="\'18\'"> {{ \'VOICE.HANGUPCAUSE_18\' | translate }} </md-option>\n\n <md-option ng-value="\'21\'"> {{ \'VOICE.HANGUPCAUSE_21\' | translate }} </md-option>\n\n <md-option ng-value="\'22\'"> {{ \'VOICE.HANGUPCAUSE_22\' | translate }} </md-option>\n\n <md-option ng-value="\'27\'"> {{ \'VOICE.HANGUPCAUSE_27\' | translate }} </md-option>\n\n <md-option ng-value="\'38\'"> {{ \'VOICE.HANGUPCAUSE_38\' | translate }} </md-option>\n\n <md-option ng-value="\'41\'"> {{ \'VOICE.HANGUPCAUSE_41\' | translate }} </md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HANGUP_CAUSE_REQUIRED">Hangup_Cause field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/internaldial/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="user" ng-model="vm.internaldial.user" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{user.name}}\'" ng-repeat="user in vm.users" ng-disabled="user.canSelect === false">{{ user.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'user\'].$error" ng-show="internalrouteFormApp[\'user\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.internaldial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.internaldial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.internaldial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/playback/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.AUDIO_FILES">Audio_Files</label>\n <md-select name="appdata" ng-model="vm.playback.appdata" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{appdata.save_name}}\'" ng-repeat="appdata in vm.sounds" ng-disabled="appdata.canSelect === false">{{ appdata.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'appdata\'].$error" ng-show="internalrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUDIO_FILES_REQUIRED">Audio_Files field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.playback.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.playback.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/queue/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.QUEUE">Queue</label>\n <md-select name="queue" ng-model="vm.queue.queue" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues" ng-disabled="queue.canSelect === false">{{ queue.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'queue\'].$error" ng-show="internalrouteFormApp[\'queue\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.QUEUE_REQUIRED">Queue field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.queue.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="URL" ng-model="vm.queue.URL" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'URL\'].$error" ng-show="internalrouteFormApp[\'URL\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>\n <md-select name="sound" ng-model="vm.queue.sound" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}\'" ng-repeat="sound in vm.sounds" ng-disabled="sound.canSelect === false">{{ sound.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'sound\'].$error" ng-show="internalrouteFormApp[\'sound\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED">Announce_Overrides field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.queue.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AGI">Agi</label>\n <input type="text" name="agi" ng-model="vm.queue.agi" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'agi\'].$error" ng-show="internalrouteFormApp[\'agi\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AGI_REQUIRED">Agi field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MACRO">Macro</label>\n <input type="text" name="macro" ng-model="vm.queue.macro" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'macro\'].$error" ng-show="internalrouteFormApp[\'macro\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MACRO_REQUIRED">Macro field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.GOSUB">GoSub</label>\n <input type="text" name="gosub" ng-model="vm.queue.gosub" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'gosub\'].$error" ng-show="internalrouteFormApp[\'gosub\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.GOSUB_REQUIRED">GoSub field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RULE">Rule</label>\n <input type="text" name="rule" ng-model="vm.queue.rule" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'rule\'].$error" ng-show="internalrouteFormApp[\'rule\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RULE_REQUIRED">Rule field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.POSITION">Position</label>\n <input type="number" name="position" ng-model="vm.queue.position" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'position\'].$error" ng-show="internalrouteFormApp[\'position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.POSITION_REQUIRED">Position field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Position must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.queue.answer" aria-label="Answer" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.ANSWER">Answer</span></md-switch>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/ringgroup/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.USER">User</label>\n <md-select name="multipleUsers" ng-model="vm.ringgroup.multipleUsers" autofocus multiple required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'SIP/{{multipleUsers.name}}\'" ng-repeat="multipleUsers in vm.users" ng-disabled="multipleUsers.canSelect === false">{{ multipleUsers.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'multipleUsers\'].$error" ng-show="internalrouteFormApp[\'multipleUsers\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.USER_REQUIRED">User field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.ringgroup.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'timeout\'].$error" ng-show="internalrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.ringgroup.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.ringgroup.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'url\'].$error" ng-show="internalrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/set/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.VARIABLE">Variable</label>\n <md-select name="name" ng-model="vm.set.name" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="name.name" ng-repeat="name in vm.variables" ng-disabled="name.canSelect === false">{{ name.name }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'name\'].$error" ng-show="internalrouteFormApp[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VARIABLE_REQUIRED">Variable field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VALUE">Value</label>\n <input type="text" name="value" ng-model="vm.set.value" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'value\'].$error" ng-show="internalrouteFormApp[\'value\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VALUE_REQUIRED">Value field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/apps/voicemail/dialog.html",'<md-dialog class="internalroute-dialog" aria-label="New InternalRoute">\n <form name="internalrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX@CONTEXT">Mailbox@Context</label>\n <md-select name="voiceMail" ng-model="vm.voicemail.voiceMail" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'{{voiceMail.mailbox}}@from-voicemail\'" ng-repeat="voiceMail in vm.voiceMails" ng-disabled="voiceMail.canSelect === false">{{ voiceMail.mailbox }}</md-option>\n </md-select>\n <div ng-messages="internalrouteFormApp[\'voiceMail\'].$error" ng-show="internalrouteFormApp[\'voiceMail\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX@CONTEXT_REQUIRED">Mailbox@Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.voicemail.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="internalrouteFormApp[\'options\'].$error" ng-show="internalrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveInternalRouteApp()" class="send-button md-accent md-raised" ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/internalroutes/edit/view.html",'<div id="voice-internalroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-internalroutes-button md-icon-button" aria-label="Go to internalroutes" ng-click="vm.gotoInternalRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_INTERNALROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="internalroute-image" hide-xs>\n <img ng-src="assets/images/business/internalroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.internalroute.id}}\n <span ng-if="vm.internalroute.name">{{vm.internalroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.internalroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveInternalRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internalroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.internalroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.internalroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.internalroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="internalroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="InternalRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.internalroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedInternalRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedInternalRouteApps.length}} {{vm_ac.selectedInternalRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedInternalRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedInternalRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.internalrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editInternalRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInternalRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.internalrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/internalroutes/internalroutes.html",'<div id="internalroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.INTERNALROUTES">InternalRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedInternalRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedInternalRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-internalroutes-count">\n <span>{{vm.selectedInternalRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="INTERNALROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllInternalRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectInternalRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedInternalRoutes" csv-label="true" filename="internalroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedInternalRoutes($event)" aria-label="delete selected" translate translate-attr-label="INTERNALROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- INTERNALROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedInternalRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getInternalRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.internalroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="internalroute" md-select-id="id" ng-repeat="internalroute in vm.internalroutes.rows">\n <td md-cell ng-if="internalroute.userpic"><img class="avatar" alt="{{internalroute.name}}" ng-src="api/users/{{internalroute.id}}/avatar" /></td>\n <td md-cell ng-if="!internalroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{internalroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="id ">{{internalroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="exten ">{{internalroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(internalroute, ev) : vm.createOrEditInternalRoute($event, internalroute)" md-cell class="description ">{{internalroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(internalroute, $event)" translate="VOICE.EDIT_INTERNALROUTE">\n Edit InternalRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(internalroute, $event)" translate="VOICE.DELETE_INTERNALROUTE">\n Delete InternalRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.internalroutes.count}}" md-on-paginate="vm.getInternalRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / INTERNALROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD INTERNALROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-internalroute-button" ng-click="vm.createOrEditInternalRoute($event)" aria-label="add internalroute" translate translate-attr-aria-label="VOICE.ADD_INTERNALROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD INTERNALROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/musiconholds/create/dialog.html",'<md-dialog class="musiconhold-dialog" aria-label="New MusicOnHold">\n <form name="musiconholdForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus ng-disabled="!vm.newMusicOnHold">\n\n <div ng-messages="musiconholdForm[\'name\'].$error" ng-show="musiconholdForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required ng-disabled="!vm.newMusicOnHold">\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'mode\'].$error" ng-show="musiconholdForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory">\n\n <div ng-messages="musiconholdForm[\'directory\'].$error" ng-show="musiconholdForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true">\n\n <div ng-messages="musiconholdForm[\'application\'].$error" ng-show="musiconholdForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="musiconholdForm[\'sort\'].$error" ng-show="musiconholdForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMusicOnHold" ng-click="vm.saveMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid || musiconholdForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMusicOnHold" ng-click="vm.addNewMusicOnHold()" class="send-button md-accent md-raised" ng-disabled="musiconholdForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MUSICONHOLD" translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n ADD MUSICONHOLD\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMusicOnHold" ng-click="vm.deleteMusicOnHold($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/mohSounds/dialog.html",'<md-dialog class="mohSound-dialog" aria-label="New MohSound">\n <form name="mohSoundForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FILE">File</label>\n <md-select name="id" ng-model="vm.mohSound.id" autofocus>\n <md-option ng-value="id.id" ng-repeat="id in vm.sounds" ng-disabled="id.canSelect === false">{{ id.name }}</md-option>\n </md-select>\n <div ng-messages="mohSoundForm[\'id\'].$error" ng-show="mohSoundForm[\'id\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FILE_REQUIRED">File field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newMohSound" ng-click="vm.saveMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid || mohSoundForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newMohSound" ng-click="vm.addNewMohSound()" class="send-button md-accent md-raised" ng-disabled="mohSoundForm.$invalid" aria-label="ADD" translate="VOICE.ADD_MOHSOUND" translate-attr-aria-label="VOICE.ADD_MOHSOUND">\n ADD MOHSOUND\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newMohSound" ng-click="vm.deleteMohSound($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/musiconholds/edit/view.html",'<div id="voice-musiconhold" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-musiconholds-button md-icon-button" aria-label="Go to musiconholds" ng-click="vm.gotoMusicOnHolds()" translate translate-attr-aria-label="VOICE.GO_TO_MUSICONHOLDS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="musiconhold-image" hide-xs>\n <img ng-src="assets/images/business/musiconholds.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.musiconhold.id}}\n <span ng-if="vm.musiconhold.name">{{vm.musiconhold.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.musiconhold.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveMusicOnHold()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (mohSoundsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.musiconhold.name" ng-required="true" autofocus disabled>\n\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MODE">Mode</label>\n <md-select name="mode" ng-model="vm.musiconhold.mode" required disabled>\n\n <md-option ng-value="\'files\'"> {{ \'VOICE.FILES\' | translate }} </md-option>\n\n <md-option ng-value="\'custom\'"> {{ \'VOICE.CUSTOM\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'mode\'].$error" ng-show="generalForm[\'mode\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MODE_REQUIRED">Mode field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.DIRECTORY">Directory</label>\n <input type="" name="directory" ng-model="vm.musiconhold.directory" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'directory\'].$error" ng-show="generalForm[\'directory\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DIRECTORY_REQUIRED">Directory field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'custom\'" class="md-block">\n <label translate="VOICE.APPLICATION">Application</label>\n <input type="text" name="application" ng-model="vm.musiconhold.application" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'application\'].$error" ng-show="generalForm[\'application\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_REQUIRED">Application field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container ng-if="vm.musiconhold.mode == \'files\'" class="md-block">\n <label translate="VOICE.SORT">Sort</label>\n <md-select name="sort" ng-model="vm.musiconhold.sort" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'random\'"> {{ \'VOICE.RANDOM\' | translate }} </md-option>\n\n <md-option ng-value="\'alpha\'"> {{ \'VOICE.ALPHABETICAL\' | translate }} </md-option>\n </md-select>\n <div ng-messages="generalForm[\'sort\'].$error" ng-show="generalForm[\'sort\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SORT_REQUIRED">Sort field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AUDIOFILES">AUDIOFILES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="musiconhold-detail-form-container mohsounds md-background-bg md-whiteframe-1dp">\n <div ng-controller="MusicOnHoldMohSoundsController as vm_dc" ng-init="vm_dc.init(vm.musiconhold, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MOHSOUNDS">MohSounds</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n <md-button ng-if="vm_dc.crudPermissions.canEdit" class="md-icon-button" ng-click="vm_dc.createOrEditMusicOnHoldMohSound($event)" aria-label="add mohSound" translate translate-attr-label="VOICE.ADD_MOHSOUND">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedMusicOnHoldMohSounds.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedMusicOnHoldMohSounds.length}} {{vm_dc.selectedMusicOnHoldMohSounds.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedMusicOnHoldMohSounds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedMusicOnHoldMohSounds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedMusicOnHoldMohSounds" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getMusicOnHoldMohSounds">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.CREATED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="mohSound" md-select-id="id" ng-repeat="mohSound in vm_dc.musiconholdMohSounds.rows">\n <td md-cell>{{mohSound.id}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="mohSound.id" model="\'sound\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{mohSound.createdAt | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMusicOnHoldDownload(mohSound, $event)" translate="VOICE.DOWNLOAD_MOHSOUND">\n Download MohSound\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(mohSound, $event)" translate="VOICE.DELETE_MOHSOUND">\n Delete MohSound\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.musiconholdMohSounds.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MOHSOUND_AVAILABLE">No mohsound available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.musiconholdMohSounds.count}}" md-on-paginate="vm_dc.getMusicOnHoldMohSounds" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/musiconholds/musiconholds.html",'<div id="musiconholds" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.MUSICONHOLDS">MusicOnHolds</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedMusicOnHolds.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedMusicOnHolds =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-musiconholds-count">\n <span>{{vm.selectedMusicOnHolds.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="MUSICONHOLDS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllMusicOnHolds()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectMusicOnHolds()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedMusicOnHolds" csv-label="true" filename="musiconholds.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedMusicOnHolds($event)" aria-label="delete selected" translate translate-attr-label="MUSICONHOLDS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- MUSICONHOLD TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedMusicOnHolds" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getMusicOnHolds">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="mode">{{ \'VOICE.MODE\' | translate }}</th>\n <th md-column md-order-by="sort">{{ \'VOICE.SORT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.musiconholds.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="musiconhold" md-select-id="id" ng-repeat="musiconhold in vm.musiconholds.rows">\n <td md-cell ng-if="musiconhold.userpic"><img class="avatar" alt="{{musiconhold.name}}" ng-src="api/users/{{musiconhold.id}}/avatar" /></td>\n <td md-cell ng-if="!musiconhold.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{musiconhold.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="id ">{{musiconhold.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="name ">{{musiconhold.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="mode ">{{ \'VOICE.\' + vm.arraymode[musiconhold.mode].option | uppercase | translate }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(musiconhold, ev) : vm.createOrEditMusicOnHold($event, musiconhold)" md-cell class="sort ">{{ \'VOICE.\' + vm.arraysort[musiconhold.sort].option | uppercase | translate }}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(musiconhold, $event)" translate="VOICE.EDIT_MUSICONHOLD">\n Edit MusicOnHold\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(musiconhold, $event)" translate="VOICE.DELETE_MUSICONHOLD">\n Delete MusicOnHold\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.musiconholds.count}}" md-on-paginate="vm.getMusicOnHolds" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / MUSICONHOLD TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD MUSICONHOLD BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-musiconhold-button" ng-click="vm.createOrEditMusicOnHold($event)" aria-label="add musiconhold" translate translate-attr-aria-label="VOICE.ADD_MUSICONHOLD">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD MUSICONHOLD BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/create/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus>\n\n <div ng-messages="outboundrouteForm[\'exten\'].$error" ng-show="outboundrouteForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required>\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteForm[\'context\'].$error" ng-show="outboundrouteForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required>\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="outboundrouteForm[\'recordingFormat\'].$error" ng-show="outboundrouteForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0">\n\n <div ng-messages="outboundrouteForm[\'cutdigits\'].$error" ng-show="outboundrouteForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description">\n\n <div ng-messages="outboundrouteForm[\'description\'].$error" ng-show="outboundrouteForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute" ng-click="vm.saveOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute" ng-click="vm.addNewOutboundRoute()" class="send-button md-accent md-raised" ng-disabled="outboundrouteForm.$invalid" aria-label="ADD" translate="VOICE.ADD_OUTBOUNDROUTE" translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n ADD OUTBOUNDROUTE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute" ng-click="vm.deleteOutboundRoute($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/custom/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.APPLICATION_NAME">Application_Name</label>\n <input type="text" name="app" ng-model="vm.custom.app" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'app\'].$error" ng-show="outboundrouteFormApp[\'app\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.APPLICATION_NAME_REQUIRED">Application_Name field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ARGUMENTS">Arguments</label>\n <input type="text" name="appdata" ng-model="vm.custom.appdata" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'appdata\'].$error" ng-show="outboundrouteFormApp[\'appdata\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ARGUMENTS_REQUIRED">Arguments field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/interval/dialog.html",'<md-dialog class="inboundroute-dialog" aria-label="New Interval">\n <form name="intervalForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n\n\n <md-input-container class="md-block">\n <label translate="TOOLS.TYPE">Type</label>\n <md-select ng-model="vm.type" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="type" ng-repeat=\'type in vm.types\'>{{ type | ucfirst }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.type === \'list\'">\n <label translate="TOOLS.INTERVALS">Intervals</label>\n <md-select ng-model="vm.interval.IntervalId" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals">{{ interval.name }}</md-option>\n </md-select>\n </md-input-container>\n\n \x3c!-- TIMERANGE START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.TIME_RANGE">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <div class="md-block" flex>\n <mdp-time-picker name="timeRangeFrom" mdp-placeholder="FROM" ng-model="vm.timeRangeFrom" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <div ng-messages="intervalForm.timeRangeFrom.$error" ng-show="intervalForm.timeRangeFrom.$touched" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID">Time Range From field is invalid</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n <div class="md-block" flex ng-if="vm.timeRangeFrom">\n <mdp-time-picker name="timeRangeTo" mdp-placeholder="TO*" ng-model="vm.timeRangeTo" mdp-format="HH:mm" mdp-auto-switch="true" mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit" required>\n <div ng-messages="intervalForm.timeRangeTo.$error" ng-show="intervalForm.timeRangeTo.$invalid" role="alert">\n <div ng-message="format">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID">Time Range To field is invalid</span>\n </div>\n <div ng-message="required">\n <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED">Time Range To field is required</span>\n </div>\n </div>\n </mdp-time-picker>\n </div>\n </div>\n \x3c!-- TIMERANGE END --\x3e\n\n \x3c!-- DAYSOFWEEK START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.WEEK_DAYS">Week Days</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.dayOfWeekFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="dayOfWeekTo" ng-model="vm.dayOfWeekTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"><span translate="TOOLS.{{day.value | uppercase}}">{{ day.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.dayOfWeekTo.$error" ng-show="intervalForm.dayOfWeekTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- DAYSOFWEEK END --\x3e\n\n \x3c!-- MONTHDAY START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTH_DAYS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthDayFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthDayFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthDayTo" ng-model="vm.monthDayTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth">{{ month }}</md-option>\n </md-select>\n <div ng-messages="intervalForm.monthDayTo.$error" ng-show="intervalForm.monthDayTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTHDAY END --\x3e\n\n \x3c!-- MONTH START --\x3e\n <label ng-if="vm.type === \'custom\'" translate="TOOLS.MONTHS">Time Range</label>\n <div layout=row ng-if="vm.type === \'custom\'">\n <md-input-container flex layout="column" class="md-block">\n <label translate="TOOLS.FROM">From</label>\n <md-select ng-model="vm.monthFrom" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="null"><span translate="TOOLS.ALWAYS">Always</span></md-option>\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n\n </md-input-container>\n\n <md-input-container flex layout="column" class="md-block" ng-if="vm.monthFrom">\n <label translate="TOOLS.TO">To</label>\n <md-select name="monthTo" ng-model="vm.monthTo" ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit">\n <md-option ng-value="month.value" ng-repeat="month in vm.monthName"><span translate="TOOLS.{{month.value | uppercase}}">{{ month.value | ucfirst }}</span></md-option>\n </md-select>\n <div ng-messages="intervalForm.monthTo.$error" ng-show="intervalForm.monthTo.$touched" role="alert">\n </div>\n </md-input-container>\n </div>\n \x3c!-- MONTH END --\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="!vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.saveInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid || intervalForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.newInterval && vm.crudPermissions.canEdit" ng-click="vm.addNewInterval()" class="send-button md-accent md-raised" ng-disabled="intervalForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_INTERVAL" translate-attr-aria-label="TOOLS.ADD_INTERVAL">\n ADD INTERVAL\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/apps/outbounddial/dialog.html",'<md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">\n <form name="outboundrouteFormApp" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.TRUNK">Trunk</label>\n <md-select name="trunk" ng-model="vm.outbounddial.trunk" autofocus required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="trunk.name" ng-repeat="trunk in vm.trunks" ng-disabled="trunk.canSelect === false">{{ trunk.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'trunk\'].$error" ng-show="outboundrouteFormApp[\'trunk\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TRUNK_REQUIRED">Trunk field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLER_ID">Caller_ID</label>\n <input type="text" name="callerID" ng-model="vm.outbounddial.callerID" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>\n <div ng-messages="outboundrouteFormApp[\'callerID\'].$error" ng-show="outboundrouteFormApp[\'callerID\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED">Caller_ID field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PREFIX">Prefix</label>\n <input type="text" name="prefix" ng-model="vm.outbounddial.prefix" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'prefix\'].$error" ng-show="outboundrouteFormApp[\'prefix\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PREFIX_REQUIRED">Prefix field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TAGS">Tags</label>\n <md-select name="tag" ng-model="vm.outbounddial.tag" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'--\'">None</md-option>\n <md-option ng-value="tag.name" ng-repeat="tag in vm.tags" ng-disabled="tag.canSelect === false">{{ tag.name }}</md-option>\n </md-select>\n <div ng-messages="outboundrouteFormApp[\'tag\'].$error" ng-show="outboundrouteFormApp[\'tag\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TAGS_REQUIRED">Tags field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.outbounddial.timeout" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'timeout\'].$error" ng-show="outboundrouteFormApp[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OPTIONS">Options</label>\n <input type="text" name="options" ng-model="vm.outbounddial.options" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'options\'].$error" ng-show="outboundrouteFormApp[\'options\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OPTIONS_REQUIRED">Options field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.URL">Url</label>\n <input type="text" name="url" ng-model="vm.outbounddial.url" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="outboundrouteFormApp[\'url\'].$error" ng-show="outboundrouteFormApp[\'url\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.URL_REQUIRED">Url field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center" ng-if="vm.crudPermissions.canEdit">\n <md-button type="submit" ng-click="vm.saveOutboundRouteApp()" class="send-button md-accent md-raised" ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/outboundroutes/edit/view.html",'<div id="voice-outboundroute" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-outboundroutes-button md-icon-button" aria-label="Go to outboundroutes" ng-click="vm.gotoOutboundRoutes()" translate translate-attr-aria-label="VOICE.GO_TO_OUTBOUNDROUTES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="outboundroute-image" hide-xs>\n <img ng-src="assets/images/business/outboundroutes.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.outboundroute.id}}\n <span ng-if="vm.outboundroute.name">{{vm.outboundroute.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.outboundroute.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveOutboundRoute()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (actionsForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outboundroute-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PHONENUMBER">PhoneNumber</label>\n <input type="text" name="exten" ng-model="vm.outboundroute.exten" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'exten\'].$error" ng-show="generalForm[\'exten\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED">PhoneNumber field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <md-select name="context" ng-model="vm.outboundroute.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RECORDING">Recording</label>\n <md-select name="recordingFormat" ng-model="vm.outboundroute.recordingFormat" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'none\'">none</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'WAV\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>\n <div ng-messages="generalForm[\'recordingFormat\'].$error" ng-show="generalForm[\'recordingFormat\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RECORDING_REQUIRED">Recording field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CUTDIGITS">CutDigits</label>\n <input type="number" name="cutdigits" ng-model="vm.outboundroute.cutdigits" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'cutdigits\'].$error" ng-show="generalForm[\'cutdigits\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED">CutDigits field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">CutDigits must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.outboundroute.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ACTIONS">ACTIONS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="outboundroute-detail-form-container actions md-background-bg md-whiteframe-1dp">\n <div ng-controller="OutboundRouteActionsController as vm_ac" ng-init="vm_ac.init(vm.outboundroute, vm.crudPermissions)" class="content" md-background-bg layout="row" layout-align="start start">\n \x3c!-- SIDENAV --\x3e\n <div class="navigation-simple sidenav main-sidenav md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="20" ng-if="vm_ac.crudPermissions.canEdit">\n \x3c!-- SIDENAV CONTENT --\x3e\n <md-list class="no-padding">\n <md-subheader class="md-no-sticky">\n <span translate="VOICE.APPLICATIONS_LIST">\n Applications List\n </span>\n </md-subheader>\n </md-list>\n <md-divider></md-divider>\n <md-list ng-sortable="vm_ac.list">\n <md-list-item class="handle" ng-repeat="a in vm_ac.apps">\n <md-icon md-font-icon="{{a.icon}}" class="s16"></md-icon>\n <p class="text-truncate" translate="VOICE.{{(a.alias || a.appType) | uppercase}}">{{a.alias || a.appType}}</p>\n </md-list-item>\n </md-list>\n \x3c!-- / SIDENAV CONTENT --\x3e\n </div>\n \x3c!-- / SIDENAV --\x3e\n <div flex></div>\n \x3c!-- MAIN --\x3e\n <div class="main scrollable md-background-bg md-whiteframe-1dp" ms-scroll layout="column" flex="{{vm_ac.crudPermissions.canEdit ? 75 : 100}}">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">Drag & Drop Routing</span>\n <div flex></div>\n <ms-search-bar on-search="vm_ac.query.filter = query" on-collapse="vm_ac.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_ac.selectedOutboundRouteApps.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_ac.selectedOutboundRouteApps.length}} {{vm_ac.selectedOutboundRouteApps.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <md-button ng-if="vm_ac.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_ac.deleteSelectedOutboundRouteApps($event)" aria-label="delete selected" translate translate-attr-label="VOICE.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n \x3c!-- QUEUES TABLE --\x3e\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_ac.selectedOutboundRouteApps">\n <thead md-head>\n <tr md-row>\n <th md-column width="10px"></th>\n <th md-column>\n <span>Type</span>\n </th>\n <th md-column>\n <span>Appdata</span>\n </th>\n <th md-column>\n <span>Interval</span>\n </th>\n <th md-column width="10px"></th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body ng-sortable="vm_ac.applications">\n <tr md-row md-select="app" md-select-id="id" ng-repeat="app in vm_ac.outboundrouteApps.rows | filter: vm_ac.query.filter">\n <td md-cell>\n <md-icon md-font-icon="icon-drag-vertical" class="s16 handle"></md-icon>\n </td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)">{{app.app.toLowerCase() === \'agi\' ? \'Cally-Square\' : app.app | ucfirst}}<span ng-if="app.appType.toLowerCase() === \'custom\'">*</span></td>\n <td md-cell ng-click="vm_ac.editOutboundRouteApp($event, $index)"><span class="text-truncate" style="width:200px">{{app.appdata}}</span></td>\n <td md-cell ng-click="vm_ac.editInterval($event, $index)">{{app.IntervalId ? \'From List\' : app.interval}}</td>\n <td md-cell>\n <md-button ng-click="vm_ac.editInterval($event, $index)" class="md-icon-button" aria-label="Interval">\n <md-icon md-font-icon="icon-timer"></md-icon>\n <md-tooltip>\n {{app.IntervalId ? \'From List\' : (app.interval === \'*,*,*,*\' ? \'Always\' : \'Custom\')}}\n </md-tooltip>\n </md-button>\n </td>\n <td md-cell class="actions" ng-if="!vm_ac.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editOutboundRouteApp($event, $index)" translate="VOICE.EDIT_APP">\n Edit App\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canEdit">\n <md-button ng-click="vm_ac.editInterval($event, $index)" translate="VOICE.EDIT_INTERVAL">\n Edit Interval\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_ac.crudPermissions.canDelete">\n <md-button ng-click="vm_ac.deleteConfirm(app, $index, $event)" translate="VOICE.DELETE_APP">\n Delete App\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-hide="vm_ac.outboundrouteApps.rows.length">\n <td md-cell colspan="6">\n <span class="text-boxed-ligth" translate="VOICE.NO_APPS_AVAILABLE">No apps available</span>\n </td>\n </tr>\n </tbody>\n <tfoot md-foot>\n <tr md-row>\n <td md-cell colspan="7">\n <span><em translate="VOICE.LEGEND.CUSTOM_APPLICATION">(*) - Custom application.</em></span>\n </td>\n </tr>\n </tfoot>\n </table>\n </md-table-container>\n \x3c!-- / QUEUES TABLE --\x3e\n\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/outboundroutes/outboundroutes.html",'<div id="outboundroutes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.OUTBOUNDROUTES">OutboundRoutes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedOutboundRoutes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedOutboundRoutes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-outboundroutes-count">\n <span>{{vm.selectedOutboundRoutes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="OUTBOUNDROUTES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllOutboundRoutes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectOutboundRoutes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedOutboundRoutes" csv-label="true" filename="outboundroutes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedOutboundRoutes($event)" aria-label="delete selected" translate translate-attr-label="OUTBOUNDROUTES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- OUTBOUNDROUTE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedOutboundRoutes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getOutboundRoutes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.PHONENUMBER\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.outboundroutes.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="outboundroute" md-select-id="id" ng-repeat="outboundroute in vm.outboundroutes.rows">\n <td md-cell ng-if="outboundroute.userpic"><img class="avatar" alt="{{outboundroute.name}}" ng-src="api/users/{{outboundroute.id}}/avatar" /></td>\n <td md-cell ng-if="!outboundroute.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{outboundroute.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="id ">{{outboundroute.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="exten ">{{outboundroute.exten}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(outboundroute, ev) : vm.createOrEditOutboundRoute($event, outboundroute)" md-cell class="description ">{{outboundroute.description}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(outboundroute, $event)" translate="VOICE.EDIT_OUTBOUNDROUTE">\n Edit OutboundRoute\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(outboundroute, $event)" translate="VOICE.DELETE_OUTBOUNDROUTE">\n Delete OutboundRoute\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.outboundroutes.count}}" md-on-paginate="vm.getOutboundRoutes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / OUTBOUNDROUTE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD OUTBOUNDROUTE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-outboundroute-button" ng-click="vm.createOrEditOutboundRoute($event)" aria-label="add outboundroute" translate translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD OUTBOUNDROUTE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/abandonedcalls/view.html",' <md-toolbar class="md-table-toolbar md-default table-header">\n <div class="md-toolbar-tools" layout="row" layout-align="center center">\n <span class="md-subhead" translate="DASHBOARDS.ABANDONEDQUEUECALLS">ABANDONED QUEUE CALLS</span>\n <ms-search-bar on-search="vm.query.filter = query" on-collapse="vm.query.filter = undefined" debounce="300"></ms-search-bar>\n <div flex></div>\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE">Select a date</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearAll()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.DELETE\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 black-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getContacts()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n <div class="padding-horizontal-20" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_AGENT">Select an agent</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.lastAssignedTo" ng-change="vm.getContacts()">\n <md-option ng-value="\'null\'" translate="DASHBOARDS.NOT_ASSIGNED"></md-option>\n <md-option ng-value="undefined" translate="DASHBOARDS.ALL"></md-option>\n <md-option ng-value="agent.name" ng-repeat="agent in vm.agents.rows">{{agent.name}}</md-option>\n </md-select>\n </div>\n <div ng-if="vm.queues.count" layout="column">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_CAMPAIGN">Select a Campaign</span>\n <md-select class="font-size-12 no-margin" ng-model="vm.query.queue" ng-change="vm.getContacts()">\n <md-option ng-value="undefined" ng-if="vm.queues.count > 1"><em translate="DASHBOARDS.ALL">All</em></md-option>\n <md-option ng-value="queue.name" ng-repeat="queue in vm.queues.rows">{{queue.name}}</md-option>\n </md-select>\n </div>\n <md-button class="md-icon-button" ng-click="vm.refresh && vm.refreshContacts($event)" aria-label="Reload" translate translate-attr-label="DASHBOARDS.RELOAD">\n <md-icon md-font-icon="icon-reload"></md-icon>\n <md-tooltip ng-if="vm.showTooltip" md-visible="vm.showTooltip">{{\'DASHBOARDS.CLICKRELOAD\' | translate}}</md-tooltip>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getContacts">\n <tr md-row>\n <th md-column md-order-by="id">ID</th>\n <th md-column md-order-by="calleridname">{{\'DASHBOARDS.FULLNAME\' | translate}}</th>\n <th md-column md-order-by="calleridnum">{{\'DASHBOARDS.PHONE\' | translate}}</th>\n <th md-column md-order-by="queue">{{\'DASHBOARDS.QUEUE\' | translate}}</th>\n <th md-column md-order-by="queuecallerabandonAt">{{\'DASHBOARDS.ABANDONAT\' | translate}}</th>\n <th md-column md-order-by="lastAssignedTo">{{\'DASHBOARDS.LASTASSIGNEDTO\' | translate}}</th>\n <th md-column md-order-by="disposition">{{\'DASHBOARDS.DISPOSITION\' | translate}}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.contacts.rows.length">\n <td md-cell colspan="10">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="contact in vm.contacts.rows">\n <td md-cell class="id">{{contact.id}}</td>\n <td md-cell class="firstName">{{contact.calleridname}}</td>\n <td md-cell class="list">{{contact.calleridnum}}</td>\n <td md-cell class="list">{{vm.queuesMap[contact.queue]}}</td>\n <td md-cell class="list">{{contact.queuecallerabandonAt ? (contact.queuecallerabandonAt | formatdate) : undefined }}</td>\n <td md-cell class="list">{{contact.lastAssignedTo}}</td>\n <td md-cell class="list">{{contact.disposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="DASHBOARDS.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="2">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.ASSIGNTO">Assigned a</md-button>\n <md-menu-content>\n <md-menu-item ng-if="contact.lastAssignedTo">\n <md-button ng-click="vm.assignedA(contact)"><em translate="DASHBOARDS.NONE">Not Assigned</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.agents.rows.length" ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.assignedA(contact,agent)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" class="text-capitalize" translate="DASHBOARDS.DISPOSE">Dispose</md-button>\n <md-menu-content>\n <md-menu-item ng-if="vm.dispositions.length > 0" ng-repeat="disposition in vm.dispositions">\n <md-button ng-click="vm.disposed(contact, disposition.name)">{{disposition.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.contacts.count}}" md-on-paginate="vm.getContacts" md-page-select></md-table-pagination>'),e.put("app/main/apps/voice/views/realtime/agents/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.AGENTS">Agents</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query; vm.onInit()" on-collapse="vm.query.filter = undefined; vm.onInit()" debounce="300"></ms-search-bar>\n <md-select ng-model="vm.query.globalStatusFilter" class="md-caption" ng-change="vm.query.pauseTypeFilter = \'\'; vm.onInit()">\n <md-option ng-value="\'\'">{{ \'VOICE.ALL\' | translate }}</md-option>\n <md-option value="pause">{{ \'VOICE.PAUSE\' | translate }}</md-option>\n <md-option value="*pause">{{ \'VOICE.PARTIALPAUSE\' | translate }}</md-option>\n <md-option value="busy">{{ \'VOICE.BUSY\' | translate }}</md-option>\n <md-option value="idle">{{ \'VOICE.IDLE\' | translate }}</md-option>\n </md-select>\n\n <md-select ng-if="vm.isPause(vm.query.globalStatusFilter)" ng-model="vm.query.pauseTypeFilter" class="md-caption" ng-change="vm.onInit()">\n <md-option ng-value="\'\'">All</md-option>\n <md-option value="DEFAULT PAUSE">DEFAULT PAUSE</md-option>\n <md-option value="ACW">ACW</md-option>\n <md-option value="LOGININPAUSE">LOGININPAUSE</md-option>\n <md-option value="Auto-Pause">AUTOPAUSE</md-option>\n <md-option ng-value="pause.name" ng-repeat="pause in vm.pauses.rows">{{pause.name}}</md-option>\n </md-select>\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.order" md-on-reorder="vm.onInit">\n <tr md-row border="1">\n <th class="bv text-center" colspan="4">{{ \'VOICE.AGENT\' | translate }}</th>\n <th class="bv bl text-center" colspan="2">{{ \'VOICE.VOICE\' | translate }}</th>\n <th ng-if="vm.license.chat" class="bv bl text-center" colspan="2">{{ \'CHAT.CHAT\' | translate }}</th>\n <th ng-if="vm.license.mail" class="bv bl text-center" colspan="2">{{ \'MAIL.MAIL\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="bv bl text-center" colspan="2">{{ \'SMS.SMS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="bv bl text-center" colspan="2">{{ \'OPENCHANNEL.OPENCHANNEL\' | translate }}</th>\n <th ng-if="vm.license.fax" class="bv bl text-center" colspan="2">{{ \'FAX.FAX\' | translate }}</th>\n <th width="10px" class="bt bl" rowspan="2"></th>\n </tr>\n <tr md-row>\n <th class="bl" md-column md-order-by="fullname">{{ \'VOICE.NAME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="globalStatus">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastLoginAt">{{ \'VOICE.LOGIN_TIME\' | translate }}</th>\n <th class="bl custom-column" md-column md-order-by="lastPauseAt">{{ \'VOICE.PAUSE_TIME\' | translate }}</th>\n\n <th class="bl custom-column">{{ \'VOICE.STATUS\' | translate }}</th>\n <th class="bl custom-column">Info</th>\n\n <th ng-if="vm.license.chat" class="bl text-center">{{ \'CHAT.STATUS\' | translate }}</th>\n <th ng-if="vm.license.chat" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'CHAT.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.mail" class="bl text-center">{{ \'MAIL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.mail" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'MAIL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.messaging" class="bl text-center">{{ \'SMS.STATUS\' | translate }}</th>\n <th ng-if="vm.license.messaging" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'SMS.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.openchannel" class="bl text-center">{{ \'OPENCHANNEL.STATUS\' | translate }}</th>\n <th ng-if="vm.license.openchannel" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'OPENCHANNEL.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n\n <th ng-if="vm.license.fax" class="bl text-center">{{ \'FAX.STATUS\' | translate }}</th>\n <th ng-if="vm.license.fax" class="text-center">\n <md-icon md-font-icon="icon-battery-standard">\n <md-tooltip>{{ \'FAX.CAPACITY\' | translate }}</md-tooltip>\n </md-icon>\n </th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.order.length">\n <td md-cell colspan="17">\n <div layout="row" layout-align="center center">\n <span>{{ \'VOICE.NO_AGENT_ONLINE\' | translate }}</span>\n </div>\n </td>\n </tr>\n <tr md-select="vm.agents[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td class="bt padding-5">\n <div layout="row" layout-align="start center">\n <img class="avatar" ng-src="{{vm.agents[value].userpic && \'api/users/\'+vm.agents[value].id+\'/avatar\' || \'assets/images/avatars/profile.png\'}}">\n <div layout="column">\n <span>{{vm.agents[value].fullname}}</span>\n <span>{{vm.agents[value].internal}}</span>\n </div>\n </div>\n </td>\n <td class="bt">\n'+" <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','busy':'indigo-100-bg','*pause':'amber-50-bg','pause':'amber-200-bg'}[vm.agents[value].globalStatus]\">{{ vm.isPause(vm.agents[value].globalStatus) ? '' : vm.agents[value].globalStatus | uppercase }} {{ vm.isPause(vm.agents[value].globalStatus) ? (vm.isPartialPause(vm.agents[value].globalStatus) ? '*'+vm.agents[value].pauseType || 'DEFAULT PAUSE' : vm.agents[value].pauseType || 'DEFAULT PAUSE') : ''}}</span>\n </td>\n <td class=\"bt custom-column\">\n <timer start-time=\"vm.agents[value].lastLoginAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt custom-column\">\n <timer ng-if=\"vm.isPause(vm.agents[value].globalStatus) || vm.isPartialPause(vm.agents[value].globalStatus)\" start-time=\"vm.agents[value].lastPauseAt\" interval=\"1000\">{{ days > 0 ? days + 'd' : '' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </td>\n <td class=\"bt bl\">\n <div layout=\"row\">\n <span ng-if=\"!vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','talking':'indigo-100-bg','ringing':'orange-400-bg','pause':'amber-200-bg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].voiceStatus | uppercase }}</span>\n <span ng-if=\"vm.agents[value].onhold\" class=\"text-boxed md-background-bg bl bt padding-5 orange-400-bg\">ONHOLD</span>\n </div>\n </td>\n <td class=\"bt bl\">\n <div layout=\"column\">\n <span ng-if=\"vm.agents[value].queue\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].queue }}</span>\n <span ng-if=\"vm.agents[value].destconnectedlinenum\" class=\"padding-5\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{ vm.agents[value].destconnectedlinenum }}</span>\n <span class=\"padding-5\" ng-if=\"vm.agents[value].queue || vm.agents[value].destconnectedlinenum\">\n <timer start-time=\"vm.agents[value].voiceStatusTime\" interval=\"1000\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].voiceStatus]\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </div>\n </td>\n <td class=\"bt bl\" ng-if=\"vm.license.chat\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td md-number class=\"bt text-center font-size-20\" ng-if=\"vm.license.chat\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].chatStatus]\">{{ vm.agents[value].chatCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.mail\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.mail\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].mailStatus]\">{{ vm.agents[value].mailCurrentCapacity }}</td>\n <td class=\"bl bt\" ng-if=\"vm.license.messaging\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.messaging\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].smsStatus]\">{{ vm.agents[value].smsCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.openchannel\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.openchannel\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].openchannelStatus]\">{{ vm.agents[value].openchannelCurrentCapacity }}</td>\n <td class=\"bt bl\" ng-if=\"vm.license.fax\">\n <div layout=\"row\">\n <div layout=\"column\" layout-align=\"center center\">\n <span class=\"text-boxed md-background-bg bl bt padding-5\" ng-class=\"{'idle':'lime-300-bg','maxcapacity':'red-A200-bg','working':'indigo-100-bg','pause':'amber-200-bg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxStatus | uppercase }}</span>\n </div>\n </div>\n </td>\n <td class=\"bt padding-5 text-center font-size-20\" ng-if=\"vm.license.fax\" ng-class=\"{'idle':'lime-300-fg','maxcapacity':'red-A200-fg','working':'indigo-100-fg','pause':'amber-200-fg'}[vm.agents[value].faxStatus]\">{{ vm.agents[value].faxCurrentCapacity }}</td>\n <td class=\"bl bt padding-5 text-center\" ng-if=\"vm.crudPermissions.canEdit\">\n <md-menu>\n <md-button class=\"md-icon-button\" aria-label=\"More\" translate translate-attr-aria-label=\"STAFF.MORE\" ng-click=\"$mdOpenMenu($event)\">\n <md-icon md-font-icon=\"icon-dots-vertical\"></md-icon>\n </md-button>\n\n <md-menu-content width=\"4\">\n <md-menu-item>\n <md-button ng-click=\"vm.logout(vm.agents[value], $event)\" translate=\"VOICE.LOGOUT\">\n Logout\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click=\"vm.queueAdd(vm.agents[value], $event)\" translate=\"VOICE.AGENTADD_QUEUE\">\n Add Agent In Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click=\"$mdMenu.open()\" class=\"text-capitalize\" translate=\"VOICE.PAUSE\">Pause</md-button>\n <md-menu-content>\n <md-menu-item>\n <md-button ng-disabled=\" vm.agents[value].voicePause && 'DEFAULT PAUSE' === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value])\"><em translate=\"VOICE.DEFAULT_PAUSE\">Default Pause</em></md-button>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.pauses.rows.length\" ng-repeat=\"pause in vm.pauses.rows\">\n <md-button ng-disabled=\"vm.agents[value].voicePause && pause.name === vm.agents[value].pauseType\" ng-click=\"vm.pause(vm.agents[value], pause.name)\">{{pause.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n <md-menu-item ng-if=\"vm.isPause(vm.agents[value].globalStatus)\">\n <md-button ng-click=\"vm.unPause(vm.agents[value])\" translate=\"VOICE.UNPAUSE\">\n Unpause\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label=\"{page: '{{'VOICE.PAGE' | translate}}:', rowsPerPage: '{{'VOICE.ROWSPERPAGE' | translate}}:', of: '{{'VOICE.OF' | translate}}'}\" md-limit=\"vm.query.limit\" md-limit-options=\"[10, 15, 20, 50, 100, 250]\" md-page=\"vm.query.page\" md-total=\"{{vm.filteredAgents.length}}\" md-on-paginate=\"vm.onInit\" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e"),e.put("app/main/apps/voice/views/realtime/outbound_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.OUTBOUND_CALLS">Ooutbound Calls</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- OUTBOUNDS TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.SOURCE\' | translate }}</th>\n <th md-column>{{ \'VOICE.DESTINATION\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.calls.rows.length">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="call in vm.calls.rows | filter: vm.query.filter | limitTo: vm.query.limit: (vm.query.page - 1) * vm.query.limit">\n <td md-cell>\n <i ng-class="vm.channelStatus[call.channelstatedesc.toLowerCase()]"></i>\n </td>\n <td md-cell>\n {{call.calleridname}}, {{call.calleridnum}} <span class="text-boxed" ng-if="call.answered">\n <timer ng-if="call.answertime" start-time="call.answertime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>{{call.exten}}</td>\n <td md-cell>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() !== \'hangup\'">\n <timer ng-if="call.starttime" start-time="call.starttime" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n <span class="text-boxed" ng-if="call.channelstatedesc.toLowerCase() === \'hangup\'" translate="VOICE.CLOSING">Closing</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.calls.count}}"></md-table-pagination>\n\x3c!-- / OUTBOUNDS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_calls/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n \x3c!-- <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUES TABLE --\x3e\n<md-table-container>\n <table md-table>\n <thead md-head>\n <tr md-row>\n <th md-column width="30px"></th>\n <th md-column>{{ \'VOICE.DID\' | translate }}</th>\n <th md-column>{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column>{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column>{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column>{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.getSize(vm.rpcVoiceQueuesChannels)">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(key, channel) in vm.rpcVoiceQueuesChannels | limitObjectFromTo: vm.queryChannels.limit:(vm.queryChannels.page - 1) * vm.queryChannels.limit">\n <td md-cell>\n <md-icon ng-if="channel.queuecallerleaveAt" md-font-icon="icon-phone-in-talk green-fg"></md-icon>\n <md-icon ng-if="!channel.queuecallerleaveAt" md-font-icon="icon-phone-incoming md-accent"></md-icon>\n </td>\n <td md-cell>{{channel.exten}}</td>\n <td md-cell>{{channel.queue}}</td>\n <td md-cell>{{channel.calleridnum}}</td>\n <td md-cell>\n <span ng-if="channel.queuecallerleaveAt">\n {{channel.connectedlinename}}, {{channel.connectedlinenum}}\n <span class="text-boxed">\n <timer start-time="channel.queuecallerleaveAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </span>\n <span ng-if="!channel.queuecallerleaveAt" class="text-boxed">\n {{ \'VOICE.WAITING_FOR_AGENT\' | translate }}\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell>\n <span class="text-boxed">\n <timer start-time="channel.queuecallerjoinAt" interval="1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="2">\n <md-menu-item>\n <md-button ng-click="vm.hangup(channel.uniqueid)" translate="VOICE.HANGUP">\n Hangup\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.redirectToNumber($event, channel.uniqueid)" translate="VOICE.REDIRECT_TO_NUMBER">\n Number\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-menu>\n <md-button ng-click="$mdMenu.open()" translate="VOICE.REDIRECT_TO_AGENT">Redirect to Agent</md-button>\n <md-menu-content>\n <md-menu-item ng-repeat="agent in vm.agents.rows">\n <md-button ng-click="vm.redirectToAgent(channel.uniqueid, agent.name, agent.context)">{{agent.name}}</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.queryChannels.limit" md-page="vm.queryChannels.page" md-limit-options="[10, 15, 20, 50, 100, 250]" md-total="{{vm.getSize(vm.rpcVoiceQueuesChannels)}}" md-page-select></md-table-pagination>\n\x3c!-- / QUEUES TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queue_params/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="MOTIONDIALER.QUEUE_PARAMETERS">Params</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column>{{\'\n VOICE.NAME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.TOTAL_OFFERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ANSWERED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.ABANDONED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.UNMANAGED\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_HOLD_TIME\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_DURATION\' | translate}}</th>\n <th md-column>{{\'\n VOICE.AVG_BILLABLE\' | translate}}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="8">\n <div layout="row" layout-align="center center">\n <span tranlsate="MOTIONDIALER.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, queue) in vm.queues">\n <td md-cell>\n <span>{{queue.name}}</span>\n </td>\n <td md-cell>\n \x3c!-- <span class="font-size-20 grey-fg">{{queue.total || 0}}</span> --\x3e\n <span class="font-size-20 grey-fg">{{ (queue.answered || 0) + (queue.abandoned || 0) + (queue.unmanaged || 0) }}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered || 0}} ({{(queue.total) ? (queue.answered || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.abandoned || 0}} ({{(queue.total) ? (queue.abandoned || 0) * 100/queue.total : 0 | number:1}}%)</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.unmanaged || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.total ? ((queue.sumHoldTime || 0) / queue.total) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(queue.total ? ((queue.sumDuration || 0) / queue.total) : 0) | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{queue.answered ? ((queue.sumBillable || 0) / queue.answered) : 0 | number: 0 | secToTime | date:\'HH:mm:ss\'}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'MOTIONDIALER.PAGE\' | translate}}:\', rowsPerPage: \'{{\'MOTIONDIALER.ROWSPERPAGE\' | translate}}:\', of: \'{{\'MOTIONDIALER.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/queues/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.QUEUES">Queues</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n </div>\n</md-toolbar>\n\n\x3c!-- QUEUE TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getQueues">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.LOGGED_IN\' | translate }}</th>\n <th md-column>{{ \'VOICE.PAUSED\' | translate }}</th>\n <th md-column>{{ \'VOICE.READY\' | translate }}</th>\n <th md-column>{{ \'VOICE.WAITING\' | translate }}</th>\n <th md-column>{{ \'VOICE.TALKING\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.queues">\n <td md-cell colspan="7">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="vm.queues[value]" md-select-id="id" ng-repeat="(id, value) in vm.order">\n <td md-cell>{{vm.queues[value].name}}</td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].loggedInDb || 0}} ({{vm.queues[value].loggedIn || 0}})</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].paused || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{vm.queues[value].available || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-20 grey-fg">{{vm.queues[value].waiting || 0}}</span>\n </td>\n <td md-cell>\n <span class="font-size-16 grey-fg">{{(vm.queues[value].talking || 0) }}</span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.createOrEditVoiceQueue($event, vm.queues[value])" translate="VOICE.EDIT_QUEUE">\n Edit Queue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentAdd($event, vm.queues[value])" translate="VOICE.AGENTSADD_QUEUE">\n Add Agents to queue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getQueues" md-page-select></md-table-pagination>\n\x3c!-- / QUEUE TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/realtime.html",'<div id="realtime" class="page-layout simple tabbed" layout="column" ng-cloak>\n \x3c!-- CONTENT --\x3e\n <div class="content">\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.AGENTS">Agents</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TELEPHONES">Telephones</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.TRUNKS">Trunks</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUES">Queues</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_CALLS">Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ABANDONEDCALLS">Abandoned Queue Calls</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.QUEUE_PARAMS">Queue Parameters</span>\n </md-tab-label>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.OUTBOUND_CALLS">Outbound Calls</span>\n </md-tab-label>\n </md-tab>\n </md-tabs>\n\n <md-card ui-view></md-card>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n</div>'),e.put("app/main/apps/voice/views/realtime/telephones/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TELEPHONES">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'VOICE.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- AGENT TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTelephones">\n <tr md-row>\n <th md-column md-order-by="fullname">{{ \'VOICE.ACCOUNTNAME\' | translate }}</th>\n <th md-column md-order-by="internal">{{ \'VOICE.INTERNAL\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATE\' | translate }}</th>\n <th md-column>{{ \'VOICE.PHONE_STATUS\' | translate }}</th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.telephones">\n <td md-cell colspan="4">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="telephone" md-select-id="id" ng-repeat="(id, telephone) in vm.telephones">\n <td md-cell>{{telephone.fullname}}</td>\n <td md-cell>{{telephone.internal}}</td>\n <td md-cell>\n <i ng-class="vm.stateClass[telephone.state]">\n <md-tooltip>{{\'VOICE.\' + telephone.state | uppercase | translate}}</md-tooltip>\n </i>\n </td>\n <td md-cell>\n <i ng-class="vm.statusClass[telephone.status]">\n <md-tooltip>{{\'VOICE.\' + telephone.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="telephone.status === \'registered\'" class="text-boxed">{{telephone.address}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTelephones" md-page-select></md-table-pagination>\n\x3c!-- / AGENT TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/realtime/trunks/view.html",'\x3c!-- MAIN --\x3e\n<md-toolbar class="md-table-toolbar md-default">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.TRUNKS">Telephones</span>\n <div flex></div>\n <ms-search-bar on-search="vm.query.filter = query;" on-collapse="vm.query.filter = undefined;" debounce="300"></ms-search-bar>\n \x3c!-- <md-button class="md-icon-button" ng-click="vm.showInfo($event)">\n <i class="icon-information-outline grey-600-fg">\n <md-tooltip>{{\'FAX.INFO\' | translate}}</md-tooltip>\n </i>\n </md-button> --\x3e\n </div>\n</md-toolbar>\n\n\x3c!-- TRUNKS TABLE --\x3e\n<md-table-container>\n <table md-table multiple md-progress="vm.promise">\n <thead md-head>\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getTrunks">\n <tr md-row>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column>{{ \'VOICE.TRUNK_STATUS\' | translate }}</th>\n <th md-column>{{ \'VOICE.REGISTRY\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.trunks">\n <td md-cell colspan="3">\n <div layout="row" layout-align="center center">\n <span tranlsate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row ng-repeat="(id, trunk) in vm.trunks">\n <td md-cell>{{trunk.name}}</td>\n <td md-cell>\n <i ng-class="vm.statusClass[trunk.status.toLowerCase()]">\n <md-tooltip>{{\'VOICE.\' + trunk.status | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.status === \'registered\'" class="text-boxed">{{trunk.address}}</span>\n </td>\n <td md-cell>\n <i ng-if="trunk.registry" ng-class="(trunk.stateRegistry.toLowerCase() === \'registered\') ? \'green-300-fg icon-checkbox-marked-circle\' : \'red-300-fg icon-close-circle\'">\n <md-tooltip>{{\'VOICE.\' + trunk.stateRegistry | uppercase | translate}}</md-tooltip>\n </i>\n <span ng-if="trunk.registry && trunk.host && trunk.port" class="text-boxed">{{trunk.host}}:{{trunk.port}}</span>\n <span ng-if="!trunk.registry" translate="VOICE.NO_REGISTRY">\n No Registry\n </span>\n </td>\n <td md-cell class="actions" ng-if="vm.crudPermissions.canEdit">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="STAFF.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="4">\n <md-menu-item>\n <md-button ng-click="vm.goToTrunk($event, trunk)" translate="VOICE.EDIT_TRUNK">\n Edit Trunk\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n</md-table-container>\n\n<md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.count}}" md-on-paginate="vm.getTrunks" md-page-select></md-table-pagination>\n\x3c!-- / TRUNKS TABLE --\x3e\n\x3c!-- / MAIN --\x3e'),e.put("app/main/apps/voice/views/voicemails/create/dialog.html",'<md-dialog class="voicemail-dialog" aria-label="New Voicemail">\n <form name="voicemailForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus>\n\n <div ng-messages="voicemailForm[\'fullname\'].$error" ng-show="voicemailForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'">\n\n <div ng-messages="voicemailForm[\'email\'].$error" ng-show="voicemailForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="voicemailForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="voicemailForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" ng-disabled="!vm.newVoicemail">\n\n <div ng-messages="voicemailForm[\'mailbox\'].$error" ng-show="voicemailForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="voicemailForm[\'attach\'].$error" ng-show="voicemailForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoicemail" ng-click="vm.saveVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid || voicemailForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoicemail" ng-click="vm.addNewVoicemail()" class="send-button md-accent md-raised" ng-disabled="voicemailForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEMAIL" translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n ADD VOICEMAIL\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoicemail" ng-click="vm.deleteVoicemail($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicemails/edit/view.html",'<div id="voice-voicemail" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voicemails-button md-icon-button" aria-label="Go to voicemails" ng-click="vm.gotoVoicemails()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEMAILS">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voicemail-image" hide-xs>\n <img ng-src="assets/images/business/voicemails.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voicemail.id}}\n <span ng-if="vm.voicemail.name">{{vm.voicemail.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voicemail.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoicemail()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (advancedForm.$invalid) || (messagesForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.FULLNAME">FullName</label>\n <input type="text" name="fullname" ng-model="vm.voicemail.fullname" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'fullname\'].$error" ng-show="generalForm[\'fullname\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.FULLNAME_REQUIRED">FullName field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAIL">Email</label>\n <input type="email" name="email" ng-model="vm.voicemail.email" ng-required="vm.voicemail.attach === \'yes\'" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'email\'].$error" ng-show="generalForm[\'email\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAIL_REQUIRED">Email field is required</span>\n </div>\n <div ng-message="email">\n <span translate="VOICE.ERRORS.EMAIL_MUST_VALID">Email must be a valid e-mail address</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PASSWORD">Password</label>\n <input type="password" name="password" ng-model="vm.voicemail.password" placeholder="Password" translate translate-attr-placeholder="VOICE.PASSWORD" required>\n <div ng-messages="generalForm[\'password\'].$error" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" ng-if="vm.newVoicemail ">\n <label translate="VOICE.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword" required>\n <div ng-messages="generalForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="VOICE.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block">\n <label translate="VOICE.MAILBOX">MailBox</label>\n <input type="text" name="mailbox" ng-model="vm.voicemail.mailbox" ng-required="true" disabled>\n\n <div ng-messages="generalForm[\'mailbox\'].$error" ng-show="generalForm[\'mailbox\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAILBOX_REQUIRED">MailBox field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.VOICEMAIL_CONTEXT">Voicemail_Context</label>\n <md-select name="context" ng-model="vm.voicemail.context" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="context.name" ng-repeat="context in vm.contexts" ng-disabled="context.canSelect === false">{{ context.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.VOICEMAIL_CONTEXT"></span></div>\n <div ng-messages="generalForm[\'context\'].$error" ng-show="generalForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.VOICEMAIL_CONTEXT_REQUIRED">Voicemail_Context field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEZONE">TimeZone</label>\n <input type="text" name="tz" ng-model="vm.voicemail.tz" ng-required="true" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'tz\'].$error" ng-show="advancedForm[\'tz\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEZONE_REQUIRED">TimeZone field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ATTACH">Attach</label>\n <md-select name="attach" ng-model="vm.voicemail.attach" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'attach\'].$error" ng-show="advancedForm[\'attach\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ATTACH_REQUIRED">Attach field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ENVELOPE">Envelope</label>\n <md-select name="envelope" ng-model="vm.voicemail.envelope" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'envelope\'].$error" ng-show="advancedForm[\'envelope\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ENVELOPE_REQUIRED">Envelope field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DELETE">Delete</label>\n <md-select name="delete" ng-model="vm.voicemail.delete" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div ng-messages="advancedForm[\'delete\'].$error" ng-show="advancedForm[\'delete\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DELETE_REQUIRED">Delete field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILBODY">EmailBody</label>\n <input type="text" name="emailbody" ng-model="vm.voicemail.emailbody" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailbody\'].$error" ng-show="advancedForm[\'emailbody\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILBODY_REQUIRED">EmailBody field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.EMAILSUBJECT">EmailSubject</label>\n <input type="text" name="emailsubject" ng-model="vm.voicemail.emailsubject" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'emailsubject\'].$error" ng-show="advancedForm[\'emailsubject\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.EMAILSUBJECT_REQUIRED">EmailSubject field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXSECONDS">MaxSeconds</label>\n <input type="number" name="maxsecs" ng-model="vm.voicemail.maxsecs" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxsecs\'].$error" ng-show="advancedForm[\'maxsecs\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXSECONDS_REQUIRED">MaxSeconds field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxSeconds must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXMESSAGES">MaxMessages</label>\n <input type="number" name="maxmsg" ng-model="vm.voicemail.maxmsg" min="0" max="9999" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="advancedForm[\'maxmsg\'].$error" ng-show="advancedForm[\'maxmsg\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXMESSAGES_REQUIRED">MaxMessages field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>0</span>\n </div>\n <div ng-message="max">\n <span translate="VOICE.ERRORS.MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO">MaxMessages must be a valid greater or equal than</span> <span>9999</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.MESSAGES">MESSAGES</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voicemail-detail-form-container messages md-background-bg md-whiteframe-1dp">\n <div ng-controller="VoicemailMessagesController as vm_dc" ng-init="vm_dc.init(vm.voicemail, vm.crudPermissions)">\n <md-toolbar class="md-table-toolbar md-default" ng-hide="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead" translate="VOICE.MESSAGES">Messages</span>\n <div flex></div>\n <ms-search-bar on-search="vm_dc.query.filter = query" on-collapse="vm_dc.query.filter = undefined" debounce="300"></ms-search-bar>\n </div>\n </md-toolbar>\n <md-toolbar class="md-table-toolbar md-accent" ng-show="vm_dc.selectedVoicemailMessages.length">\n <div class="md-toolbar-tools">\n <span class="md-subhead">{{vm_dc.selectedVoicemailMessages.length}} {{vm_dc.selectedVoicemailMessages.length > 1 ? \'items\' : \'item\'}} selected</span>\n <div flex></div>\n <button class="md-icon-button" ng-csv="vm_dc.exportSelectedVoicemailMessages" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button ng-if="vm_dc.crudPermissions.canDelete" class="md-icon-button" ng-click="vm_dc.deleteSelectedVoicemailMessages($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm_dc.selectedVoicemailMessages" md-progress="vm_dc.promise">\n <thead md-head md-order="vm_dc.query.sort" md-on-reorder="vm_dc.getVoicemailMessages">\n <tr md-row>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="callerid">{{ \'VOICE.CALLER_ID\' | translate }}</th>\n <th md-column md-order-by="duration">{{ \'VOICE.DURATION\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="stamp">{{ \'VOICE.RECEIVED_AT\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row md-select="message" md-select-id="id" ng-repeat="message in vm_dc.voicemailMessages.rows">\n <td md-cell>{{message.id}}</td>\n <td md-cell>{{message.callerid}}</td>\n <td md-cell>{{message.duration}}</td>\n <td md-cell>\n \x3c!-- audio recording directive --\x3e\n <ms-recording id="message.id" model="\'voiceMailMessage\'"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n </td>\n <td md-cell>{{message.stamp | date:\'medium\'}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item>\n <md-button class="md-primary" ng-click="vm_dc.voiceMailMessageDownload(message, $event)" translate="VOICE.DOWNLOAD_MESSAGE">\n Download Message\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm_dc.crudPermissions.canDelete">\n <md-button ng-click="vm_dc.deleteConfirm(message, $event)" translate="VOICE.DELETE_MESSAGE">\n Delete Message\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n <tr md-row ng-if="!vm_dc.voicemailMessages.rows.length">\n <td md-cell colspan="8">\n <span class="text-boxed-ligth" translate="VOICE.NO_MESSAGE_AVAILABLE">No message available</span>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm_dc.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm_dc.query.page" md-total="{{vm_dc.voicemailMessages.count}}" md-on-paginate="vm_dc.getVoicemailMessages" md-page-select></md-table-pagination>\n </div>\n\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voicemails/voicemails.html",'<div id="voicemails" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEMAILS">Voicemails</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicemails.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicemails =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicemails-count">\n <span>{{vm.selectedVoicemails.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEMAILS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicemails()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicemails()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicemails" csv-label="true" filename="voicemails.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicemails($event)" aria-label="delete selected" translate translate-attr-label="VOICEMAILS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEMAIL TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicemails" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicemails">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="fullname">{{ \'VOICE.FULLNAME\' | translate }}</th>\n <th md-column md-order-by="email">{{ \'VOICE.EMAIL\' | translate }}</th>\n <th md-column md-order-by="mailbox">{{ \'VOICE.MAILBOX\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicemails.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicemail" md-select-id="id" ng-repeat="voicemail in vm.voicemails.rows">\n <td md-cell ng-if="voicemail.userpic"><img class="avatar" alt="{{voicemail.name}}" ng-src="api/users/{{voicemail.id}}/avatar" /></td>\n <td md-cell ng-if="!voicemail.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicemail.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="id ">{{voicemail.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="fullname ">{{voicemail.fullname}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="email ">{{voicemail.email}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voicemail, ev) : vm.createOrEditVoicemail($event, voicemail)" md-cell class="mailbox ">{{voicemail.mailbox}}</td>\n <td md-cell class="actions" ng-if="!vm.crudPermissions.readOnly">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(voicemail, $event)" translate="VOICE.EDIT_VOICEMAIL">\n Edit Voicemail\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voicemail, $event)" translate="VOICE.DELETE_VOICEMAIL">\n Delete Voicemail\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicemails.count}}" md-on-paginate="vm.getVoicemails" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEMAIL TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEMAIL BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicemail-button" ng-click="vm.createOrEditVoicemail($event)" aria-label="add voicemail" translate translate-attr-aria-label="VOICE.ADD_VOICEMAIL">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEMAIL BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voicePrefixes/create/dialog.html",'<md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">\n <form name="voicePrefixForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voicePrefix.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voicePrefixForm[\'name\'].$error" ng-show="voicePrefixForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>\n <md-select name="VoiceExtensionId" ng-model="vm.voicePrefix.VoiceExtensionId" required>\n <md-option ng-value="VoiceExtensionId.id" ng-repeat="VoiceExtensionId in vm.outboundRoutes" ng-disabled="VoiceExtensionId.canSelect === false">{{ VoiceExtensionId.exten }}</md-option>\n </md-select>\n <div ng-messages="voicePrefixForm[\'VoiceExtensionId\'].$error" ng-show="voicePrefixForm[\'VoiceExtensionId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED">OutboundRoute field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CALLERIDALL">CallerIdAll</label>\n <input type="text" name="callerIdAll" ng-model="vm.voicePrefix.callerIdAll" ng-pattern="/"(.*)"\\s<(.*?)>$/">\n\n <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>\n <div ng-messages="voicePrefixForm[\'callerIdAll\'].$error" ng-show="voicePrefixForm[\'callerIdAll\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED">CallerIdAll field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN" translate-values="{ regex: \'/"(.*)"\\s<(.*?)>$/\' }">CallerIdAll must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voicePrefix.description">\n\n <div ng-messages="voicePrefixForm[\'description\'].$error" ng-show="voicePrefixForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix" ng-click="vm.savevoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix" ng-click="vm.addNewvoicePrefix()" class="send-button md-accent md-raised" ng-disabled="voicePrefixForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEPREFIX" translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n ADD VOICEPREFIX\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix" ng-click="vm.deletevoicePrefix($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/edit/agentadd/agentadd.html",'<md-dialog class="voicePrefix-dialog" aria-label="voicePrefix" ng-init="vm.onInit()">\n <form name="voicePrefixForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEPREFIX">Add Agent to voicePrefix</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voicePrefixes/voicePrefixes.html",'<div id="voicePrefixes" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEPREFIXES">VoicePrefixes</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoicePrefixes.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoicePrefixes =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voicePrefixes-count">\n <span>{{vm.selectedVoicePrefixes.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEPREFIXES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoicePrefixes()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoicePrefixes()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoicePrefixes" csv-label="true" filename="voicePrefixes.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoicePrefixes($event)" aria-label="delete selected" translate translate-attr-label="VOICEPREFIXES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEPREFIX TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoicePrefixes" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoicePrefixes">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="VoiceExtensionId">{{ \'VOICE.OUTBOUNDROUTE\' | translate }}</th>\n <th md-column md-order-by="callerIdAll">{{ \'VOICE.CALLERIDALL\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voicePrefixes.rows.length">\n <td md-cell colspan="6">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voicePrefix" md-select-id="id" ng-repeat="voicePrefix in vm.voicePrefixes.rows">\n <td md-cell ng-if="voicePrefix.userpic"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="api/users/{{voicePrefix.id}}/avatar" /></td>\n <td md-cell ng-if="!voicePrefix.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voicePrefix.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="id ">{{voicePrefix.id}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="name ">{{voicePrefix.name}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="VoiceExtensionId ">{{ (vm.outboundRoutes | filter : {\'id\':voicePrefix.VoiceExtensionId})[0].exten }}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="callerIdAll ">{{voicePrefix.callerIdAll}}</td>\n <td ng-click="vm.createOrEditvoicePrefix($event, voicePrefix)" md-cell class="description ">{{voicePrefix.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editdialog(voicePrefix, $event)" translate="VOICE.EDIT_VOICEPREFIX">\n Edit voicePrefix\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voicePrefix, $event)" translate="VOICE.AGENTADD_VOICEPREFIX">\n AgentAdd voicePrefix\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voicePrefix, $event)" translate="VOICE.DELETE_VOICEPREFIX">\n Delete voicePrefix\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voicePrefixes.count}}" md-on-paginate="vm.getVoicePrefixes" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEPREFIX TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEPREFIX BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voicePrefix-button" ng-click="vm.createOrEditvoicePrefix($event)" aria-label="add voicePrefix" translate translate-attr-aria-label="VOICE.ADD_VOICEPREFIX">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEPREFIX BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/create/dialog.html",'<md-dialog class="voiceQueue-dialog" aria-label="New VoiceQueue">\n <form name="voiceQueueForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus ng-disabled="!vm.newVoiceQueue">\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="voiceQueueForm[\'name\'].$error" ng-show="voiceQueueForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required>\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="voiceQueueForm[\'strategy\'].$error" ng-show="voiceQueueForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description">\n\n <div ng-messages="voiceQueueForm[\'description\'].$error" ng-show="voiceQueueForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceQueue" ng-click="vm.saveVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid || voiceQueueForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceQueue" ng-click="vm.addNewVoiceQueue()" class="send-button md-accent md-raised" ng-disabled="voiceQueueForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICEQUEUE" translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n ADD VOICEQUEUE\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceQueue" ng-click="vm.deleteVoiceQueue($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/agentadd/agentadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.AGENTADD_VOICEQUEUE">Add Agent to voiceQueue</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveAgents()" class="send-button md-accent md-raised" ng-disabled="!vm.pendingChanges" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/teamadd/teamadd.html",'<md-dialog class="voiceQueue-dialog" aria-label="voiceQueue" ng-init="vm.onInit()">\n <form name="voiceQueueForm" ng-cloak>\n <md-toolbar>\n <div class="md-toolbar-tools">\n <h2 translate="VOICE.TEAMS_ASSOCIATION">Teams Association</h2>\n <span flex></span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content>\n <md-input-container flex class="no-margin">\n <label translate="VOICE.PENALTY">Penalty</label>\n <input name="penalty" ng-model="vm.penalty" placeholder="0" required md-minlength="0" md-maxlength="3">\n <div ng-messages="voiceQueueForm.penalty.$error" role="alert" multiple>\n <div ng-message="required">\n <span>You must supply a penalty.</span>\n </div>\n <div ng-message="md-minlength">\n <span>Min Penalty 0 characters.</span>\n </div>\n <div ng-message="md-maxlength">\n <span>Max Penalty 3 characters.</span>\n </div>\n </div>\n </md-input-container>\n <ms-dual-multiselect options="vm.dualMultiselectOptions"></ms-dual-multiselect>\n </md-dialog-content>\n <md-dialog-actions layout="row" layout-align="end center" ng-if="vm.crudPermissions.canEdit">\n <span></span>\n <md-button layout-align="end center" type="submit" ng-click="vm.saveTeams()" ng-disabled="!vm.pendingChanges" class="send-button md-accent md-raised" aria-label="SAVE" translate="STAFF.SAVE" translate-attr-aria-label="STAFF.SAVE">\n SAVE\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceQueues/edit/view.html",'<div id="voice-voiceQueue" class="page-layout simple tabbed" layout="column">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="start center">\n <div class="white-fg" layout="row" layout-align="start center" flex>\n <md-button class="goto-voiceQueues-button md-icon-button" aria-label="Go to voiceQueues" ng-click="vm.gotoVoiceQueues()" translate translate-attr-aria-label="VOICE.GO_TO_VOICEQUEUES">\n <md-icon md-font-icon="icon-arrow-left"></md-icon>\n </md-button>\n\n <div layout="row" layout-align="start center">\n\n <div class="voiceQueue-image" hide-xs>\n <img ng-src="assets/images/business/voiceQueues.jpg">\n </div>\n\n <div layout="column" layout-align="start start">\n <div class="h2">\n #{{vm.voiceQueue.id}}\n <span ng-if="vm.voiceQueue.name">{{vm.voiceQueue.name}}</span>\n </div>\n <div class="subtitle secondary-text">\n <span translate="VOICE.CREATED_AT"></span> <span>{{vm.voiceQueue.createdAt | date:\'medium\'}}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.teamadddialog(vm.voiceQueue, $event)" class="md-fab md-orange-500-bg md-icon-button" aria-label="teamadd">\n <md-tooltip><span translate="VOICE.TEAMADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-multiple-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.agentadddialog(vm.voiceQueue, $event)" class="md-fab md-purple-500-bg md-icon-button" aria-label="agentadd">\n <md-tooltip><span translate="VOICE.AGENTADD_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-account-plus"></md-icon>\n </md-button>\n </div>\n\n <div ng-cloak>\n <md-button ng-click="vm.gotogoto(vm.voiceQueue, $event)" class="md-fab md-warn md-icon-button" aria-label="goto">\n <md-tooltip><span translate="VOICE.GOTO_VOICEQUEUE"></span></md-tooltip>\n <md-icon md-font-icon="icon-cast"></md-icon>\n </md-button>\n </div>\n <div>\n <md-button type="submit" ng-click="vm.saveVoiceQueue()" ng-if="vm.crudPermissions.canEdit" class="send-button md-accent md-raised" ng-disabled="(generalForm.$invalid) || (settingsForm.$invalid) || (announcementsForm.$invalid) || (advancedForm.$invalid)" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n </div>\n\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content">\n\n <md-tabs md-selected="vm.selectedTab" md-stretch-tabs="always" flex layout-fill md-dynamic-height>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.SETTINGS">SETTINGS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container general md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.GENERAL">GENERAL</div>\n </div>\n <form name="generalForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.voiceQueue.name" ng-pattern="/^[A-Za-z0-9\\.\\_]+$/i" ng-required="true" autofocus disabled>\n\n <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>\n <div ng-messages="generalForm[\'name\'].$error" ng-show="generalForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.STRATEGY">Strategy</label>\n <md-select name="strategy" ng-model="vm.voiceQueue.strategy" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'ringall\'">Ringall</md-option>\n <md-option ng-value="\'rrmemory\'">Round Robin Memory</md-option>\n <md-option ng-value="\'leastrecent\'">Least Recent</md-option>\n <md-option ng-value="\'fewestcalls\'">Fewest Calls</md-option>\n <md-option ng-value="\'random\'">Random</md-option>\n <md-option ng-value="\'linear\'">Linear</md-option>\n <md-option ng-value="\'wrandom\'">Weight Random</md-option>\n </md-select>\n <div ng-messages="generalForm[\'strategy\'].$error" ng-show="generalForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.STRATEGY_REQUIRED">Strategy field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUT">Timeout</label>\n <input type="number" name="timeout" ng-model="vm.voiceQueue.timeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.TIMEOUT"></span></div>\n <div ng-messages="generalForm[\'timeout\'].$error" ng-show="generalForm[\'timeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED">Timeout field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Timeout must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MAXLENGTH">MaxLength</label>\n <input type="number" name="maxlen" ng-model="vm.voiceQueue.maxlen" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MAXLENGTH"></span></div>\n <div ng-messages="generalForm[\'maxlen\'].$error" ng-show="generalForm[\'maxlen\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MAXLENGTH_REQUIRED">MaxLength field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MaxLength must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RETRY">Retry</label>\n <input type="number" name="retry" ng-model="vm.voiceQueue.retry" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.RETRY"></span></div>\n <div ng-messages="generalForm[\'retry\'].$error" ng-show="generalForm[\'retry\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RETRY_REQUIRED">Retry field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Retry must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WRAPUPTIME">WrapupTime</label>\n <input type="number" name="wrapuptime" ng-model="vm.voiceQueue.wrapuptime" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WRAPUPTIME"></span></div>\n <div ng-messages="generalForm[\'wrapuptime\'].$error" ng-show="generalForm[\'wrapuptime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WRAPUPTIME_REQUIRED">WrapupTime field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO">WrapupTime must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WEIGHT">Weight</label>\n <input type="number" name="weight" ng-model="vm.voiceQueue.weight" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.WEIGHT"></span></div>\n <div ng-messages="generalForm[\'weight\'].$error" ng-show="generalForm[\'weight\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WEIGHT_REQUIRED">Weight field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO">Weight must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.JOINWHENEMPTY">JoinWhenEmpty</label>\n <md-select name="joinempty" ng-model="vm.voiceQueue.joinempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.JOINWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'joinempty\'].$error" ng-show="generalForm[\'joinempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.JOINWHENEMPTY_REQUIRED">JoinWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.LEAVEWHENEMPTY">LeaveWhenEmpty</label>\n <md-select name="leavewhenempty" ng-model="vm.voiceQueue.leavewhenempty" multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'no\'">no</md-option>\n <md-option ng-value="\'yes\'">yes</md-option>\n <md-option ng-value="\'strict\'">strict</md-option>\n <md-option ng-value="\'loose\'">loose</md-option>\n <md-option ng-value="\'paused\'">paused</md-option>\n <md-option ng-value="\'penalty\'">penalty</md-option>\n <md-option ng-value="\'inuse\'">inuse</md-option>\n <md-option ng-value="\'ringing\'">ringing</md-option>\n <md-option ng-value="\'unavailable\'">unavailable</md-option>\n <md-option ng-value="\'invalid\'">invalid</md-option>\n <md-option ng-value="\'unknown\'">unknown</md-option>\n <md-option ng-value="\'wrapup\'">wrapup</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.LEAVEWHENEMPTY"></span></div>\n <div ng-messages="generalForm[\'leavewhenempty\'].$error" ng-show="generalForm[\'leavewhenempty\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.LEAVEWHENEMPTY_REQUIRED">LeaveWhenEmpty field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MUSICONHOLD">MusicOnHold</label>\n <md-select name="musiconhold" ng-model="vm.voiceQueue.musiconhold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="musiconhold.name" ng-repeat="musiconhold in vm.musiconholds" ng-disabled="musiconhold.canSelect === false">{{ musiconhold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MUSICONHOLD"></span></div>\n <div ng-messages="generalForm[\'musiconhold\'].$error" ng-show="generalForm[\'musiconhold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MUSICONHOLD_REQUIRED">MusicOnHold field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCETOAGENT">AnnounceToAgent</label>\n <md-select name="announce" ng-model="vm.voiceQueue.announce" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'FALSE\'">None</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + announce.save_name" ng-repeat="announce in vm.sounds" ng-disabled="announce.canSelect === false">{{ announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCETOAGENT"></span></div>\n <div ng-messages="generalForm[\'announce\'].$error" ng-show="generalForm[\'announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCETOAGENT_REQUIRED">AnnounceToAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.DESCRIPTION">Description</label>\n <input type="text" name="description" ng-model="vm.voiceQueue.description" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div ng-messages="generalForm[\'description\'].$error" ng-show="generalForm[\'description\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container settings md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.SETTINGS">SETTINGS</div>\n </div>\n <form name="settingsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEFREQUENCY">AnnounceFrequency</label>\n <input type="number" name="announce_frequency" ng-model="vm.voiceQueue.announce_frequency" min="0" autofocus ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'announce_frequency\'].$error" ng-show="settingsForm[\'announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_REQUIRED">AnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINANNOUNCEFREQUENCY">MinAnnounceFrequency</label>\n <input type="number" name="min_announce_frequency" ng-model="vm.voiceQueue.min_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MINANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'min_announce_frequency\'].$error" ng-show="settingsForm[\'min_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_REQUIRED">MinAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MinAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCEFREQUENCY">PeriodicAnnounceFrequency</label>\n <input type="number" name="periodic_announce_frequency" ng-model="vm.voiceQueue.periodic_announce_frequency" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCEFREQUENCY"></span></div>\n <div ng-messages="settingsForm[\'periodic_announce_frequency\'].$error" ng-show="settingsForm[\'periodic_announce_frequency\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_REQUIRED">PeriodicAnnounceFrequency field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">PeriodicAnnounceFrequency must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RANDOMPERIODICANNOUNCE">RandomPeriodicAnnounce</label>\n <md-select name="random_periodic_announce" ng-model="vm.voiceQueue.random_periodic_announce" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RANDOMPERIODICANNOUNCE"></span></div>\n <div ng-messages="settingsForm[\'random_periodic_announce\'].$error" ng-show="settingsForm[\'random_periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RANDOMPERIODICANNOUNCE_REQUIRED">RandomPeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEHOLDTIME">AnnounceHoldtime</label>\n <md-select name="announce_holdtime" ng-model="vm.voiceQueue.announce_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'once\'">Once</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEHOLDTIME"></span></div>\n <div ng-messages="settingsForm[\'announce_holdtime\'].$error" ng-show="settingsForm[\'announce_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEHOLDTIME_REQUIRED">AnnounceHoldtime field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCECALLERPOSITION">AnnounceCallerPosition</label>\n <md-select name="announce_position" ng-model="vm.voiceQueue.announce_position" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'yes\'">Yes</md-option>\n <md-option ng-value="\'no\'">No</md-option>\n <md-option ng-value="\'limit\'">Limit</md-option>\n <md-option ng-value="\'more\'">More</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCECALLERPOSITION"></span></div>\n <div ng-messages="settingsForm[\'announce_position\'].$error" ng-show="settingsForm[\'announce_position\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCECALLERPOSITION_REQUIRED">AnnounceCallerPosition field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ANNOUNCEPOSITIONLIMIT">AnnouncePositionLimit</label>\n <input type="number" name="announce_position_limit" ng-model="vm.voiceQueue.announce_position_limit" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.ANNOUNCEPOSITIONLIMIT"></span></div>\n <div ng-messages="settingsForm[\'announce_position_limit\'].$error" ng-show="settingsForm[\'announce_position_limit\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ANNOUNCEPOSITIONLIMIT_REQUIRED">AnnouncePositionLimit field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.REPORTHOLDTIMEAGENT">ReportHoldtimeAgent</label>\n <md-select name="reportholdtime" ng-model="vm.voiceQueue.reportholdtime" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.REPORTHOLDTIMEAGENT"></span></div>\n <div ng-messages="settingsForm[\'reportholdtime\'].$error" ng-show="settingsForm[\'reportholdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.REPORTHOLDTIMEAGENT_REQUIRED">ReportHoldtimeAgent field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n <div class="voiceQueue-detail-form-container announcements md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ANNOUNCEMENTS">ANNOUNCEMENTS</div>\n </div>\n <form name="announcementsForm" novalidate>\n <md-input-container class="md-block">\n <label translate="VOICE.PERIODICANNOUNCE">PeriodicAnnounce</label>\n <md-select name="periodic_announce" ng-model="vm.voiceQueue.periodic_announce" autofocus multiple ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Default</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + periodic_announce.save_name" ng-repeat="periodic_announce in vm.sounds" ng-disabled="periodic_announce.canSelect === false">{{ periodic_announce.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.PERIODICANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'periodic_announce\'].$error" ng-show="announcementsForm[\'periodic_announce\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.PERIODICANNOUNCE_REQUIRED">PeriodicAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.HOLDTIMEANNOUNCE">HoldTimeAnnounce</label>\n <md-select name="queue_reporthold" ng-model="vm.voiceQueue.queue_reporthold" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_reporthold.save_name" ng-repeat="queue_reporthold in vm.sounds" ng-disabled="queue_reporthold.canSelect === false">{{ queue_reporthold.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.HOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_reporthold\'].$error" ng-show="announcementsForm[\'queue_reporthold\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.HOLDTIMEANNOUNCE_REQUIRED">HoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.YOUARENEXTANNOUNCE">YouareNextAnnounce</label>\n <md-select name="queue_youarenext" ng-model="vm.voiceQueue.queue_youarenext" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_youarenext.save_name" ng-repeat="queue_youarenext in vm.sounds" ng-disabled="queue_youarenext.canSelect === false">{{ queue_youarenext.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.YOUARENEXTANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_youarenext\'].$error" ng-show="announcementsForm[\'queue_youarenext\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.YOUARENEXTANNOUNCE_REQUIRED">YouareNextAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THEREAREANNOUNCE">ThereareAnnounce</label>\n <md-select name="queue_thereare" ng-model="vm.voiceQueue.queue_thereare" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thereare.save_name" ng-repeat="queue_thereare in vm.sounds" ng-disabled="queue_thereare.canSelect === false">{{ queue_thereare.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THEREAREANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thereare\'].$error" ng-show="announcementsForm[\'queue_thereare\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THEREAREANNOUNCE_REQUIRED">ThereareAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.WAITINGCALLSANNOUNCE">WaitingCallsAnnounce</label>\n <md-select name="queue_callswaiting" ng-model="vm.voiceQueue.queue_callswaiting" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_callswaiting.save_name" ng-repeat="queue_callswaiting in vm.sounds" ng-disabled="queue_callswaiting.canSelect === false">{{ queue_callswaiting.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.WAITINGCALLSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_callswaiting\'].$error" ng-show="announcementsForm[\'queue_callswaiting\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.WAITINGCALLSANNOUNCE_REQUIRED">WaitingCallsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.ESTIMATEDHOLDTIMEANNOUNCE">EstimatedHoldTimeAnnounce</label>\n <md-select name="queue_holdtime" ng-model="vm.voiceQueue.queue_holdtime" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_holdtime.save_name" ng-repeat="queue_holdtime in vm.sounds" ng-disabled="queue_holdtime.canSelect === false">{{ queue_holdtime.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.ESTIMATEDHOLDTIMEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_holdtime\'].$error" ng-show="announcementsForm[\'queue_holdtime\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.ESTIMATEDHOLDTIMEANNOUNCE_REQUIRED">EstimatedHoldTimeAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTESANNOUNCE">MinutesAnnounce</label>\n <md-select name="queue_minutes" ng-model="vm.voiceQueue.queue_minutes" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minutes.save_name" ng-repeat="queue_minutes in vm.sounds" ng-disabled="queue_minutes.canSelect === false">{{ queue_minutes.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTESANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minutes\'].$error" ng-show="announcementsForm[\'queue_minutes\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTESANNOUNCE_REQUIRED">MinutesAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MINUTEANNOUNCE">MinuteAnnounce</label>\n <md-select name="queue_minute" ng-model="vm.voiceQueue.queue_minute" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_minute.save_name" ng-repeat="queue_minute in vm.sounds" ng-disabled="queue_minute.canSelect === false">{{ queue_minute.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MINUTEANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_minute\'].$error" ng-show="announcementsForm[\'queue_minute\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MINUTEANNOUNCE_REQUIRED">MinuteAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SECONDSANNOUNCE">SecondsAnnounce</label>\n <md-select name="queue_seconds" ng-model="vm.voiceQueue.queue_seconds" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_seconds.save_name" ng-repeat="queue_seconds in vm.sounds" ng-disabled="queue_seconds.canSelect === false">{{ queue_seconds.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SECONDSANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_seconds\'].$error" ng-show="announcementsForm[\'queue_seconds\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SECONDSANNOUNCE_REQUIRED">SecondsAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.THANKYOUANNOUNCE">ThankYouAnnounce</label>\n <md-select name="queue_thankyou" ng-model="vm.voiceQueue.queue_thankyou" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="null">Default</md-option>\n <md-option ng-value="\'\'">Disabled</md-option>\n <md-option ng-value="\'/var/opt/motion2/server/files/sounds/converted/\' + queue_thankyou.save_name" ng-repeat="queue_thankyou in vm.sounds" ng-disabled="queue_thankyou.canSelect === false">{{ queue_thankyou.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.THANKYOUANNOUNCE"></span></div>\n <div ng-messages="announcementsForm[\'queue_thankyou\'].$error" ng-show="announcementsForm[\'queue_thankyou\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.THANKYOUANNOUNCE_REQUIRED">ThankYouAnnounce field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n <md-tab>\n <md-tab-label>\n <span translate="VOICE.ADVANCED">ADVANCED</span>\n </md-tab-label>\n <md-tab-body>\n <div class="voiceQueue-detail-form-container advanced md-background-bg md-whiteframe-1dp">\n <div class="pb-16" layout="row" layout-align="start center">\n <div class="h2 secondary-text" translate="VOICE.ADVANCED">ADVANCED</div>\n </div>\n <form name="advancedForm" novalidate>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.acw" aria-label="AfterCallWork" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.AFTERCALLWORK">AfterCallWork</span></md-switch>\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORK"></span></div>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.acw" class="md-block">\n <label translate="VOICE.AFTERCALLWORKDURATION">AfterCallWorkDuration</label>\n <input type="number" name="acwTimeout" ng-model="vm.voiceQueue.acwTimeout" min="0" ng-required="true" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.AFTERCALLWORKDURATION"></span></div>\n <div ng-messages="advancedForm[\'acwTimeout\'].$error" ng-show="advancedForm[\'acwTimeout\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_REQUIRED">AfterCallWorkDuration field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO">AfterCallWorkDuration must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.AUTOPAUSE">AutoPause</label>\n <md-select name="autopause" ng-model="vm.voiceQueue.autopause" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'all\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.AUTOPAUSE"></span></div>\n <div ng-messages="advancedForm[\'autopause\'].$error" ng-show="advancedForm[\'autopause\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.AUTOPAUSE_REQUIRED">AutoPause field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.RINGINUSE">RingInUse</label>\n <md-select name="ringinuse" ng-model="vm.voiceQueue.ringinuse" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.RINGINUSE"></span></div>\n <div ng-messages="advancedForm[\'ringinuse\'].$error" ng-show="advancedForm[\'ringinuse\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RINGINUSE_REQUIRED">RingInUse field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MEMBERDELAY">MemberDelay</label>\n <input type="number" name="memberdelay" ng-model="vm.voiceQueue.memberdelay" min="0" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.MEMBERDELAY"></span></div>\n <div ng-messages="advancedForm[\'memberdelay\'].$error" ng-show="advancedForm[\'memberdelay\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MEMBERDELAY_REQUIRED">MemberDelay field is required</span>\n </div>\n <div ng-message="min">\n <span translate="VOICE.ERRORS.MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO">MemberDelay must be a valid greater or equal than</span> <span>0</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.TIMEOUTRESTART">TimeoutRestart</label>\n <md-select name="timeoutrestart" ng-model="vm.voiceQueue.timeoutrestart" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.TIMEOUTRESTART"></span></div>\n <div ng-messages="advancedForm[\'timeoutrestart\'].$error" ng-show="advancedForm[\'timeoutrestart\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.TIMEOUTRESTART_REQUIRED">TimeoutRestart field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.MONITORFORMAT">MonitorFormat</label>\n <md-select name="monitor_format" ng-model="vm.voiceQueue.monitor_format" ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="\'\'">Inactive</md-option>\n <md-option ng-value="\'wav\'">wav</md-option>\n <md-option ng-value="\'wav49\'">wav49</md-option>\n <md-option ng-value="\'gsm\'">gsm</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MONITORFORMAT"></span></div>\n <div ng-messages="advancedForm[\'monitor_format\'].$error" ng-show="advancedForm[\'monitor_format\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MONITORFORMAT_REQUIRED">MonitorFormat field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.CONTEXT">Context</label>\n <input type="text" name="context" ng-model="vm.voiceQueue.context" ng-disabled="!vm.crudPermissions.canEdit">\n\n <div class="hint"><span translate="VOICE.HELP.CONTEXT"></span></div>\n <div ng-messages="advancedForm[\'context\'].$error" ng-show="advancedForm[\'context\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.CONTEXT_REQUIRED">Context field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETINTERFACEVARIABLES">SetInterfaceVariables</label>\n <md-select name="setinterfacevar" ng-model="vm.voiceQueue.setinterfacevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETINTERFACEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setinterfacevar\'].$error" ng-show="advancedForm[\'setinterfacevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETINTERFACEVARIABLES_REQUIRED">SetInterfaceVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEVARIABLES">SetQueueVariables</label>\n <md-select name="setqueuevar" ng-model="vm.voiceQueue.setqueuevar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueuevar\'].$error" ng-show="advancedForm[\'setqueuevar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEVARIABLES_REQUIRED">SetQueueVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="VOICE.SETQUEUEENTRYVARIABLES">SetQueueEntryVariables</label>\n <md-select name="setqueueentryvar" ng-model="vm.voiceQueue.setqueueentryvar" ng-disabled="!vm.crudPermissions.canEdit">\n\n <md-option ng-value="\'yes\'"> {{ \'VOICE.YES\' | translate }} </md-option>\n\n <md-option ng-value="\'no\'"> {{ \'VOICE.NO\' | translate }} </md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.SETQUEUEENTRYVARIABLES"></span></div>\n <div ng-messages="advancedForm[\'setqueueentryvar\'].$error" ng-show="advancedForm[\'setqueueentryvar\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.SETQUEUEENTRYVARIABLES_REQUIRED">SetQueueEntryVariables field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <md-switch ng-model="vm.voiceQueue.mandatoryDisposition" aria-label="MandatoryDisposition" ng-disabled="!vm.crudPermissions.canEdit"><span translate="VOICE.MANDATORYDISPOSITION">MandatoryDisposition</span></md-switch>\n </md-input-container>\n <md-input-container ng-if="vm.voiceQueue.mandatoryDisposition" class="md-block">\n <label translate="VOICE.MANDATORYDISPOSITIONPAUSEID">MandatoryDispositionPauseId</label>\n <md-select name="mandatoryDispositionPauseId" ng-model="vm.voiceQueue.mandatoryDispositionPauseId" required ng-disabled="!vm.crudPermissions.canEdit">\n <md-option ng-value="mandatoryDispositionPauseId.id" ng-repeat="mandatoryDispositionPauseId in vm.pauses" ng-disabled="mandatoryDispositionPauseId.canSelect === false">{{ mandatoryDispositionPauseId.name }}</md-option>\n </md-select>\n <div class="hint"><span translate="VOICE.HELP.MANDATORYDISPOSITIONPAUSEID"></span></div>\n <div ng-messages="advancedForm[\'mandatoryDispositionPauseId\'].$error" ng-show="advancedForm[\'mandatoryDispositionPauseId\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.MANDATORYDISPOSITIONPAUSEID_REQUIRED">MandatoryDispositionPauseId field is required</span>\n </div>\n </div>\n </md-input-container>\n\n </form>\n </div>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n</div>'),e.put("app/main/apps/voice/views/voiceQueues/voiceQueues.html",'<div id="voiceQueues" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICEQUEUES">VoiceQueues</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceQueues.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceQueues =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceQueues-count">\n <span>{{vm.selectedVoiceQueues.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICEQUEUES.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceQueues()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceQueues()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceQueues" csv-label="true" filename="voiceQueues.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceQueues($event)" aria-label="delete selected" translate translate-attr-label="VOICEQUEUES.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICEQUEUE TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceQueues" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceQueues">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="id">{{ \'VOICE.ID\' | translate }}</th>\n <th md-column md-order-by="name">{{ \'VOICE.NAME\' | translate }}</th>\n <th md-column md-order-by="strategy">{{ \'VOICE.STRATEGY\' | translate }}</th>\n <th md-column md-order-by="description">{{ \'VOICE.DESCRIPTION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceQueues.rows.length">\n <td md-cell colspan="5">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceQueue" md-select-id="id" ng-repeat="voiceQueue in vm.voiceQueues.rows">\n <td md-cell ng-if="voiceQueue.userpic"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="api/users/{{voiceQueue.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceQueue.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceQueue.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="id ">{{voiceQueue.id}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="name ">{{voiceQueue.name}}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="strategy ">{{ vm.arraystrategy[voiceQueue.strategy].option }}</td>\n <td ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(voiceQueue, ev) : vm.createOrEditVoiceQueue($event, voiceQueue)" md-cell class="description ">{{voiceQueue.description}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.crudPermissions.canEdit">\n <md-button ng-click="vm.editstate(voiceQueue, $event)" translate="VOICE.EDIT_VOICEQUEUE">\n Edit VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.teamadddialog(voiceQueue, $event)" translate="VOICE.TEAMADD_VOICEQUEUE">\n teamadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.agentadddialog(voiceQueue, $event)" translate="VOICE.AGENTADD_VOICEQUEUE">\n agentadd VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voiceQueue, $event)" translate="VOICE.DELETE_VOICEQUEUE">\n Delete VoiceQueue\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.gotorealtimegoto(voiceQueue, $event)" translate="VOICE.GOTOREALTIME_VOICEQUEUE">\n goToRealtime VoiceQueue\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceQueues.count}}" md-on-paginate="vm.getVoiceQueues" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICEQUEUE TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- ADD VOICEQUEUE BUTTON --\x3e\n <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent" id="add-voiceQueue-button" ng-click="vm.createOrEditVoiceQueue($event)" aria-label="add voiceQueue" translate translate-attr-aria-label="VOICE.ADD_VOICEQUEUE">\n <md-icon md-font-icon="icon-plus"></md-icon>\n </md-button>\n \x3c!-- / ADD VOICEQUEUE BUTTON --\x3e\n</div>'),e.put("app/main/apps/voice/views/voiceRecordings/create/dialog.html",'<md-dialog class="voiceRecording-dialog" aria-label="New VoiceRecording">\n <form name="voiceRecordingForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="VOICE.RATING">Rating</label>\n <md-select name="rating" ng-model="vm.voiceRecording.rating" autofocus ng-disabled="!vm.newVoiceRecording && !vm.crudPermissions.canEdit">\n <md-option ng-value="null">{{\'VOICE.NO_RATING\' | translate}}</md-option>\n <md-option value="1">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1]"></md-icon>\n </md-option>\n <md-option value="2">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2]"></md-icon>\n </md-option>\n <md-option value="3">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3]"></md-icon>\n </md-option>\n <md-option value="4">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4]"></md-icon>\n </md-option>\n <md-option value="5">\n <md-icon md-font-icon="icon-star" style="color:red" ng-repeat="icon in [1,2,3,4,5]"></md-icon>\n </md-option>\n </md-select>\n <div ng-messages="voiceRecordingForm[\'rating\'].$error" ng-show="voiceRecordingForm[rating].$touched" role="alert">\n <div ng-message="required">\n <span translate="VOICE.ERRORS.RATING_REQUIRED">Rating field is required</span>\n </div>\n </div>\n </md-input-container>\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center" ng-if="!vm.crudPermissions.readOnly">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && !vm.newVoiceRecording" ng-click="vm.saveVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid || voiceRecordingForm.$pristine" aria-label="SAVE" translate="VOICE.SAVE" translate-attr-aria-label="VOICE.SAVE">\n SAVE\n </md-button>\n\n <md-button type="submit" ng-if="vm.crudPermissions.canEdit && vm.newVoiceRecording" ng-click="vm.addNewVoiceRecording()" class="send-button md-accent md-raised" ng-disabled="voiceRecordingForm.$invalid" aria-label="ADD" translate="VOICE.ADD_VOICERECORDING" translate-attr-aria-label="VOICE.ADD_VOICERECORDING">\n ADD VOICERECORDING\n </md-button>\n </div>\n <div layout="row">\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete && !vm.newVoiceRecording" ng-click="vm.deleteVoiceRecording($event)" aria-label="DELETE" translate translate-attr-aria-label="VOICE.DELETE">\n <md-icon md-font-icon="icon-delete"></md-icon>\n <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/main/apps/voice/views/voiceRecordings/voiceRecordings.html",'<div id="voiceRecordings" class="page-layout simple left-sidenav inner-sidenav">\n\n \x3c!-- HEADER --\x3e\n <div class="header md-accent-bg" layout="row" layout-align="space-between center">\n\n \x3c!-- APP TITLE --\x3e\n <div layout="row" layout-align="start center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-icon">\n <md-icon md-font-icon="icon-phone" class="s24"></md-icon>\n </span>\n <span class="logo-text" translate="VOICE.VOICERECORDINGS">VoiceRecordings</span>\n </div>\n </div>\n \x3c!-- / APP TITLE --\x3e\n\n <div layout="row">\n \x3c!-- SEARCH --\x3e\n <div class="search-input-wrapper" layout="row" layout-align="start center">\n <label for="search">\n <md-icon md-font-icon="icon-magnify"></md-icon>\n </label>\n <md-input-container md-no-float class="m-0">\n <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter" ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="VOICE.SEARCH_FOR_ANYONE">\n </md-input-container>\n </div>\n \x3c!-- / SEARCH --\x3e\n \x3c!-- DATE FILTER --\x3e\n <div class="padding-horizontal-20" layout="column" layout-align="center center">\n <span class="font-size-10" translate="DASHBOARDS.SELECT_DATE_RANGE">Select Date Range</span>\n <div layout="row" layout-align="center center">\n <md-button ng-if="vm.pickerModel.dateStart" ng-click="vm.clearDateFilter()" class="md-icon-button no-padding width-20 height-20">\n <md-tooltip>{{ \'DASHBOARDS.CLEAR\' | translate }}</md-tooltip>\n <md-icon md-font-icon="icon-close" class="s16 white-fg"></md-icon>\n </md-button>\n <md-date-range localization-map="vm.localizationMap" ng-model="vm.pickerModel" auto-confirm="true" show-template="true" md-on-select="vm.getVoiceRecordings()" placeholder="{{ \'DASHBOARDS.ALL\' | translate }}"></md-date-range>\n </div>\n </div>\n \x3c!-- /DATE FILTER --\x3e\n </div>\n </div>\n \x3c!-- / HEADER --\x3e\n\n \x3c!-- SELECTED BAR --\x3e\n <div ng-show="vm.selectedVoiceRecordings.length > 0" class="selected-bar header animate-slide-down md-accent-bg" layout="row" layout-align="start center">\n\n <div class="close-button-wrapper" ng-click="vm.selectedVoiceRecordings =[]">\n <md-button layout="row" layout-align="start center">\n <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>\n <span translate="VOICE.BACK">Back</span>\n </md-button>\n </div>\n\n <div flex layout="row" layout-align="space-between center">\n\n <div>\n <span class="selected-voiceRecordings-count">\n <span>{{vm.selectedVoiceRecordings.length}}</span>\n <span translate="VOICE.SELECTED">selected</span>\n </span>\n\n <md-menu class="select-menu" ng-if="!vm.currentThread">\n <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)" aria-label="multi select toggle" translate translate-attr-aria-label="VOICERECORDINGS.MULTI_SELECT_TOGGLE">\n <md-icon md-font-icon="icon-menu-down"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.selectAllVoiceRecordings()" translate="VOICE.SELECT_ALL">\n Select all\n </md-button>\n </md-menu-item>\n <md-menu-item>\n <md-button ng-click="vm.deselectVoiceRecordings()" translate="VOICE.SELECT_NONE">\n Select none\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n\n <div class="multi-select-actions">\n <button class="md-icon-button" ng-csv="vm.exportSelectedVoiceRecordings" csv-label="true" filename="voiceRecordings.csv">\n <md-icon md-font-icon="icon-file-excel"></md-icon>\n </button>\n <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete" ng-click="vm.deleteSelectedVoiceRecordings($event)" aria-label="delete selected" translate translate-attr-label="VOICERECORDINGS.DELETE_SELECTED">\n <md-icon md-font-icon="icon-delete"></md-icon>\n </md-button>\n </div>\n </div>\n </div>\n \x3c!-- / SELECTED BAR --\x3e\n\n \x3c!-- CONTENT --\x3e\n <div class="content" md-background-bg layout="row" layout-align="start start">\n\n \x3c!-- MAIN --\x3e\n <div class="main scrollable" ms-scroll>\n\n\n \x3c!-- VOICERECORDING TABLE --\x3e\n <md-card>\n <md-table-container>\n <table md-table md-row-select multiple ng-model="vm.selectedVoiceRecordings" md-progress="vm.promise">\n <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getVoiceRecordings">\n <tr md-row>\n <th md-column ng-if="vm.table == \'users\' || vm.table == \'agents\'" width="20px"></th>\n <th md-column md-order-by="type">{{ \'VOICE.TYPE\' | translate }}</th>\n <th md-column md-order-by="uniqueid">{{ \'VOICE.UNIQUEID\' | translate }}</th>\n <th md-column md-order-by="calleridnum">{{ \'VOICE.CALLER\' | translate }}</th>\n <th md-column md-order-by="exten">{{ \'VOICE.CALLED\' | translate }}</th>\n <th md-column md-order-by="connectedlinenum">{{ \'VOICE.CONNECTED\' | translate }}</th>\n <th md-column md-order-by="queue">{{ \'VOICE.QUEUE\' | translate }}</th>\n <th md-column md-order-by="membername">{{ \'VOICE.AGENT\' | translate }}</th>\n <th md-column md-order-by="rating">{{ \'VOICE.RATING\' | translate }}</th>\n <th md-column md-order-by="audio">{{ \'VOICE.AUDIO\' | translate }}</th>\n <th md-column md-order-by="createdAt">{{ \'VOICE.DATE\' | translate }}</th>\n <th md-column md-order-by="userDisposition">{{ \'VOICE.DISPOSITION\' | translate }}</th>\n <th md-column width="10px"></th>\n </tr>\n </thead>\n <tbody md-body>\n <tr md-row ng-hide="vm.voiceRecordings.rows.length">\n <td md-cell colspan="12">\n <div layout="row" layout-align="center center">\n <span translate="VOICE.NO_AVAILABLE_INFO">No Available Info</span>\n </div>\n </td>\n </tr>\n <tr md-row md-select="voiceRecording" md-select-id="id" ng-repeat="voiceRecording in vm.voiceRecordings.rows">\n <td md-cell ng-if="voiceRecording.userpic"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="api/users/{{voiceRecording.id}}/avatar" /></td>\n <td md-cell ng-if="!voiceRecording.userpic && (vm.table == \'users\' || vm.table == \'agents\')"><img class="avatar" alt="{{voiceRecording.name}}" ng-src="assets/images/avatars/profile.png" /></td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="type ">{{voiceRecording.type}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="uniqueid ">{{voiceRecording.uniqueid}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="calleridnum ">{{voiceRecording.calleridnum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="exten ">{{voiceRecording.exten}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="connectedlinenum ">{{voiceRecording.connectedlinenum}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="queue ">{{voiceRecording.queue}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="membername ">{{voiceRecording.membername}}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="rating ">\n <md-icon md-font-icon="icon-star" style="color:red" ng-show="voiceRecording.rating" ng-repeat="rating in [1,2,3,4,5] | limitTo:voiceRecording.rating"></md-icon><span ng-hide="voiceRecording.rating" translate="VOICE.NO_RATING">No rating</span>\n </td>\n <td md-cell class="audio " ng-switch="voiceRecording.format">\n \x3c!-- audio recording directive --\x3e\n <ms-recording ng-switch-when=".wav" id="voiceRecording.id"></ms-recording>\n \x3c!-- / audio recording directive --\x3e\n <span ng-switch-when=".gsm|.WAV" ng-switch-when-separator="|">\n <em>{{ \'VOICE.CANT_PLAY_GSM_AUDIO_FILES\' | translate }}</em>\n </span>\n </td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="createdAt ">{{voiceRecording.createdAt | date:\'medium\' }}</td>\n <td ng-click="vm.createOrEditVoiceRecording($event, voiceRecording)" md-cell class="userDisposition ">{{voiceRecording.userDisposition}}</td>\n <td md-cell class="actions">\n <md-menu>\n <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="VOICE.MORE" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="3">\n <md-menu-item>\n <md-button ng-click="vm.downloadfile2(voiceRecording, $event)" translate="VOICE.DOWNLOAD_VOICERECORDING">\n Download VoiceRecording\n </md-button>\n </md-menu-item>\n <md-menu-item ng-if="vm.crudPermissions.canDelete">\n <md-button ng-click="vm.deleteconfirm(voiceRecording, $event)" translate="VOICE.DELETE_VOICERECORDING">\n Delete VoiceRecording\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </td>\n </tr>\n </tbody>\n </table>\n </md-table-container>\n\n <md-table-pagination md-label="{page: \'{{\'VOICE.PAGE\' | translate}}:\', rowsPerPage: \'{{\'VOICE.ROWSPERPAGE\' | translate}}:\', of: \'{{\'VOICE.OF\' | translate}}\'}" md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page" md-total="{{vm.voiceRecordings.count}}" md-on-paginate="vm.getVoiceRecordings" md-page-select></md-table-pagination>\n </md-card>\n \x3c!-- / VOICERECORDING TABLE --\x3e\n \x3c!-- NO RESULTS --\x3e\n\n \x3c!-- / NO RESULTS --\x3e\n </div>\n \x3c!-- / MAIN --\x3e\n\n </div>\n \x3c!-- / CONTENT --\x3e\n\n \x3c!-- NO ADD BUTTON BUTTON --\x3e\n</div>'),e.put("app/navigation/layouts/horizontal-navigation/navigation.html",'<div layout="row" layout-align="start center">\n <ms-navigation-horizontal></ms-navigation-horizontal>\n</div>'),e.put("app/navigation/layouts/vertical-navigation-fullwidth-toolbar-2/navigation.html",'<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/navigation/layouts/vertical-navigation/navigation.html",'<md-toolbar class="navigation-header md-whiteframe-1dp" layout="row" layout-align="space-between center">\n <div class="logo" layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n \x3c!-- <span class="logo-image"><img src="assets/images/logos/whisker_32x32.png" alt="motion_whisker_32x32" /></span> --\x3e\n <span class="logo-text text-truncate">{{vm.getLogo() | uppercase}}</span>\n </div>\n <md-icon class="fold-toggle s18" md-font-icon="icon-backburger" hide show-gt-sm ng-click="vm.toggleMsNavigationFolded()"></md-icon>\n</md-toolbar>\n\n<ms-navigation class="scrollable" folded="vm.folded" ms-scroll="vm.msScrollOptions"></ms-navigation>'),e.put("app/quick-panel/quick-panel.html",'<md-content>\n <md-tabs md-no-pagination md-swipe-content md-stretch-tabs="always">\n <md-tab>\n <md-tab-label>\n <span translate="QUICKPANEL.TODAY">TODAY</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="today-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/today/today-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'" ng-controller="ChatInternalController as vm_ct" ng-init="vm_ct.init(vm.license)" md-on-deselect="vm_ct.user = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalMessages}}</div>\n <span>MESSENGER</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="chat-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/chat/chat-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n <md-tab ng-if="vm.currentUser.allowmessenger || vm.currentUser.role !== \'agent\'" ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'" ng-controller="ChatGroupController as vm_cg" ng-init="vm_cg.init(vm.license)" md-on-deselect="vm_cg.group = undefined">\n <md-tab-label>\n <div ng-if="vm.unreadTotalGroupMessages" class="md-accent-bg unread-message-count-chat">{{vm.unreadTotalGroupMessages}}</div>\n <span translate="QUICKPANEL.GROUPS">GROUPS</span>\n </md-tab-label>\n <md-tab-body>\n <md-content class="group-tab scrollable" ms-scroll ng-include="\'app/quick-panel/tabs/groups/group-tab.html\'"></md-content>\n </md-tab-body>\n </md-tab>\n </md-tabs>\n</md-content>'),e.put("app/quick-panel/tabs/activity/activity-tab.html",'<md-list class="friends">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.FRIENDS">Friends</span>\n </md-subheader>\n\n <md-list-item class="friend md-3-line" ng-repeat="friend in vm.activities.friends">\n <img ng-src="{{friend.avatar}}" class="md-avatar" alt="{{friend.name}}" />\n\n <div class="status {{friend.status}}"></div>\n\n <div ng-if="contact.unread" class="md-accent-bg unread-message-count">{{contact.unread}}</div>\n\n <div class="md-list-item-text">\n <h3 class="message">{{friend.message}}</h3>\n <p class="time">{{friend.time}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="servers">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.APP_SERVERS">Application Servers</span>\n </md-subheader>\n\n <md-list-item class="server md-3-line" ng-repeat="server in vm.activities.servers">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s16 status" ng-class="server.status"></md-icon>\n\n <div class="md-list-item-text">\n <h3>{{server.location}}</h3>\n <p>{{server.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list class="stats">\n <md-subheader class="md-no-sticky">\n <span translate="QUICKPANEL.USER_STATS">User Stats</span>\n </md-subheader>\n\n <md-list-item class="stat md-2-line" ng-repeat="stat in vm.activities.stats">\n <div class="md-list-item-text">\n <span>{{stat.title}} ({{stat.current}} / {{stat.total}})</span>\n <md-progress-linear ng-class="stat.status" md-mode="determinate" value="{{stat.percent}}"></md-progress-linear>\n </div>\n </md-list-item>\n</md-list>'),e.put("app/quick-panel/tabs/chat/chat-tab.html",'<div class="main animate-slide-left" ng-hide="vm_ct.user">\n <md-subheader class="md-no-sticky">\n <div class="search" layout="row" layout-align="space-between center">\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input class="search-input" ng-model="vm_ct.search.$" type="text" placeholder="Search by fullname.." translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n <md-select ng-model="vm_ct.search.online" class="height-50 no-padding no-margin" aria-label="Chat Tab Search" <md-option ng-value="undefined">All</md-option>\n <md-option ng-value="true">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online\n </md-option>\n <md-option ng-value="false">\n <md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline\n </md-option>\n </md-select>\n </div>\n </md-subheader>\n \x3c!-- <select ng-model="vm_ct.filterOnline" class="height-50 no-padding no-margin">\n <option ng-value="undefined">All</option>\n <option ng-value="true"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 green-fg"></md-icon>Online</option>\n <option ng-value="false"><md-icon md-font-icon="icon-checkbox-blank-circle" class="s12 red-fg"></md-icon>Offline</option>\n </select> --\x3e\n <md-divider></md-divider>\n <md-list class="recent">\n <md-list-item class="contact md-3-line" ng-if="user.id != vm_ct.currentUser.id" ng-repeat="user in vm_ct.users.rows | orderBy: \'-lastMessageAt\' | filter:vm_ct.search" ng-click="vm_ct.toggleChat(user)">\n <md-divider></md-divider>\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="md-avatar" alt="{{user.fullname}}" />\n <div class="status" ng-class="{true: \'online\', false: \'offline\'}[user.online]"></div>\n <div ng-if="vm_ct.unreadMessage[user.id]" class="md-accent-bg unread-message-count">\n {{vm_ct.unreadMessage[user.id]}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{user.fullname}}</h3>\n <md-icon ng-if="!user.allowmessenger && user.role === \'agent\'" class="s16 margin-left-5" ng-style="{\'color\': \'red\' }" md-font-icon="icon-block-helper"></md-icon>\n </div>\n <p>{{user.name}} <{{user.internal}}></p>\n <div layout="row" layout-align="start center">\n <md-icon ng-if="!user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="user.lastMessage.read && user.lastMessage.FromId === vm_ct.currentUser.id" class="s16 no-margin" md-font-icon="icon-check-all md-accent"></md-icon>\n <p>{{user.lastMessage.body | limitTo:20 }}{{user.lastMessage.body.length > 20 ? \'...\' : \'\' }}</p>\n <span flex></span>\n <p class="last-message" ng-if="user.lastMessageAt != vm_ct.standardDate">\n {{user.lastMessageAt | formatdate}}</p>\n </div>\n </div>\n </md-list-item>\n </md-list>\n</div>\n\n<div class="chat animate-slide-right" ng-show="vm_ct.user" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n\n <div layout="row" layout-align="start center">\n <md-button class="md-icon-button" ng-click="vm_ct.toggleChat()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4>\n <span>{{vm_ct.user.fullname}}</span>\n </h4>\n </div>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_ct.license.webrtc && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 2 && vm_ct.user.role === \'agent\'" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_ct.webcall(vm_ct.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-menu ng-if="vm_ct.currentUser.phoneBarRemoteControl && vm_ct.currentUser.role === \'agent\' && vm_ct.currentUser.showWebBar === 0 && vm_ct.user.role === \'agent\'">\n <md-button class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="$mdOpenMenu($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.call(vm_ct.user.name)">\n {{\'DASHBOARDS.CALL_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n <md-menu-item ng-disabled="!vm_ct.currentUser.phoneBarRemoteControl">\n <md-button ng-click="vm_ct.transfer(vm_ct.user.name)">\n {{\'DASHBOARDS.TRANSFER_NUMBER\' | translate}} ({{vm_ct.user.name}})\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-dialog">\n <div layout="row" ng-repeat="message in vm_ct.user.messages.rows" class="md-padding message-row" ng-class="message.FromId === vm_ct.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId === vm_ct.user.id" ng-src="{{vm_ct.user.userpic ? \'api/users/\' + vm_ct.user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{vm_ct.user.fullname}}" />\n <img ng-if="message.FromId === vm_ct.currentUser.id" class="avatar" ng-src="{{vm_ct.currentUser.userpic ? \'api/users/\' + vm_ct.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="!message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check"></md-icon>\n <md-icon ng-if="message.read && message.FromId === vm_ct.currentUser.id" class="s16 margin-5" md-font-icon="icon-check-all md-accent"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-submit="vm_ct.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 && !vm_ct.disabled? vm_ct.reply() : null" flex ng-model="vm_ct.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button ng-disable="vm_ct.disabled" class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/create/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n \x3c!--START Error--\x3e\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n \x3c!--END Error--\x3e\n\n \x3c!--START NAME--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.NAME">Name</label>\n <input type="text" name="name" ng-model="vm.group.name" required autofocus>\n <div ng-messages="groupForm[\'name\'].$error" ng-show="groupForm[\'name\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.NAME_REQUIRED">Name field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="QUICKPANEL.ERRORS.NAME_MUST_VALID_PATTERN" translate-values="{ regex: \'/^[A-Za-z0-9\\.\\_]+$/i\' }">Name must be valid pattern </span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END NAME--\x3e\n\n \x3c!--START Members--\x3e\n <md-input-container class="md-block">\n <label translate="QUICKPANEL.MEMBERS">Members</label>\n <md-contact-chips ng-model="vm.group.members" md-contacts="vm.querySearch($query)" md-contact-name="name" md-contact-image="image" md-require-match="true" md-highlight-flags="i" placeholder="{{\'QUICKPANEL.MEMBERS\' | translate}}">\n </md-contact-chips>\n <div ng-messages="groupForm[\'strategy\'].$error" ng-show="groupForm[\'strategy\'].$touched" role="alert">\n <div ng-message="required">\n <span translate="QUICKPANEL.ERRORS.MEMBERS_REQUIRED">Members field is required</span>\n </div>\n </div>\n </md-input-container>\n \x3c!--END Members--\x3e\n\n \x3c!--START Writing--\x3e\n <md-input-container class="md-block">\n <md-switch ng-model="vm.group.write" aria-label="Write">\n {{\'QUICKPANEL.ENABLE_WRITING\' | translate}}\n </md-switch>\n </md-input-container>\n \x3c!--END Writing--\x3e\n\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-if="vm.newChatGroup" ng-click="vm.saveChatGroup()" class="send-button md-accent md-raised" ng-disabled="groupForm.$invalid || groupForm.$pristine || (vm.group.members.length < 1)" aria-label="SAVE" translate="QUICKPANEL.SAVE" translate-attr-aria-label="QUICKPANEL.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/groups/group-tab.html",'<div class="main animate-slide-left" ng-if="!vm_cg.group">\n <md-subheader>\n <div layout="row">\n \x3c!-- START Search --\x3e\n <div class="search" layout="row" layout-align="start center" flex>\n <md-icon md-font-icon="icon-magnify" class="icon search-icon"></md-icon>\n <input ng-model="vm_cg.search" type="text" translate translate-attr-placeholder="QUICKPANEL.SEARCH" flex>\n </div>\n \x3c!-- END Search --\x3e\n\n \x3c!-- START New Group --\x3e\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-icon-button" aria-label="New" ng-click="vm_cg.addGroup(null, $event)">\n <md-icon md-font-icon="icon-account-multiple-plus" class="icon"></md-icon>\n </md-button>\n \x3c!-- END New Group --\x3e\n </div>\n </md-subheader>\n\n <md-divider></md-divider>\n\n \x3c!-- START Groups --\x3e\n <md-list class="recent no-padding">\n \x3c!-- START Group --\x3e\n <md-list-item class="contact" ng-repeat="group in vm_cg.groupsToArray() | filter:vm_cg.search" ng-click="vm_cg.toggleChat(group)">\n <img src="assets/images/avatars/group.png" class="md-avatar" alt="{{group.name}}" />\n <div ng-if="group.unreadGroupMessages" class="md-accent-bg unread-message-count">{{group.unreadGroupMessages}}</div>\n <div class="md-list-item-text">\n <div layout="row">\n <h3>{{group.name}}</h3>\n </div>\n </div>\n\n <md-button ng-if="vm_cg.currentUser.role !== \'agent\'" class="md-secondary md-icon-button" aria-label="Remove" ng-click="vm_cg.deleteGroup(group, $event)">\n <md-icon md-font-icon="icon-delete" class="icon s18"></md-icon>\n </md-button>\n\n <md-divider ng-if="!$last"></md-divider>\n </md-list-item>\n <md-list-item>\n <div ng-if="!vm_cg.groupsToArray().length" layout="row" layout-align="center center" flex>\n <span>{{\'QUICKPANEL.NO_AVAILABLE_GROUPS\' | translate}}</span>\n </div>\n </md-list-item>\n \x3c!-- END Group --\x3e\n </md-list>\n \x3c!-- END Groups --\x3e\n</div>\n\n<div class="chat animate-slide-right" ng-if="vm_cg.group" layout="column">\n <md-toolbar class="md-accent">\n <div class="md-toolbar-tools " layout="row" layout-align="space-between center">\n <md-button class="md-icon-button" ng-click="vm_cg.back()" aria-label="Back" translate translate-attr-aria-label="QUICKPANEL.BACK" flex="15">\n <md-icon md-font-icon="icon-keyboard-backspace"></md-icon>\n </md-button>\n <h4 flex layout-align="start center" style="max-height: 100%; overflow-y:auto;">\n <span translate="QUICKPANEL.YOU" translate-values=\'{participants: vm_cg.participants}\'></span>\n </h4>\n\n <div layout="row" layout-align="end center">\n <md-button ng-if="vm_cg.license.webrtc && vm_cg.currentUser.role === \'agent\' && vm_cg.currentUser.showWebBar === 2 && vm_cg.user.role === \'agent\' && vm_cg.user.showWebBar === 2" class="md-icon-button" aria-label="Call" translate translate-attr-aria-label="QUICKPANEL.CALL" ng-click="vm_cg.webcall(vm_cg.user.name)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n </div>\n </div>\n\n </md-toolbar>\n <md-content flex layout-paddings ms-scroll id="chat-group-dialog">\n <div layout="row" ng-repeat="message in vm_cg.group.messages" class="message-row" ng-class="message.FromId === vm_cg.currentUser.id ? \'user\' : \'contact\'">\n <img ng-if="message.FromId !== vm_cg.currentUser.id" ng-src="{{\'api/users/\' + message.FromId + \'/avatar\'}}" class="avatar" alt="{{vm_cg.user.fullname}}" />\n <img ng-if="message.FromId === vm_cg.currentUser.id" class="avatar" ng-src="{{vm_cg.currentUser.userpic ? \'api/users/\' + vm_cg.currentUser.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}">\n <div class="bubble" flex>\n <div ng-if="message.FromId !== vm_cg.currentUser.id">\n <span style="font-size: 12px;">{{vm_cg.group.membersByKeys[message.FromId].fullname}}</span>\n </div>\n <span class="message" ng-bind-html="message.body | embed:{linkTarget:\'_blank\',emoji:false,fontSmiley:false}"></span>\n <div layout="row" layout-align="end center">\n <span class="time secondary-text" style="margin-top: 0px;">{{message.createdAt | formatdate }}</span>\n <md-icon ng-if="message.FromId === vm_cg.currentUser.id" class="s16 margin-5" style="cursor: pointer;" md-font-icon="icon-information-outline" ng-click="vm_cg.showMessageInfo($event, message)"></md-icon>\n </div>\n </div>\n </div>\n </md-content>\n\n <form ng-if="(vm_cg.currentUser.role !== \'agent\') || vm_cg.group.write" ng-submit="vm_cg.reply()" layout="row" class="reply" layout-align="start center">\n <textarea ng-keyup="$event.keyCode == 13 ? vm_cg.reply() : null" flex ng-model="vm_cg.replyMessage" placeholder="Type and hit enter to send message" translate translate-attr-placeholder="QUICKPANEL.REPLY_PLACEHOLDER" autofocus></textarea>\n\n <md-button class="md-fab md-mini" type="submit" aria-label="Send message" translate translate-attr-aria-label="QUICKPANEL.SEND_MESSAGE">\n <md-icon md-font-icon="icon-send"></md-icon>\n </md-button>\n </form>\n</div>'),e.put("app/quick-panel/tabs/groups/info/dialog.html",'<md-dialog class="group-dialog" aria-label="New ChatGroup">\n <form name="groupForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">{{ vm.title | translate }}</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog(null)">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div ng-if="vm.data.messages[$index].FromId !== vm.data.messages[$index].ToId" ng-repeat="user in vm.data.users" layout-margin>\n <div layout="row">\n <div layout="row" layout-align="start center">\n <img ng-src="{{user.userpic ? \'api/users/\' + user.id + \'/avatar\' : \'assets/images/avatars/profile.png\'}}" class="avatar" alt="{{user.fullname}}" />\n <span>{{user.fullname}}</span>\n </div>\n <div layout="row" layout-align="end center" flex>\n <md-icon class="s16 margin-5" md-font-icon="{{vm.data.messages[$index].read ? \'icon-check-all md-accent\' : \'icon-check\'}}"></md-icon>\n <span class="time secondary-text">{{vm.data.messages[$index].updatedAt | formatdate }}</span>\n </div>\n </div>\n <div>\n <md-divider ng-if="!$last"></md-divider>\n </div>\n </div>\n </md-dialog-content>\n </form>\n</md-dialog>'),e.put("app/quick-panel/tabs/today/today-tab.html",'<md-list class="date">\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.TODAY">Today</span></md-subheader>\n <md-list-item class="md-display-1 md-2-line">\n <div class="secondary-text">\n <div translate="QUICKPANEL.{{ (vm.date | date:\'EEEE\').toUpperCase() }}"></div>\n <div layout="row" layout-align="start start">\n <span> {{vm.date | date:\'d\'}}</span>\n <span class="md-subhead">th</span>\n <span translate="QUICKPANEL.{{ (vm.date | date:\'MMMM\').toUpperCase() }}"></span>\n </div>\n </div>\n </md-list-item>\n</md-list>\n\n\x3c!-- <md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.EVENTS">Events</span></md-subheader>\n\n <md-list-item class="md-2-line" ng-repeat="event in vm.events" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{event.title}}</h3>\n\n <p>{{event.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.NOTES">Notes</span></md-subheader>\n <md-list-item class="md-2-line" ng-repeat="note in vm.notes" ng-click="dummyFunction()">\n <div class="md-list-item-text">\n <h3>{{note.title}}</h3>\n\n <p>{{note.detail}}</p>\n </div>\n </md-list-item>\n</md-list>\n\n<md-divider></md-divider>\n\n<md-list>\n <md-subheader class="md-no-sticky"><span translate="QUICKPANEL.QUICK_SETTINGS">Quick Settings</span></md-subheader>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.NOTIFICATIONS">Notifications</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.notify" aria-label="Notifications" translate\n translate-attr-aria-label="QUICKPANEL.NOTIFICATIONS"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.CLOUD_SYNC">Cloud Sync</h3>\n <md-switch class="md-secondary" ng-model="vm.settings.cloud" aria-label="Cloud Sync" translate\n translate-attr-aria-label="QUICKPANEL.CLOUD_SYNC"></md-switch>\n </md-list-item>\n\n <md-list-item>\n <h3 translate="QUICKPANEL.RETRO_THRUSTERS">Retro Thrusters</h3>\n <md-switch class="md-secondary md-warn" ng-model="vm.settings.retro" aria-label="Retro Thrusters" translate\n translate-attr-aria-label="QUICKPANEL.RETRO_THRUSTERS"></md-switch>\n </md-list-item>\n</md-list> --\x3e'),e.put("app/reset/reset.html",'<div id="reset-password" class="flex-scrollable" layout="column" ng-init="vm.onInit()" ms-scroll>\n <div id="reset-password-form-wrapper" layout="column" layout-align="center center">\n <div id="reset-password-form" class="md-whiteframe-8dp">\n\n <img src="/api/settings/1/logo_login" alt="logo_login" class="logo_login" />\n\n <div class="title" translate="RESETPASSWORD.TITLE">Reset your password</div>\n\n <form name="resetPasswordForm" novalidate>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="password" ng-model="vm.form.password" ng-pattern="vm.passwordPattern" placeholder="Password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD" required>\n <div ng-messages="resetPasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="RESETPASSWORD.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="RESETPASSWORD.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n\n <md-input-container class="md-block" md-no-float>\n <input type="password" name="passwordConfirm" ng-model="vm.form.passwordConfirm" placeholder="Password (Confirm)" match-password="password" translate translate-attr-placeholder="RESETPASSWORD.PASSWORD_CONFIRM">\n <div ng-messages="resetPasswordForm.passwordConfirm.$error" role="alert">\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n\n <md-button type="button" ng-click="vm.resetPassword()" class="md-raised md-accent submit-button" aria-label="UPDATE MY PASSWORD" ng-disabled="resetPasswordForm.$invalid || resetPasswordForm.$pristine" translate="RESETPASSWORD.UPDATE_PASSWORD" translate-attr-aria-label="RESETPASSWORD.UPDATE_PASSWORD">\n RESET MY PASSWORD\n </md-button>\n </form>\n </div>\n </div>\n</div>'),e.put("app/toolbar/changepassword/changepassword.html",'<md-dialog class="user-dialog" aria-label="{{vm.name}}">\n <form name="changePasswordForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-accent md-hue-2">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span ng-if="vm.reset" class="title" translate="TOOLBAR.RESETPASSWORD">Reset Password</span>\n <span ng-if="!vm.reset" class="title" translate="TOOLBAR.CHANGEPASSWORD">Change Password</span>\n <md-button ng-if="!vm.reset" class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n <md-dialog-content ms-scroll>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.OLD_PASSWORD">Old Password</label>\n <input type="password" name="oldPassword" ng-model="vm.oldPassword" placeholder="Password" translate translate-attr-placeholder="TOOLBAR.OLD_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.NEW_PASSWORD">New Password</label>\n <input type="password" name="password" ng-model="vm.password" placeholder="Password" ng-pattern="vm.passwordPattern" translate translate-attr-placeholder="TOOLBAR.NEW_PASSWORD" required>\n <div ng-messages="changePasswordForm.password.$error" role="alert">\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.PASSWORD_REQUIRED">Password field is required</span>\n </div>\n <div ng-message="pattern">\n <span translate="TOOLBAR.ERRORS.SECURE_PASSWORD_PATTERN">Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}.</span>\n </div>\n </div>\n </md-input-container>\n <md-input-container class="md-block">\n <label translate="TOOLBAR.CONFIRM_PASSWORD">Confirm Password</label>\n <input type="password" match-password="password" name="confirmPassword" ng-model="confirmPassword">\n <div ng-messages="changePasswordForm.confirmPassword.$error" role="alert" multiple>\n <div ng-message="required">\n <span translate="TOOLBAR.ERRORS.CONFIRM_REQUIRED">Confirm field is required</span>\n </div>\n <div ng-message="passwordMatch">\n <span translate="TOOLBAR.ERRORS.CONFIRM_NOT_MATCH">Your password did not match</span>\n </div>\n </div>\n </md-input-container>\n <div class="error-list">\n <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">\n <div>\n <span class="message">{{error.message}}</span>\n <span class="type">({{error.type}})</span>\n </div>\n <md-button class="md-icon-button">\n <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>\n </md-button>\n </div>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions layout="row" layout-align="space-between center">\n <div layout="row" layout-align="start center">\n <md-button type="submit" ng-click="vm.savePassword()" class="send-button md-accent md-raised" ng-disabled="changePasswordForm.$invalid || changePasswordForm.$pristine" aria-label="SAVE" translate="TOOLBAR.SAVE" translate-attr-aria-label="TOOLBAR.SAVE">\n SAVE\n </md-button>\n </div>\n </md-dialog-actions>\n </form>\n</md-dialog>'),e.put("app/toolbar/layouts/vertical-navigation/toolbar.html",'<div layout="row" layout-align="start center">\n <div layout="row" layout-align="start center" flex>\n <md-button id="navigation-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'navigation\')" hide-gt-sm aria-label="Toggle navigation" translate translate-attr-aria-label="TOOLBAR.TOGGLE_NAVIGATION">\n <md-icon md-font-icon="icon-menu" class="icon"></md-icon>\n </md-button>\n\n <ms-shortcuts ng-if="!vm.isAgent()"></ms-shortcuts>\n\n <div class="toolbar-separator"></div>\n\n <div ng-if="vm.license.demo" class="blink md-padding">\n <span class="md-warn-fg" translate="TOOLBAR.TRIAL_VERSION">Trial Version</span>\n </div>\n\n <div ng-if="vm.isAgent()" class="logo" layout-padding-left-8 layout="row" layout-align="start center">\n <span class="logo-image"><img src="/api/settings/1/logo" alt="logo" /></span>\n <span ng-show="vm.isAgent() && (vm.user.showWebBar != 2)" class="logo-text text-truncate">{{ vm.getLogo() | uppercase }}</span>\n </div>\n\n \x3c!-- phonebar directive WebRtc type--\x3e\n <ms-phonebar class="ms-phonebar" ng-if="vm.isAgent() && (vm.user.showWebBar == 2)" conf="vm.conf" flex></ms-phonebar>\n \x3c!-- phonebar directive --\x3e\n </div>\n\n <div layout="row" layout-align="start center">\n\n <md-progress-circular id="toolbar-progress" ng-if="$root.loadingProgress" class="md-accent" md-diameter="32"></md-progress-circular>\n\n \x3c!-- Pause Management --\x3e\n <div ng-if="vm.isAgent() && (vm.user.showWebBar != 0)" layout="row" layout-align="end center">\n <div class="toolbar-separator"></div>\n\n <div class="border brad-5" layout="row" layout-align="center center" layout-margin>\n <md-button ng-if="vm.user.voicePause" class="md-icon-button no-margin" ng-click="vm.unpause()">\n <md-icon md-font-icon="icon-play-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.RESUME\' | translate}}</md-tooltip>\n </md-button>\n\n <md-button ng-disabled="vm.user.voicePause && \'DEFAULT PAUSE\' === vm.user.pauseType" class="md-icon-button no-margin" ng-click="vm.pause()">\n <md-icon md-font-icon="icon-pause-circle-outline" class="icon s24"></md-icon>\n <md-tooltip md-direction="bottom">{{\'TOOLBAR.PAUSE\' | translate}}</md-tooltip>\n </md-button>\n\n <md-menu>\n <md-button aria-label="Pauses" class="md-icon-button no-margin" ng-click="$mdOpenMenu($event)">\n <md-icon md-menu-origin md-font-icon="icon-dots-vertical"></md-icon>\n </md-button>\n <md-menu-content width="4">\n <md-menu-item ng-if="!vm.pauses.length">\n <md-button disabled="disabled">\n <md-icon md-font-icon="icon-pause-octagon" md-menu-align-target></md-icon>\n {{\'TOOLBAR.NO_PAUSES_AVAILABLE\' | translate}}\n </md-button>\n </md-menu-item>\n <md-menu-item ng-repeat="pause in vm.pauses">\n <md-button ng-disabled="vm.user.voicePause && pause.name === vm.user.pauseType" ng-click="vm.pause(pause.name)">\n <md-icon md-font-icon="icon-pause-circle" md-menu-align-target></md-icon>\n {{pause.name}}\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </div>\n </div>\n \x3c!-- Pause Management --\x3e\n\n <div class="h5 padding-10" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)">\n <div layout="row" layout-align="space-between center">\n <timer ng-if="vm.user.lastLoginAt" start-time="vm.user.lastLoginAt">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.LOGIN_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-timelapse" class="icon s16"></md-icon>\n </div>\n <div layout="row" layout-align="center center" ng-if="vm.user.voicePause">\n <timer start-time="vm.user.lastPauseAt">{{ days > 0 ? days + \'d\' : \'\' }} {{hhours}}:{{mminutes}}:{{sseconds}}</timer>\n <md-tooltip>{{\'TOOLBAR.PAUSE_TIME\' | translate}}</md-tooltip>\n <md-icon md-font-icon="icon-coffee" class="icon s16"></md-icon>\n </div>\n <div ng-if="vm.user.voicePause">\n <span class="blink red-fg">{{vm.user.pauseType || \'default\' | uppercase}}</span>\n </div>\n </div>\n\n <div class="toolbar-separator" ng-if="vm.isAgent() && (vm.user.showWebBar != 0)"></div>\n\n <md-menu-bar id="user-menu">\n <md-menu md-position-mode="left bottom">\n <md-button class="user-button" ng-click="$mdOpenMenu()" aria-label="User settings" translate translate-attr-aria-label="TOOLBAR.USER_SETTINGS">\n <div layout="row" layout-align="space-between center">\n <div class="avatar-wrapper">\n <img md-menu-align-target class="avatar" src="assets/images/avatars/profile.png" ng-if="!vm.user.userpic">\n <img md-menu-align-target class="avatar" ng-src="api/users/{{vm.user.id}}/avatar" ng-if="vm.user.userpic">\n <md-icon md-font-icon ng-class="vm.userStatus.icon" ng-style="{\'color\': vm.userStatus.color }" class="icon status s16"></md-icon>\n </div>\n <div layout="column" layout-align="center center" class="padding-horizontal-5">\n <span class="font-size-14 md-subhead">{{vm.user.fullname}}</span>\n <span class="font-size-12 md-subhead">{{vm.user.name}} <{{vm.user.internal}}></span>\n </div>\n\n <md-icon md-font-icon="icon-chevron-down" class="icon s16" hide-xs></md-icon>\n </div>\n </md-button>\n\n <md-menu-content width="3">\n <md-menu-item ng-if="vm.user.showWebBar == 2 && vm.user.phoneBarEnableSettings" class="md-indent">\n <md-icon md-font-icon="icon-cog" class="icon"></md-icon>\n <md-button ng-click="vm.openSettings($event)" ng-disabled="!vm.license.webrtc"><span translate="TOOLBAR.SETTINGS">SETTINGS</span></md-button>\n </md-menu-item>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-key-variant" class="icon"></md-icon>\n <md-button ng-click="vm.changePassword($event)"><span translate="TOOLBAR.CHANGEPASSWORD">Change Password</span></md-button>\n </md-menu-item>\n\n <md-menu-divider></md-menu-divider>\n\n <md-menu-item class="md-indent">\n <md-icon md-font-icon="icon-logout" class="icon"></md-icon>\n <md-button ng-click="vm.logout()">Logout</md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n </md-menu-bar>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.user.role === \'agent\' && vm.license.dialer" class="preview-button no-margin" ng-disabled="vm.disable" ng-click="vm.preview($event)" aria-label="Language" md-menu-origin md-menu-align-target>\n <div ng-if="vm.contacts" class="md-accent-bg open-contact-count">{{vm.contacts > 99 ? \'99+\' : vm.contacts}}</div>\n <md-icon md-font-icon="icon-fire" class="icon red-900-fg"></md-icon>\n <md-tooltip><span translate="TOOLBAR.PREVIEW">Preview</span></md-tooltip>\n </md-button>\n\n <ms-search-bar ng-if="vm.user.role !== \'agent\'" on-search="vm.search(query)" on-result-click="vm.searchResultClick(item)" debounce="300" collapse-on-blur="true"></ms-search-bar>\n\n <md-menu id="language-menu" md-offset="0 72" md-position-mode="target-right target" layout="column" layout-align="center center">\n <md-button class="md-icon-button no-margin" ng-click="$mdOpenMenu()" aria-label="Language" md-menu-origin md-menu-align-target>\n <div layout="row" layout-align="center center">\n <img class="flag" ng-src="assets/images/flags/{{vm.selectedLanguage.flag}}.png">\n </div>\n </md-button>\n\n <md-menu-content width="3" id="language-menu-content">\n <md-menu-item ng-repeat="(iso, lang) in vm.languages">\n <md-button ng-click="vm.changeLanguage(lang)" aria-label="{{lang.title}}" translate translate-attr-aria-label="{{lang.title}}">\n <span layout="row" layout-align="start center">\n <img class="flag flag-24" ng-src="assets/images/flags/{{lang.flag}}.png">\n <span translate="{{lang.translation}}">{{lang.title}}</span>\n </span>\n </md-button>\n </md-menu-item>\n </md-menu-content>\n </md-menu>\n\n <div class="toolbar-separator"></div>\n\n <md-button ng-if="vm.license.gray && vm.user.role !== \'agent\'" class="md-icon-button" ui-sref="app.settings.license" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n <md-button ng-if="vm.license.gray && vm.user.role === \'agent\'" class="md-icon-button" aria-label="Toggle quick panel">\n <md-icon md-font-icon="icon-alert" class="icon md-warn blink"></md-icon>\n </md-button>\n\n <div ng-if="vm.license.gray" class="toolbar-separator"></div>\n\n <md-button id="quick-panel-toggle" class="md-icon-button" ng-click="vm.toggleSidenav(\'quick-panel\')" aria-label="Toggle quick panel" translate translate-attr-aria-label="TOOLBAR.TOGGLE_QUICK_PANEL">\n <div ng-if="(vm.unreadTotalMessages + vm.unreadTotalGroupMessages)" class="md-accent-bg unread-message-count">{{vm.unreadTotalMessages + vm.unreadTotalGroupMessages}}</div>\n <md-icon md-font-icon="icon-format-list-bulleted" class="icon"></md-icon>\n </md-button>\n </div>\n</div>'),e.put("app/toolbar/preview/dialog.html",'<md-dialog class="preview-dialog" aria-label="preview">\n <form name="previewForm" class="md-inline-form" novalidate>\n <md-toolbar class="md-background-bg">\n <div class="md-toolbar-tools" layout="row" layout-align="space-between center">\n <span class="title">Preview</span>\n <md-button class="md-icon-button" ng-click="vm.closeDialog()">\n <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>\n </md-button>\n </div>\n </md-toolbar>\n\n <md-dialog-content ms-scroll>\n <div layout="row" ng-if="vm.preview">\n <div class="md-padding md-margin" layout="column" flex="30">\n <md-input-container ng-if="vm.preview.Contact.id" class="md-block no-margin">\n <label translate="CONTACTMANAGER.ID">ID</label>\n <input type="text" ng-model="vm.preview.Contact.id" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Queue.name" class="md-block no-margin">\n <label translate="VOICE.QUEUE">Queue</label>\n <input type="text" ng-model="vm.preview.Queue.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.List.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.LIST">List</label>\n <input type="text" ng-model="vm.preview.List.name" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.tags && vm.preview.Contact.tags.length" class="md-block no-margin">\n <label translate="CONTACTMANAGER.TAGS">Tags</label>\n <input type="text" ng-model="vm.preview.Contact.tags" disabled="true">\n </md-input-container>\n <md-input-container ng-if="vm.preview.Contact.Company && vm.preview.Contact.Company.name" class="md-block no-margin">\n <label translate="CONTACTMANAGER.COMPANY">Company</label>\n <input type="text" ng-model="vm.preview.Contact.Company.name" disabled="true">\n </md-input-container>\n </div>\n <md-divider></md-divider>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && !vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ \'CONTACTMANAGER.\' + key.toUpperCase() | translate}}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n <div class="md-padding md-margin" layout="column" flex="35">\n <md-input-container ng-repeat="(key, value) in vm.preview.Contact" ng-if="!vm.isNil(value) && vm.isCustomField(key) && !vm.isHiddenField(key)" class="md-block no-margin">\n <label>{{ vm.customFieldsMap[key] || key }}</label>\n <input type="text" ng-model="value" disabled="true">\n </md-input-container>\n </div>\n </div>\n <div layout="row" ng-if="!vm.preview">\n <span>no contacts available</span>\n </div>\n </md-dialog-content>\n\n <md-dialog-actions class="md-dialog-action-center padding-rigth-15">\n <md-button class="md-icon-button md-primary" ng-hide="vm.hopperIds.length <= 1" ng-disabled="vm.disableGetContact" ng-click="vm.previousContact()" aria-label="PREVIOUSCONTACT" translate-attr-aria-label="TOOLS.PREVIOUSCONTACT">\n <md-icon md-font-icon="icon-chevron-left"></md-icon>\n </md-button>\n <md-button class="md-fab green-bg" aria-label="CALL" translate-attr-aria-label="TOOLS.CALL" ng-disabled="vm.disable" ng-click="vm.originatePreview($event)">\n <md-icon md-font-icon="icon-phone"></md-icon>\n </md-button>\n <md-button class="md-icon-button md-primary" ng-disabled="vm.disableGetContact" ng-click="vm.nextContact()" aria-label="NEXTCONTACT" translate-attr-aria-label="TOOLS.NEXTCONTACT">\n <md-icon md-font-icon="icon-chevron-right"></md-icon>\n </md-button>\n </md-dialog-actions>\n </form>\n</md-dialog>')}]);
\ No newline at end of file